Call startSmartCsPins when applying new settings (#2194)

Only stopSmartCsPins was called from applyNewHardwareSettings.
This cause lost of CS pins for external gpio chips
This commit is contained in:
Andrey G 2021-01-06 16:59:13 +03:00 committed by GitHub
parent b4c24d2f35
commit 37cd9266d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 3 deletions

View File

@ -339,9 +339,9 @@ void applyNewHardwareSettings(void) {
}
#endif
#if (BOARD_TLE6240_COUNT > 0) || (BOARD_DRV8860_COUNT > 0)
#if (BOARD_EXT_GPIOCHIPS > 0)
stopSmartCsPins();
#endif /* (BOARD_MC33972_COUNT > 0) */
#endif /* (BOARD_EXT_GPIOCHIPS > 0) */
#if EFI_VEHICLE_SPEED
stopVSSPins();
@ -390,7 +390,9 @@ void applyNewHardwareSettings(void) {
ButtonDebounce::startConfigurationList();
/*******************************************
* Start everything back with new settings *
******************************************/
#if EFI_SHAFT_POSITION_INPUT
startTriggerInputPins();
@ -404,6 +406,21 @@ void applyNewHardwareSettings(void) {
startHD44780_pins();
#endif /* #if EFI_HD44780_LCD */
#if (BOARD_EXT_GPIOCHIPS > 0)
/* TODO: properly restart gpio chips...
* This is only workaround for "CS pin lost" bug
* see: https://github.com/rusefi/rusefi/issues/2107
* We should provide better way to gracefully stop all
* gpio chips: set outputs to safe state, release all
* on-chip resources (gpios, SPIs, etc) and then restart
* with updated settings.
* Following code just re-inits CS pins for all external
* gpio chips, but does not update CS pin definition in
* gpio chips private data/settings. So changing CS pin
* on-fly does not work */
startSmartCsPins();
#endif /* (BOARD_EXT_GPIOCHIPS > 0) */
enginePins.startPins();
#if EFI_CAN_SUPPORT