Skip to content

Commit ba7b3de

Browse files
author
tsunglung
committed
Fix the range of the number
1 parent 57af461 commit ba7b3de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/taixia/taixia.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static const uint8_t RESPONSE_LENGTH = 255;
234234
uint8_t response[RESPONSE_LENGTH];
235235
uint8_t cmd[6] = {0x06, sa_id, (uint8_t)(WRITE | service_id), 0x00, 0x00, 0x00};
236236

237-
cmd[3] = int(value) << 8 & 0xFF00;
237+
cmd[3] = (int(value) & 0xFF00) >> 8;
238238
cmd[4] = int(value) & 0xFF;
239239
cmd[5] = this->checksum(cmd, 5);
240240
this->write_command_(cmd, response, 6, 6);

0 commit comments

Comments
 (0)