Only perform SD card init if SD logging is enabled

This commit is contained in:
Josh Stewart 2024-11-19 12:36:48 +11:00
parent a9dcc597c3
commit 95664baee6
2 changed files with 5 additions and 3 deletions

View File

@ -1603,6 +1603,8 @@ page = 15
requiresPowerCycle = fuelPressurePin
requiresPowerCycle = oilPressurePin
requiresPowerCycle = onboard_log_file_style
defaultValue = pinLayout, 1
defaultValue = TrigPattern, 0
defaultValue = useResync, 1
@ -2024,13 +2026,13 @@ menuDialog = main
menu = "Data Logging"
#if mcu_teensy
subMenu = std_ms3SdConsole, "Browse / Import SD Card"
subMenu = rtc_settings, "Setup realtime clock"
subMenu = onboard_log_setup, "Setup onboard logger / SD"
subMenu = std_ms3SdConsole, "Browse / Import SD Card", { onboard_log_file_style }
#else
subMenu = std_ms3SdConsole, "Browse / Import SD Card", { arrayValue( array.boardHasRTC, pinLayout ) > 0 }
subMenu = rtc_settings, "Setup realtime clock", { arrayValue( array.boardHasRTC, pinLayout ) > 0 }
subMenu = onboard_log_setup, "Setup onboard logger / SD", { arrayValue( array.boardHasRTC, pinLayout ) > 0 }
subMenu = std_ms3SdConsole, "Browse / Import SD Card", { arrayValue( array.boardHasRTC, pinLayout ) > 0 && onboard_log_file_style }
#endif

View File

@ -159,7 +159,7 @@ void initialiseAll(void)
#ifdef SD_LOGGING
initRTC();
initSD();
if(configPage13.onboard_log_file_style) { initSD(); }
#endif
Serial.begin(115200);