File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
- v1.0.8
1
+ v1.0.9
Original file line number Diff line number Diff line change @@ -32,10 +32,10 @@ uint32_t ts_last = 0;
32
32
static void toyota_rx_hook (CAN_FIFOMailBox_TypeDef * to_push ) {
33
33
// get eps motor torque (0.66 factor in dbc)
34
34
if ((to_push -> RIR >>21 ) == 0x260 ) {
35
- int torque_meas_new = (((to_push -> RDHR ) & 0xFF00 ) | ((to_push -> RDHR >> 16 ) & 0xFF ));
35
+ int16_t torque_meas_new_16 = (((to_push -> RDHR ) & 0xFF00 ) | ((to_push -> RDHR >> 16 ) & 0xFF ));
36
36
37
37
// increase torque_meas by 1 to be conservative on rounding
38
- torque_meas_new = (torque_meas_new * dbc_eps_torque_factor / 100 ) + (torque_meas_new > 0 ? 1 : -1 );
38
+ int torque_meas_new = (( int )( torque_meas_new_16 ) * dbc_eps_torque_factor / 100 ) + (torque_meas_new_16 > 0 ? 1 : -1 );
39
39
40
40
// shift the array
41
41
for (int i = sizeof (torque_meas )/sizeof (torque_meas [0 ]) - 1 ; i > 0 ; i -- ) {
You can’t perform that action at this time.
0 commit comments