Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: CAN/function_CAN.cpp
- Revision:
- 248:bfdf0f479a38
- Parent:
- 245:e9c5ec04e378
- Child:
- 249:544011ad9c85
diff -r d5742551f432 -r bfdf0f479a38 CAN/function_CAN.cpp
--- 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);
}