diff options
Diffstat (limited to 'main/config.c')
| -rw-r--r-- | main/config.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/main/config.c b/main/config.c index d7837bc..7e8a14c 100644 --- a/main/config.c +++ b/main/config.c | |||
| @@ -19,6 +19,7 @@ esp_err_t tollgate_config_init(void) | |||
| 19 | g_config.ap_max_conn = 4; | 19 | g_config.ap_max_conn = 4; |
| 20 | g_config.price_per_step = 21; | 20 | g_config.price_per_step = 21; |
| 21 | g_config.step_size_ms = 60000; | 21 | g_config.step_size_ms = 60000; |
| 22 | g_config.persist_threshold_sats = 1; | ||
| 22 | 23 | ||
| 23 | esp_vfs_spiffs_conf_t conf = { | 24 | esp_vfs_spiffs_conf_t conf = { |
| 24 | .base_path = "/spiffs", | 25 | .base_path = "/spiffs", |
| @@ -117,6 +118,9 @@ esp_err_t tollgate_config_init(void) | |||
| 117 | cJSON *step = cJSON_GetObjectItem(root, "step_size_ms"); | 118 | cJSON *step = cJSON_GetObjectItem(root, "step_size_ms"); |
| 118 | if (step) g_config.step_size_ms = step->valueint; | 119 | if (step) g_config.step_size_ms = step->valueint; |
| 119 | 120 | ||
| 121 | cJSON *persist = cJSON_GetObjectItem(root, "persist_threshold_sats"); | ||
| 122 | if (persist) g_config.persist_threshold_sats = (uint64_t)persist->valuedouble; | ||
| 123 | |||
| 120 | cJSON_Delete(root); | 124 | cJSON_Delete(root); |
| 121 | ESP_LOGI(TAG, "Config loaded: AP='%s', %d WiFi networks, price=%d sats/%dms", | 125 | ESP_LOGI(TAG, "Config loaded: AP='%s', %d WiFi networks, price=%d sats/%dms", |
| 122 | g_config.ap_ssid, g_config.network_count, g_config.price_per_step, g_config.step_size_ms); | 126 | g_config.ap_ssid, g_config.network_count, g_config.price_per_step, g_config.step_size_ms); |