mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
disable board selection.
This commit is contained in:
@@ -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' && (
|
||||
<MenuItem key={'C3MINI'} value={'C3MINI'}>
|
||||
C3 Mini
|
||||
</MenuItem>
|
||||
)}
|
||||
<Divider />
|
||||
<MenuItem key={'CUSTOM'} value={'CUSTOM'}>
|
||||
Custom…
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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<int8_t> 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());
|
||||
|
||||
Reference in New Issue
Block a user