mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-03-17 21:32:52 +01:00
Protect against negative frequency values (#326)
This commit is contained in:
parent
4b67f1e7ec
commit
04e8a518ea
@ -290,10 +290,10 @@ static esp_err_t PATCH_update_settings(httpd_req_t * req)
|
||||
if ((item = cJSON_GetObjectItem(root, "hostname")) != NULL) {
|
||||
nvs_config_set_string(NVS_CONFIG_HOSTNAME, item->valuestring);
|
||||
}
|
||||
if ((item = cJSON_GetObjectItem(root, "coreVoltage")) != NULL) {
|
||||
if ((item = cJSON_GetObjectItem(root, "coreVoltage")) != NULL && item->valueint > 0) {
|
||||
nvs_config_set_u16(NVS_CONFIG_ASIC_VOLTAGE, item->valueint);
|
||||
}
|
||||
if ((item = cJSON_GetObjectItem(root, "frequency")) != NULL) {
|
||||
if ((item = cJSON_GetObjectItem(root, "frequency")) != NULL && item->valueint > 0) {
|
||||
nvs_config_set_u16(NVS_CONFIG_ASIC_FREQ, item->valueint);
|
||||
}
|
||||
if ((item = cJSON_GetObjectItem(root, "flipscreen")) != NULL) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user