From 8f45322b7b3d5faa1406fb6e28086766ba2b772d Mon Sep 17 00:00:00 2001 From: CheeseE Date: Thu, 15 Sep 2022 21:31:58 +0200 Subject: [PATCH] disable board selection. --- interface/src/project/SettingsApplication.tsx | 7 ++++++- interface/src/project/types.ts | 3 +-- src/web/WebSettingsService.cpp | 6 +++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/interface/src/project/SettingsApplication.tsx b/interface/src/project/SettingsApplication.tsx index c4df56b45..334607a6d 100644 --- a/interface/src/project/SettingsApplication.tsx +++ b/interface/src/project/SettingsApplication.tsx @@ -124,13 +124,18 @@ const SettingsApplication: FC = () => { name="board_profile" label={LL.BOARD_PROFILE()} value={data.board_profile} - disabled={processingBoard} + disabled={processingBoard || data.board_profile === 'C3MINI'} variant="outlined" onChange={changeBoardProfile} margin="normal" select > {boardProfileSelectItems()} + {data.board_profile === 'C3MINI' && ( + + C3 Mini + + )} Custom… diff --git a/interface/src/project/types.ts b/interface/src/project/types.ts index 39c4e10da..7cac14bd7 100644 --- a/interface/src/project/types.ts +++ b/interface/src/project/types.ts @@ -238,8 +238,7 @@ export const BOARD_PROFILES: BoardProfiles = { 'MH-ET': 'MH-ET Live D1 Mini', LOLIN: 'Lolin D32', OLIMEX: 'Olimex ESP32-EVB', - OLIMEXPOE: 'Olimex ESP32-POE', - C3MINI: 'Lolin C3 mini' + OLIMEXPOE: 'Olimex ESP32-POE' }; export interface BoardProfileName { diff --git a/src/web/WebSettingsService.cpp b/src/web/WebSettingsService.cpp index 878f6472c..cb97f36d6 100644 --- a/src/web/WebSettingsService.cpp +++ b/src/web/WebSettingsService.cpp @@ -81,7 +81,11 @@ void WebSettings::read(WebSettings & settings, JsonObject & root) { StateUpdateResult WebSettings::update(JsonObject & root, WebSettings & settings) { // load default GPIO configuration based on board profile std::vector data; // // led, dallas, rx, tx, button, phy_type, eth_power, eth_phy_addr, eth_clock_mode - settings.board_profile = root["board_profile"] | EMSESP_DEFAULT_BOARD_PROFILE; + #ifdef ARDUINO_LOLIN_C3_MINI + settings.board_profile = "C3MINI"; + #else + settings.board_profile = root["board_profile"] | EMSESP_DEFAULT_BOARD_PROFILE; + #endif if (!System::load_board_profile(data, settings.board_profile.c_str())) { settings.board_profile = "CUSTOM"; EMSESP::logger().info("No board profile found. Re-setting to %s", settings.board_profile.c_str());