only: CONFIG_RESET_SWITCH is dead

This commit is contained in:
rusefillc 2023-07-24 02:05:14 -04:00
parent 356d3cc701
commit 7235fa937e
3 changed files with 1 additions and 25 deletions

View File

@ -85,10 +85,6 @@
#undef TS_SERIAL_AF
#define TS_SERIAL_AF 8
/* no reset switch */
#undef CONFIG_RESET_SWITCH_PORT
#undef CONFIG_RESET_SWITCH_PIN
#undef ADC_VCC
#define ADC_VCC 2.5f

View File

@ -441,15 +441,6 @@
#define GPS_SERIAL_DEVICE &SD1
#define GPS_SERIAL_SPEED 38400
#ifndef CONFIG_RESET_SWITCH_PORT
// looks like this feature is not extremely popular, we can try living without it now :)
//#define CONFIG_RESET_SWITCH_PORT GPIOD
#endif
#ifndef CONFIG_RESET_SWITCH_PIN
#define CONFIG_RESET_SWITCH_PIN 6
#endif
#ifndef EFI_STORAGE_INT_FLASH
#define EFI_STORAGE_INT_FLASH TRUE
#endif

View File

@ -630,23 +630,12 @@ static void setDefaultEngineConfiguration() {
#include "default_script.lua"
}
#ifdef CONFIG_RESET_SWITCH_PORT
// this pin is not configurable at runtime so that we have a reliable way to reset configuration
#define SHOULD_IGNORE_FLASH() (palReadPad(CONFIG_RESET_SWITCH_PORT, CONFIG_RESET_SWITCH_PIN) == 0)
#else
#define SHOULD_IGNORE_FLASH() (false)
#endif // CONFIG_RESET_SWITCH_PORT
// by default, do not ignore config from flash! use it!
#ifndef IGNORE_FLASH_CONFIGURATION
#define IGNORE_FLASH_CONFIGURATION false
#endif
void loadConfiguration() {
#ifdef CONFIG_RESET_SWITCH_PORT
// initialize the reset pin if necessary
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
@ -654,7 +643,7 @@ void loadConfiguration() {
#endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */
#if EFI_INTERNAL_FLASH
if (SHOULD_IGNORE_FLASH() || IGNORE_FLASH_CONFIGURATION) {
if (IGNORE_FLASH_CONFIGURATION) {
engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
resetConfigurationExt(engineConfiguration->engineType);
writeToFlashNow();