소스 검색

Fix: Compiler errors von letztem Commit

Heinrich Blatt 8 달 전
부모
커밋
07cade2a4c
3개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 1 1
      main_target.c
  2. 3 3
      src/battery_data/battery.c
  3. 2 2
      src/interfaces/i2c_hal.c

+ 1 - 1
main_target.c

@@ -124,7 +124,7 @@ int main(void)
             // step 2: control loop to adjust the dac / adc values,
             // but only if no error happens
             // (0x80 is the error flag of the state)
-            if (*battery_slots[i].state & 0x80 == 0) {
+            if ((*battery_slots[slot].state & 0x80) == 0) {
                 battery_slotmgr.adjust_current(slot);
             } else {
                 battery_slotmgr.disable(slot);

+ 3 - 3
src/battery_data/battery.c

@@ -3,10 +3,10 @@
 #include "ti_msp_dl_config.h"
 #include "src/peripherals/dac/dac.h"
 #include "src/peripherals/adc/adc.h"
-#include "src/peripherals/i2c_controller_interface.h"
+#include "src/interfaces/i2c_controller_interface.h"
 // we need the itnerface for the ADC_TARGET_BASE_ADDRESS constant
 // refactor this somewhen to a general constants file
-#include "src/adc/adc_interface.h"
+#include "src/peripherals/adc/adc_interface.h"
 
 // Permissible charge temperature for LiIon battery is 0.0 degree Celsius to 45.0 degree Celsius
 // Correct temp_threshold yet to be analyzed
@@ -60,7 +60,7 @@ static void batteryslots_init() {
             *battery_slots[i].state = SLOT_ERR_NO_DAC;
         }
         // Error state - no I2C on bus - we cannot continue.
-        return
+        return;
     }
 
     for(uint8_t i=0; i< NUM_SLOTS; i++){

+ 2 - 2
src/interfaces/i2c_hal.c

@@ -104,11 +104,11 @@ static bool msp_i2c_read(uint8_t const TARGET_ADDRESS) {
   printf("Scanning 0x%02X\n", i2c_addr);
   DL_I2C_startControllerTransfer(I2C_controller_INST, i2c_addr, DL_I2C_CONTROLLER_DIRECTION_RX, 1);
   delay_cycles(5000);
-  i2c_status = DL_I2C_getControllerStatus(I2C_controller_INST);
+  uint32_t i2c_status = DL_I2C_getControllerStatus(I2C_controller_INST);
   bool found = !(DL_I2C_getControllerStatus(I2C_controller_INST) & DL_I2C_CONTROLLER_STATUS_ERROR);
   DL_I2C_disableController(I2C_controller_INST);
   DL_I2C_enableController(I2C_controller_INST);
-  return found
+  return found;
 }
 
 I2C_Interface i2c_hal = {