mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
disable board selection.
This commit is contained in:
@@ -124,13 +124,18 @@ const SettingsApplication: FC = () => {
|
|||||||
name="board_profile"
|
name="board_profile"
|
||||||
label={LL.BOARD_PROFILE()}
|
label={LL.BOARD_PROFILE()}
|
||||||
value={data.board_profile}
|
value={data.board_profile}
|
||||||
disabled={processingBoard}
|
disabled={processingBoard || data.board_profile === 'C3MINI'}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
onChange={changeBoardProfile}
|
onChange={changeBoardProfile}
|
||||||
margin="normal"
|
margin="normal"
|
||||||
select
|
select
|
||||||
>
|
>
|
||||||
{boardProfileSelectItems()}
|
{boardProfileSelectItems()}
|
||||||
|
{data.board_profile === 'C3MINI' && (
|
||||||
|
<MenuItem key={'C3MINI'} value={'C3MINI'}>
|
||||||
|
C3 Mini
|
||||||
|
</MenuItem>
|
||||||
|
)}
|
||||||
<Divider />
|
<Divider />
|
||||||
<MenuItem key={'CUSTOM'} value={'CUSTOM'}>
|
<MenuItem key={'CUSTOM'} value={'CUSTOM'}>
|
||||||
Custom…
|
Custom…
|
||||||
|
|||||||
@@ -238,8 +238,7 @@ export const BOARD_PROFILES: BoardProfiles = {
|
|||||||
'MH-ET': 'MH-ET Live D1 Mini',
|
'MH-ET': 'MH-ET Live D1 Mini',
|
||||||
LOLIN: 'Lolin D32',
|
LOLIN: 'Lolin D32',
|
||||||
OLIMEX: 'Olimex ESP32-EVB',
|
OLIMEX: 'Olimex ESP32-EVB',
|
||||||
OLIMEXPOE: 'Olimex ESP32-POE',
|
OLIMEXPOE: 'Olimex ESP32-POE'
|
||||||
C3MINI: 'Lolin C3 mini'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface BoardProfileName {
|
export interface BoardProfileName {
|
||||||
|
|||||||
@@ -81,7 +81,11 @@ void WebSettings::read(WebSettings & settings, JsonObject & root) {
|
|||||||
StateUpdateResult WebSettings::update(JsonObject & root, WebSettings & settings) {
|
StateUpdateResult WebSettings::update(JsonObject & root, WebSettings & settings) {
|
||||||
// load default GPIO configuration based on board profile
|
// 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
|
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())) {
|
if (!System::load_board_profile(data, settings.board_profile.c_str())) {
|
||||||
settings.board_profile = "CUSTOM";
|
settings.board_profile = "CUSTOM";
|
||||||
EMSESP::logger().info("No board profile found. Re-setting to %s", settings.board_profile.c_str());
|
EMSESP::logger().info("No board profile found. Re-setting to %s", settings.board_profile.c_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user