init ADC from initHardwareNoConfig

This commit is contained in:
Matthew Kennedy 2025-03-02 14:01:09 -08:00
parent d67c61b554
commit 82a27d68cd
2 changed files with 11 additions and 10 deletions

View File

@ -236,8 +236,6 @@ void initAdcInputs() {
addFastAdcChannel("MAP", engineConfiguration->map.sensor.hwChannel);
#if EFI_INTERNAL_ADC
portInitAdc();
#if EFI_USE_FAST_ADC
fastAdc.init();
#endif // EFI_USE_FAST_ADC

View File

@ -73,7 +73,7 @@ void unlockSpi(spi_device_e device) {
static void initSpiModules() {
if (engineConfiguration->is_enabled_spi_1) {
turnOnSpi(SPI_DEVICE_1);
turnOnSpi(SPI_DEVICE_1);
}
if (engineConfiguration->is_enabled_spi_2) {
turnOnSpi(SPI_DEVICE_2);
@ -289,6 +289,10 @@ void applyNewHardwareSettings() {
calcFastAdcIndexes();
}
// Weak link a stub so that every board doesn't have to implement this function
__attribute__((weak)) void boardInitHardware() { }
__attribute__((weak)) void setPinConfigurationOverrides() { }
// This function initializes hardware that can do so before configuration is loaded
void initHardwareNoConfig() {
efiPrintf("initHardware()");
@ -329,6 +333,12 @@ void initHardwareNoConfig() {
// this should be initialized before detectBoardType()
efiExtiInit();
#endif // HAL_USE_PAL
boardInitHardware();
#if EFI_INTERNAL_ADC
portInitAdc();
#endif
}
void stopHardware() {
@ -366,11 +376,6 @@ void startHardware() {
#endif /* EFI_CAN_SUPPORT */
}
// Weak link a stub so that every board doesn't have to implement this function
__attribute__((weak)) void boardInitHardware() { }
__attribute__((weak)) void setPinConfigurationOverrides() { }
#if HAL_USE_I2C
const I2CConfig i2cfg = {
OPMODE_I2C,
@ -384,8 +389,6 @@ void initHardware() {
return;
}
boardInitHardware();
#if HAL_USE_ADC
initAdcInputs();
#endif /* HAL_USE_ADC */