![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
2011
Diff: CAN/function_CAN.cpp
- Revision:
- 235:bfdf0f479a38
- Parent:
- 232:e9c5ec04e378
- Child:
- 236:544011ad9c85
--- a/CAN/function_CAN.cpp Fri Jun 17 09:30:42 2022 +0000 +++ b/CAN/function_CAN.cpp Fri Jun 24 00:18:20 2022 +0000 @@ -1087,14 +1087,18 @@ void CAN_TX_VALVE_LIMIT(void) { CANMessage temp_msg; + int16_t temp_valve_min_pos = 0; + int16_t temp_valve_max_pos = 0; + temp_valve_min_pos = (int16_t) ((float) VALVE_MIN_POS * 0.1f); + temp_valve_max_pos = (int16_t) ((float) VALVE_MAX_POS * 0.1f); temp_msg.id = CID_TX_INFO; temp_msg.len = 5; temp_msg.data[0] = (uint8_t) CTX_SEND_VALVE_LIMIT; - temp_msg.data[1] = (uint8_t) VALVE_MIN_POS; - temp_msg.data[2] = (uint8_t) (VALVE_MIN_POS >> 8); - temp_msg.data[3] = (uint8_t) VALVE_MAX_POS; - temp_msg.data[4] = (uint8_t) (VALVE_MAX_POS >> 8); + temp_msg.data[1] = (uint8_t) temp_valve_min_pos; + temp_msg.data[2] = (uint8_t) (temp_valve_min_pos >> 8); + temp_msg.data[3] = (uint8_t) temp_valve_max_pos; + temp_msg.data[4] = (uint8_t) (temp_valve_max_pos >> 8); can.write(temp_msg); }