Skip to content

Commit

Permalink
updating MIC CAN messages
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso committed Jan 20, 2020
1 parent f763100 commit 6d4d462
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions firmware/src/can_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ inline void can_app_send_motor(void)
{

can_t msg;
msg.id = CAN_MSG_MIC19_MOTOR;
msg.length = CAN_LENGTH_MSG_MIC19_MOTOR;
msg.id = CAN_MSG_MIC19_MOTOR_ID;
msg.length = CAN_MSG_MIC19_MOTOR_LENGTH;
msg.flags.rtr = 0;

msg.data[CAN_SIGNATURE_BYTE] = CAN_SIGNATURE_SELF;
Expand All @@ -94,12 +94,12 @@ inline void can_app_send_motor(void)
motor_d_raw = controller_power_channel_turbo_value();
}

msg.data[CAN_MSG_MIC19_MOTOR_D_RAW_BYTE] = motor_d_raw;
msg.data[CAN_MSG_MIC19_MOTOR_D_BYTE] = motor_d_raw;

/********* TESTE COM O MAM ACIONADO CONSTANTEMENTE **********/
msg.data[CAN_MSG_MIC19_MOTOR_I_RAW_BYTE] = 10;
msg.data[CAN_MSG_MIC19_MOTOR_MOTOR_ON_BYTE] |= (1 << CAN_MSG_MIC19_MOTOR_MOTOR_ON_BIT);
msg.data[CAN_MSG_MIC19_MOTOR_DMS_BYTE] |= (1 << CAN_MSG_MIC19_MOTOR_DMS_BIT);
msg.data[CAN_MSG_MIC19_MOTOR_I_BYTE] = 10;
msg.data[CAN_MSG_MIC19_MOTOR_MOTOR_BYTE] |= (1 << CAN_MSG_MIC19_MOTOR_MOTOR_MOTOR_ON_BIT);
msg.data[CAN_MSG_MIC19_MOTOR_MOTOR_BYTE] |= (1 << CAN_MSG_MIC19_MOTOR_MOTOR_DMS_ON_BIT);
/************************************************************/

can_send_message(&msg);
Expand All @@ -111,8 +111,8 @@ inline void can_app_send_mcs(void)
{
can_t msg;

msg.id = CAN_MSG_MIC19_MCS;
msg.length = CAN_LENGHT_MSG_MIC19_MCS;
msg.id = CAN_MSG_MIC19_MCS_ID;
msg.length = CAN_MSG_MIC19_MCS_LENGTH;

for(uint8_t i = msg.length; i; i--) msg.data[i-1] = 0;

Expand Down

0 comments on commit 6d4d462

Please sign in to comment.