update UART code

This commit is contained in:
Manticore 2025-02-28 13:24:05 +05:30
parent 961517db0a
commit cf865d3492
3 changed files with 20 additions and 1 deletions

View File

@ -8,7 +8,7 @@
#ifndef MAIN_MCP39F501_H_
#define MAIN_MCP39F501_H_
#define MCP39F501_HEADER 0xa5
#define MCP39F501_HEADER '0xa5'
#define MCP39F501_OK 0x00
#define MCP39F501_TIMEOUT 0xff
#define MCP39F501_CSFAIL 0x01

View File

@ -13,6 +13,8 @@
#include "MCP39F501.h"
#include "wifi_OTA.h"
#include "wifi_Init.h"
#include "MCP39F501.h"
#define IMEI "353165803930522"
@ -32,6 +34,21 @@ void app_main(void)
/* Create the UART tasks for both UART0 and UART1 */
uart_create_rx_tasks();
char* test_str = "0xFF\n\r";
while(1)
{
uart_ifx_uart1_send_bytes((uint8_t *)test_str, strlen(test_str));
// uart_write_bytes(1, (const char*)test_str, strlen(test_str));
vTaskDelay(100 / portTICK_PERIOD_MS);
ESP_LOGI(TAG,"*** data send ***");
}
/* read the comms-mode from the NVS (if any) */
comms_mode = nvm_read_comms_mode();

View File

@ -210,9 +210,11 @@ void uart_ifx_init(void)
//ESP_ERROR_CHECK(uart_driver_install(UART_NUM_0, (BUF_SIZE+1024), (BUF_SIZE+1024), 20, &uart0_queue, 0));
//ESP_ERROR_CHECK(uart_param_config(UART_NUM_0, &uart_config));
ESP_ERROR_CHECK(uart_driver_install(UART_NUM_1, (BUF_SIZE+1024), (BUF_SIZE+1024), 20, &uart1_queue, 0));
ESP_ERROR_CHECK(uart_param_config(UART_NUM_1, &uart_config));
//Set UART log level
esp_log_level_set(TAG, ESP_LOG_INFO);