added reset flag for user application read/write
This commit is contained in:
parent
c6d1c2dffe
commit
c8d42a282b
|
|
@ -35,5 +35,7 @@
|
||||||
|
|
||||||
esp_err_t spi_device_polling_transmit_synchronized(spi_device_handle_t handle, spi_transaction_t *trans_desc);
|
esp_err_t spi_device_polling_transmit_synchronized(spi_device_handle_t handle, spi_transaction_t *trans_desc);
|
||||||
|
|
||||||
|
bool GetUserAppNeedReset(void);
|
||||||
|
void SetUserAppNeedReset(bool res);
|
||||||
|
|
||||||
#endif /* COMPONENTS_WEBGUIAPPCOMPONENT_INCLUDE_WEBGUIAPP_H_ */
|
#endif /* COMPONENTS_WEBGUIAPPCOMPONENT_INCLUDE_WEBGUIAPP_H_ */
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ SemaphoreHandle_t xSemaphoreSPIHandle = NULL;
|
||||||
StaticSemaphore_t xSemaphoreSPIBuf;
|
StaticSemaphore_t xSemaphoreSPIBuf;
|
||||||
|
|
||||||
static int NetworkStartTimeout = 0;
|
static int NetworkStartTimeout = 0;
|
||||||
|
static bool isUserAppNeedReset = false;
|
||||||
|
|
||||||
static void InitSysIO(void);
|
static void InitSysIO(void);
|
||||||
static void InitSysSPI(void);
|
static void InitSysSPI(void);
|
||||||
|
|
@ -87,6 +88,7 @@ esp_err_t WebGuiAppInit(void)
|
||||||
// partition table. This size mismatch may cause NVS initialization to fail.
|
// partition table. This size mismatch may cause NVS initialization to fail.
|
||||||
// 2.NVS partition contains data in new format and cannot be recognized by this version of code.
|
// 2.NVS partition contains data in new format and cannot be recognized by this version of code.
|
||||||
// If this happens, we erase NVS partition and initialize NVS again.
|
// If this happens, we erase NVS partition and initialize NVS again.
|
||||||
|
isUserAppNeedReset = true;
|
||||||
ESP_ERROR_CHECK(nvs_flash_erase());
|
ESP_ERROR_CHECK(nvs_flash_erase());
|
||||||
ESP_ERROR_CHECK(nvs_flash_init());
|
ESP_ERROR_CHECK(nvs_flash_init());
|
||||||
ESP_ERROR_CHECK(ResetInitSysConfig());
|
ESP_ERROR_CHECK(ResetInitSysConfig());
|
||||||
|
|
@ -399,3 +401,13 @@ void DelayedRestart(void)
|
||||||
{
|
{
|
||||||
xTaskCreate(DelayedRestartTask, "RestartTask", 1024 * 4, (void*) 0, 3, NULL);
|
xTaskCreate(DelayedRestartTask, "RestartTask", 1024 * 4, (void*) 0, 3, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GetUserAppNeedReset(void)
|
||||||
|
{
|
||||||
|
return isUserAppNeedReset;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetUserAppNeedReset(bool res)
|
||||||
|
{
|
||||||
|
isUserAppNeedReset = res;
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user