This commit is contained in:
Matthew Kennedy 2021-03-30 04:28:22 -07:00 committed by GitHub
parent ed76e22e1b
commit 523bef2eb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -152,7 +152,7 @@ engine_configuration_s & activeConfiguration = activeConfigurationLocalStorage;
extern engine_configuration_s *engineConfiguration;
static void rememberCurrentConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
void rememberCurrentConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
#if ! EFI_ACTIVE_CONFIGURATION_IN_FLASH
memcpy(&activeConfiguration, engineConfiguration, sizeof(engine_configuration_s));
#else
@ -1144,6 +1144,11 @@ void loadConfiguration(Logging* logger DECLARE_ENGINE_PARAMETER_SUFFIX) {
palSetPadMode(CONFIG_RESET_SWITCH_PORT, CONFIG_RESET_SWITCH_PIN, PAL_MODE_INPUT_PULLUP);
#endif /* CONFIG_RESET_SWITCH_PORT */
#if ! EFI_ACTIVE_CONFIGURATION_IN_FLASH
// Clear the active configuration so that registered output pins (etc) detect the change on startup and init properly
prepareVoidConfiguration(&activeConfiguration);
#endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */
#if EFI_INTERNAL_FLASH
if (SHOULD_IGNORE_FLASH() || IGNORE_FLASH_CONFIGURATION) {
engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
@ -1159,8 +1164,6 @@ void loadConfiguration(Logging* logger DECLARE_ENGINE_PARAMETER_SUFFIX) {
engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
resetConfigurationExt(logger, engineConfiguration->engineType PASS_ENGINE_PARAMETER_SUFFIX);
#endif /* EFI_INTERNAL_FLASH */
rememberCurrentConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
}
void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallback, engine_type_e engineType DECLARE_ENGINE_PARAMETER_SUFFIX) {

View File

@ -61,6 +61,8 @@ typedef void (*configuration_callback_t)(engine_configuration_s*);
void loadConfiguration(Logging* logger DECLARE_ENGINE_PARAMETER_SUFFIX);
void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallback, engine_type_e engineType DECLARE_ENGINE_PARAMETER_SUFFIX);
void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_ENGINE_PARAMETER_SUFFIX);
void rememberCurrentConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE);
#endif /* __cplusplus */
struct ConfigOverrides {

View File

@ -237,6 +237,9 @@ void runRusEfi(void) {
*/
initEngineContoller(&sharedLogger PASS_ENGINE_PARAMETER_SIGNATURE);
// This has to happen after RegisteredOutputPins are init'd: otherwise no change will be detected, and no init will happen
rememberCurrentConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
#if EFI_PERF_METRICS
initTimePerfActions(&sharedLogger);
#endif