mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-06 03:50:13 +02:00
🐛 fix compilation bugs with daly bms
This commit is contained in:
parent
5de2af3bdf
commit
1f5bcde8aa
3 changed files with 7 additions and 11 deletions
|
@ -69,8 +69,8 @@ uint32_t decode_uint32be(uint8_t data[8], uint8_t offset) {
|
|||
((uint32_t)data[offset + 3]);
|
||||
}
|
||||
|
||||
void decode_packet(uint8_t data[8]) {
|
||||
switch (buff[2]) {
|
||||
void decode_packet(uint8_t command, uint8_t data[8]) {
|
||||
switch (command) {
|
||||
case 0x90:
|
||||
voltage_dV = decode_uint16be(data, 0);
|
||||
current_dA = decode_int16be(data, 4) - 30000;
|
||||
|
@ -139,7 +139,7 @@ void receive_RS485() {
|
|||
}
|
||||
|
||||
if (recv_len > 12) {
|
||||
decode_packet(&recv_buff[4]);
|
||||
decode_packet(recv_buff[2], &recv_buff[4]);
|
||||
recv_len = 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue