added global setting for board hardware revision, fixed rtos debug info
extracting (conditional build if rtos info enabled)
This commit is contained in:
parent
d941791a46
commit
49bab0ea5c
6
Kconfig
6
Kconfig
|
|
@ -12,6 +12,10 @@ menu "WebGUIApp"
|
|||
default 19 if IDF_TARGET_ESP32C3
|
||||
default 48 if IDF_TARGET_ESP32S3
|
||||
|
||||
config BOARD_HARDWARE_REVISION
|
||||
int "Board hardware revision"
|
||||
range 1 5
|
||||
default 1
|
||||
|
||||
config APP_PROJECT_VER
|
||||
string "Device firmware version"
|
||||
|
|
@ -37,7 +41,7 @@ menu "WebGUIApp"
|
|||
|
||||
config MAIN_FUNCTIONAL_BUTTON_GPIO
|
||||
int "Main functional button GPIO"
|
||||
range -1 39
|
||||
range -1 GPIO_RANGE_MAX
|
||||
default 15
|
||||
help
|
||||
Set the GPIO number for main system button. Mainly needed for settings default reset. If not
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ void bin_to_hex_str(const uint8_t *buf, int len, char *hex);
|
|||
void UnencodeURL(char* URL);
|
||||
esp_err_t SHA256Hash(unsigned char *data, int datalen,
|
||||
unsigned char *res);
|
||||
#if (CONFIG_FREERTOS_USE_TRACE_FACILITY == 1)
|
||||
void vTaskGetRunTimeStatsCustom( char *pcWriteBuffer );
|
||||
|
||||
#endif
|
||||
#endif /* MAIN_INCLUDE_HELPERS_H_ */
|
||||
|
|
|
|||
|
|
@ -544,8 +544,10 @@ static HTTP_IO_RESULT HTTPPostSystemSettings(httpd_req_t *req, char *PostData)
|
|||
{
|
||||
if (!strcmp(tmp, (const char*) "prs"))
|
||||
{
|
||||
#if (CONFIG_FREERTOS_USE_TRACE_FACILITY == 1)
|
||||
vTaskGetRunTimeStatsCustom(rtstat);
|
||||
httpd_resp_sendstr(req, rtstat);
|
||||
#endif
|
||||
return HTTP_IO_DONE_API;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,8 +118,6 @@ static void PrintCheckbox(char *VarData, void *arg, bool checked)
|
|||
|
||||
/*GUI color define*/
|
||||
|
||||
|
||||
|
||||
static void HTTPPrint_bgrclr(char *VarData, void *arg)
|
||||
{
|
||||
const char *sch = CONFIG_WEBGUIAPP_SCH1_BACKGROUNG_COLOR;
|
||||
|
|
@ -160,7 +158,6 @@ static void HTTPPrint_brdclr(char *VarData, void *arg)
|
|||
snprintf(VarData, MAX_DYNVAR_LENGTH, "%s", sch);
|
||||
}
|
||||
|
||||
|
||||
static void HTTPPrint_colchm(char *VarData, void *arg)
|
||||
{
|
||||
if ((*(uint8_t*) arg) == GetSysConf()->ColorSheme)
|
||||
|
|
@ -169,7 +166,6 @@ static void HTTPPrint_colchm(char *VarData, void *arg)
|
|||
snprintf(VarData, MAX_DYNVAR_LENGTH, " ");
|
||||
}
|
||||
|
||||
|
||||
static void HTTPPrint_name(char *VarData, void *arg)
|
||||
{
|
||||
snprintf(VarData, MAX_DYNVAR_LENGTH, "%s", CONFIG_DEVICE_MODEL_NAME);
|
||||
|
|
@ -237,7 +233,10 @@ static void HTTPPrint_fver(char *VarData, void *arg)
|
|||
snprintf(VarData, MAX_DYNVAR_LENGTH, "%s", cur_app_info.version);
|
||||
}
|
||||
}
|
||||
|
||||
static void HTTPPrint_hrev(char *VarData, void *arg)
|
||||
{
|
||||
snprintf(VarData, MAX_DYNVAR_LENGTH, "%d", CONFIG_BOARD_HARDWARE_REVISION);
|
||||
}
|
||||
static void HTTPPrint_fverav(char *VarData, void *arg)
|
||||
{
|
||||
snprintf(VarData, MAX_DYNVAR_LENGTH, "%s", GetAvailVersion());
|
||||
|
|
@ -339,7 +338,8 @@ static void HTTPPrint_ipap(char *VarData, void *arg)
|
|||
if (GetAPNetifAdapter() && esp_netif_is_netif_up(GetAPNetifAdapter()))
|
||||
PrintIPFromInterface(VarData, arg, GetAPNetifAdapter(), IP);
|
||||
else
|
||||
snprintf(VarData, MAX_DYNVAR_LENGTH, "%s", ip4addr_ntoa((const ip4_addr_t*)&GetSysConf()->wifiSettings.ApIPAddr));
|
||||
snprintf(VarData, MAX_DYNVAR_LENGTH, "%s",
|
||||
ip4addr_ntoa((const ip4_addr_t*) &GetSysConf()->wifiSettings.ApIPAddr));
|
||||
}
|
||||
|
||||
static void HTTPPrint_ssid(char *VarData, void *arg)
|
||||
|
|
@ -362,7 +362,8 @@ static void HTTPPrint_ip(char *VarData, void *arg)
|
|||
if (GetSTANetifAdapter() && esp_netif_is_netif_up(GetSTANetifAdapter()))
|
||||
PrintIPFromInterface(VarData, arg, GetSTANetifAdapter(), IP);
|
||||
else
|
||||
snprintf(VarData, MAX_DYNVAR_LENGTH, "%s", ip4addr_ntoa((const ip4_addr_t*)&GetSysConf()->wifiSettings.InfIPAddr));
|
||||
snprintf(VarData, MAX_DYNVAR_LENGTH, "%s",
|
||||
ip4addr_ntoa((const ip4_addr_t*) &GetSysConf()->wifiSettings.InfIPAddr));
|
||||
}
|
||||
/*STA NETMASK*/
|
||||
static void HTTPPrint_msk(char *VarData, void *arg)
|
||||
|
|
@ -370,7 +371,8 @@ static void HTTPPrint_msk(char *VarData, void *arg)
|
|||
if (GetSTANetifAdapter() && esp_netif_is_netif_up(GetSTANetifAdapter()))
|
||||
PrintIPFromInterface(VarData, arg, GetSTANetifAdapter(), NETMASK);
|
||||
else
|
||||
snprintf(VarData, MAX_DYNVAR_LENGTH, "%s", ip4addr_ntoa((const ip4_addr_t*)&GetSysConf()->wifiSettings.InfMask));
|
||||
snprintf(VarData, MAX_DYNVAR_LENGTH, "%s",
|
||||
ip4addr_ntoa((const ip4_addr_t*) &GetSysConf()->wifiSettings.InfMask));
|
||||
}
|
||||
/*STA GATEWAY*/
|
||||
static void HTTPPrint_gate(char *VarData, void *arg)
|
||||
|
|
@ -378,7 +380,8 @@ static void HTTPPrint_gate(char *VarData, void *arg)
|
|||
if (GetSTANetifAdapter() && esp_netif_is_netif_up(GetSTANetifAdapter()))
|
||||
PrintIPFromInterface(VarData, arg, GetSTANetifAdapter(), GW);
|
||||
else
|
||||
snprintf(VarData, MAX_DYNVAR_LENGTH, "%s", ip4addr_ntoa((const ip4_addr_t*)&GetSysConf()->wifiSettings.InfGateway));
|
||||
snprintf(VarData, MAX_DYNVAR_LENGTH, "%s",
|
||||
ip4addr_ntoa((const ip4_addr_t*) &GetSysConf()->wifiSettings.InfGateway));
|
||||
}
|
||||
/*Current DNS*/
|
||||
static void HTTPPrint_dns(char *VarData, void *arg)
|
||||
|
|
@ -777,7 +780,6 @@ dyn_var_handler_t HANDLERS_ARRAY[] = {
|
|||
{ "brdclr", sizeof("brdclr") - 1, &HTTPPrint_brdclr },
|
||||
{ "colchm", sizeof("colchm") - 1, &HTTPPrint_colchm },
|
||||
|
||||
|
||||
/*System settings*/
|
||||
{ "name", sizeof("name") - 1, &HTTPPrint_name },
|
||||
{ "dname", sizeof("dname") - 1, &HTTPPrint_dname },
|
||||
|
|
@ -787,6 +789,7 @@ dyn_var_handler_t HANDLERS_ARRAY[] = {
|
|||
{ "otarst", sizeof("otarst") - 1, &HTTPPrint_otarst },
|
||||
{ "otaint", sizeof("otaint") - 1, &HTTPPrint_otaint },
|
||||
{ "fver", sizeof("fver") - 1, &HTTPPrint_fver },
|
||||
{ "hrev", sizeof("hrev") - 1, &HTTPPrint_hrev },
|
||||
{ "fverav", sizeof("fverav") - 1, &HTTPPrint_fverav },
|
||||
{ "updstat", sizeof("updstat") - 1, &HTTPPrint_updstat },
|
||||
|
||||
|
|
@ -981,11 +984,11 @@ int HTTPPrint(httpd_req_t *req, char *buf, char *var)
|
|||
|
||||
}
|
||||
|
||||
|
||||
void GenerateSystemSettingsJSONFile(void)
|
||||
{
|
||||
char *buf = malloc(2048);
|
||||
if(!buf) return;
|
||||
if (!buf)
|
||||
return;
|
||||
|
||||
jwOpen(buf, 2048, JW_OBJECT, JW_PRETTY);
|
||||
for (int i = 0; i < (sizeof(HANDLERS_ARRAY) / sizeof(HANDLERS_ARRAY[0])); ++i)
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@ esp_err_t SHA256Hash(unsigned char *data, int datalen,
|
|||
return ESP_OK;
|
||||
}
|
||||
|
||||
# if(CONFIG_FREERTOS_USE_TRACE_FACILITY == 1)
|
||||
void vTaskGetRunTimeStatsCustom( char *pcWriteBuffer )
|
||||
{
|
||||
TaskStatus_t *pxTaskStatusArray;
|
||||
|
|
@ -257,3 +258,4 @@ unsigned long ulTotalRunTime, ulStatsAsPercentage;
|
|||
vPortFree( pxTaskStatusArray );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user