Browse Source

update

sunlight
zhaohe 11 months ago
parent
commit
1ecc235cbb
  1. 1
      uappbase/service/config_service.cpp
  2. 2
      ucomponents/eeprom/m24m02_i2c_eeprom.cpp

1
uappbase/service/config_service.cpp

@ -58,6 +58,7 @@ bool ConfigService::initialize() {
AppHal::MX_I2C1_Init();
eeprom.initialize(&hi2c1);
eeprom.scan_i2c();
static_assert(kcfg_max == CFG_MAX_INDEX, "");
if (!checkcfg()) {

2
ucomponents/eeprom/m24m02_i2c_eeprom.cpp

@ -102,6 +102,7 @@ int32_t M24M02_I2C_EEPROM::read32(uint16_t add, uint32_t* val) {
void M24M02_I2C_EEPROM::scan_i2c() {
memset(i2c_ping_state, 0, sizeof(i2c_ping_state));
ZLOGI(TAG, "scan i2c");
for (uint16_t i = 0; i < 255; i++) {
HAL_StatusTypeDef status = HAL_I2C_IsDeviceReady(m_i2c_handle, i << 1, 1, 1);
if (status == HAL_OK) {
@ -111,6 +112,7 @@ void M24M02_I2C_EEPROM::scan_i2c() {
i2c_ping_state[i] = false;
}
}
ZLOGI(TAG, "scan i2c done");
}
void M24M02_I2C_EEPROM::write_test_data_rom() {

Loading…
Cancel
Save