update UART code
This commit is contained in:
parent
961517db0a
commit
cf865d3492
@ -8,7 +8,7 @@
|
|||||||
#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
|
||||||
|
|||||||
17
main/main.c
17
main/main.c
@ -13,6 +13,8 @@
|
|||||||
#include "MCP39F501.h"
|
#include "MCP39F501.h"
|
||||||
#include "wifi_OTA.h"
|
#include "wifi_OTA.h"
|
||||||
#include "wifi_Init.h"
|
#include "wifi_Init.h"
|
||||||
|
#include "MCP39F501.h"
|
||||||
|
|
||||||
|
|
||||||
#define IMEI "353165803930522"
|
#define IMEI "353165803930522"
|
||||||
|
|
||||||
@ -32,6 +34,21 @@ 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";
|
||||||
|
|
||||||
|
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) */
|
/* read the comms-mode from the NVS (if any) */
|
||||||
comms_mode = nvm_read_comms_mode();
|
comms_mode = nvm_read_comms_mode();
|
||||||
|
|
||||||
|
|||||||
@ -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_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_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_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));
|
ESP_ERROR_CHECK(uart_param_config(UART_NUM_1, &uart_config));
|
||||||
|
|
||||||
|
|
||||||
//Set UART log level
|
//Set UART log level
|
||||||
esp_log_level_set(TAG, ESP_LOG_INFO);
|
esp_log_level_set(TAG, ESP_LOG_INFO);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user