Modify Wifi onboarding code

This commit is contained in:
Manticore 2025-02-28 19:08:29 +05:30
parent cf865d3492
commit 263f61545c
2 changed files with 29 additions and 26 deletions

View File

@ -8,28 +8,28 @@
#ifndef MAIN_MCP39F501_H_ #ifndef MAIN_MCP39F501_H_
#define MAIN_MCP39F501_H_ #define MAIN_MCP39F501_H_
#define MCP39F501_HEADER '0xa5' #define MCP39F501_HEADER "0xa5"
#define MCP39F501_OK 0x00 #define MCP39F501_OK "0x00"
#define MCP39F501_TIMEOUT 0xff #define MCP39F501_TIMEOUT "0xff"
#define MCP39F501_CSFAIL 0x01 #define MCP39F501_CSFAIL "0x01"
#define MCP39F501_BADCSUM 0x02 #define MCP39F501_BADCSUM "0x02"
#define MCP39F501_INOVFLOW 0x03 #define MCP39F501_INOVFLOW "0x03"
#define MCP39F501_OUTOVFLOW 0x04 #define MCP39F501_OUTOVFLOW "0x04"
#define MCP39F501_TOOSHORT 0x05 #define MCP39F501_TOOSHORT "0x05"
#define MCP39F501_TOOLONG 0x06 #define MCP39F501_TOOLONG "0x06"
#define MCP39F501_INBAD 0x07 #define MCP39F501_INBAD "0x07"
#define MCP39F501_INSIZE 0x08 #define MCP39F501_INSIZE "0x08"
#define MCP39F501_EV_OC 0x8000 #define MCP39F501_EV_OC "0x8000"
#define MCP39F501_EV_OV 0x4000 #define MCP39F501_EV_OV "0x4000"
#define MCP39F501_EV_OP 0x2000 #define MCP39F501_EV_OP "0x2000"
#define MCP39F501_EV_UV 0x1000 #define MCP39F501_EV_UV "0x1000"
#define MCP39F501_EV_OF 0x0800 #define MCP39F501_EV_OF "0x0800"
#define MCP39F501_EV_UF 0x0400 #define MCP39F501_EV_UF "0x0400"
#define MCP39F501_EV_OT 0x0200 #define MCP39F501_EV_OT "0x0200"
#define MCP39F501_EV_UT 0x0100 #define MCP39F501_EV_UT "0x0100"
#define MCP39F501_EV_VSA 0x0080 #define MCP39F501_EV_VSA "0x0080"
#define MCP39F501_EV_VSU 0x0040 #define MCP39F501_EV_VSU "0x0040"
#endif /* MAIN_MCP39F501_H_ */ #endif /* MAIN_MCP39F501_H_ */

View File

@ -34,12 +34,15 @@ void app_main(void)
/* Create the UART tasks for both UART0 and UART1 */ /* Create the UART tasks for both UART0 and UART1 */
uart_create_rx_tasks(); uart_create_rx_tasks();
char* test_str = "0xFF\n\r"; // uint8_t* test_str[2] = { 0x01, 0x00 };
// char* test_str = MCP39F501_HEADER;
while(1) /* while(1)
{ {
uart_ifx_uart1_send_bytes((uint8_t *)test_str, strlen(test_str));
uart_ifx_uart1_send_bytes(&test_str, strlen(test_str));
@ -48,7 +51,7 @@ void app_main(void)
vTaskDelay(100 / portTICK_PERIOD_MS); vTaskDelay(100 / portTICK_PERIOD_MS);
ESP_LOGI(TAG,"*** data send ***"); ESP_LOGI(TAG,"*** data send ***");
} }
*/
/* read the comms-mode from the NVS (if any) */ /* read the comms-mode from the NVS (if any) */
comms_mode = nvm_read_comms_mode(); comms_mode = nvm_read_comms_mode();
@ -72,7 +75,7 @@ void app_main(void)
Connect_wifi_sta(WIFI_MODE_STA); Connect_wifi_sta(WIFI_MODE_STA);
ESP_LOGI(TAG," -------------> Wifi Connected ... :)"); ESP_LOGI(TAG," -------------> Wifi Connected ... :)");
wifi_ota_start_firmware_update(IMEI); // wifi_ota_start_firmware_update(IMEI);
while(1){ while(1){