Skip to content

Commit

Permalink
Better NV workaround for F411
Browse files Browse the repository at this point in the history
  • Loading branch information
hjd1964 committed May 4, 2021
1 parent 75d1881 commit e3352ac
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/HAL/STM32F4/STM32F411.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ HardwareSerial HWSerial2(PA3, PA2); // RX2, TX2
#define NV_ENDURANCE HIGH
#define E2END 8191
#define I2C_EEPROM_ADDRESS 0x50
#define NV_VALIDATE
#define HAL_WIRE_RESET_AFTER_CONNECT
#include "../drivers/NV_I2C_EEPROM_24XX_C.h"
#elif defined(NV_MB85RC256V)
#include "../drivers/NV_I2C_FRAM_MB85RC256V.h"
Expand Down
6 changes: 5 additions & 1 deletion src/lib/TLS.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ class timeLocationSource {
active=true;
} else DLF("WRN, tls.init(): DS3231 GetIsRunning() false");
} else DLF("WRN, tls.init(): DS3231 not found at I2C address 0x68");

#ifdef HAL_WIRE_RESET_AFTER_CONNECT
HAL_Wire.end();
HAL_Wire.begin();
HAL_Wire.setClock(HAL_WIRE_CLOCK);
#endif
return active;
}

Expand Down
4 changes: 4 additions & 0 deletions src/lib/Weather.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ class weather {
#endif
// follow any I2C device in-library init with a reset of the I2C bus speed
#if WEATHER == BME280 || WEATHER == BME280_0x76 || WEATHER == BMP280_0x76 || WEATHER == BMP280
#ifdef HAL_WIRE_RESET_AFTER_CONNECT
HAL_Wire.end();
HAL_Wire.begin();
#endif
HAL_Wire.setClock(HAL_WIRE_CLOCK);
#endif
#endif
Expand Down

0 comments on commit e3352ac

Please sign in to comment.