Browse Source

battery measure read code updated

namrota ghosh 8 months ago
parent
commit
56a05aef37
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/i2c_comm/mcu_slave_interface.c

+ 2 - 1
src/i2c_comm/mcu_slave_interface.c

@@ -13,7 +13,7 @@ References: https://stackoverflow.com/questions/246127/why-is-volatile-needed-in
 // need to select the right one, passing a pointer as an argument
 
 void mcu_i2c_handle(I2C_Regs *i2c) {
-  printf("MCU interrupt triggered\n");
+  //printf("MCU interrupt triggered\n");
   uint8_t receivedCommand = DL_I2C_receiveTargetData(i2c);
   printf("[SLAVE] Received Command: 0x%02X\n", receivedCommand);
   uint8_t tx_buffer[8] = {0};
@@ -29,6 +29,7 @@ void mcu_i2c_handle(I2C_Regs *i2c) {
     }
     // Struct for voltage, current and temperature
     BatteryMeasurementData battery_measure;
+    //Battery *battery= &batteries[slot];
     // take the updated battery measurement from the battery struct and store it
     // in the battery_measure struct
     battery_measure.voltage = batteries[slot].voltage;