I2C EEPROM support #3860

This commit is contained in:
rusefillc 2022-02-06 19:48:20 -05:00
parent ad57fd1628
commit 8892cd26ff
1 changed files with 4 additions and 1 deletions

View File

@ -479,12 +479,13 @@ __attribute__((weak)) void boardInitHardware() { }
__attribute__((weak)) void setPinConfigurationOverrides() { } __attribute__((weak)) void setPinConfigurationOverrides() { }
#if HAL_USE_I2C
const I2CConfig i2cfg = { const I2CConfig i2cfg = {
OPMODE_I2C, OPMODE_I2C,
400000, 400000,
FAST_DUTY_CYCLE_2, FAST_DUTY_CYCLE_2,
}; };
#endif
void initHardware() { void initHardware() {
#if EFI_HD44780_LCD #if EFI_HD44780_LCD
@ -500,9 +501,11 @@ void initHardware() {
return; return;
} }
#if HAL_USE_I2C
if (engineConfiguration->useEeprom) { if (engineConfiguration->useEeprom) {
i2cStart(&I2CD3, &i2cfg); i2cStart(&I2CD3, &i2cfg);
} }
#endif // HAL_USE_I2C
boardInitHardware(); boardInitHardware();