Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiaai committed Feb 11, 2024
1 parent 622ce74 commit b1e4c67
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/LDS_DELTA_2G.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ LDS::result_t LDS_DELTA_2G::processByte(uint8_t c) {
case 8: // data length LSB
data_length = decodeUInt16(scan_packet.data_length);
if (data_length == 0 || data_length > MAX_DATA_BYTE_LEN)
result = ERROR_INVALID_PACKET;
result = ERROR_INVALID_PACKET;
break;

default:
Expand Down Expand Up @@ -228,8 +228,8 @@ LDS::result_t LDS_DELTA_2G::processByte(uint8_t c) {

uint16_t LDS_DELTA_2G::decodeUInt16(const uint16_t value) const {
union {
uint16_t i;
char c[2];
uint16_t i;
char c[2];
} bint = {0x0102};

return bint.c[0] == 0x01 ? value : (value << 8) + (value >> 8);
Expand Down

0 comments on commit b1e4c67

Please sign in to comment.