Pārlūkot izejas kodu

small change in bitmasking from 0x07 for slot_id to 0x0F

namrota ghosh 8 mēneši atpakaļ
vecāks
revīzija
1e836a8605
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      src/i2c_target.c

+ 1 - 1
src/i2c_target.c

@@ -55,7 +55,7 @@ void pi_i2c_mcu() {
   else if ((receivedCommand & 0xF0) == 0x20) {
 
     // printf("Received Command: 0x%02X\n", receivedCommand);
-    uint8_t requestedSlot = (receivedCommand & 0x07);
+    uint8_t requestedSlot = (receivedCommand & 0x0F);
     //printf("Requested slot:%d\n", requestedSlot);
     piTxLen = sizeof(BatteryData);
     BatteryData battery_data;