30 lines
836 B
C
30 lines
836 B
C
#ifndef SERIAL_TASK_H
|
|
#define SERIAL_TASK_H
|
|
|
|
#include <Arduino.h>
|
|
#include <freertos/FreeRTOS.h>
|
|
#include <freertos/task.h>
|
|
#include <freertos/queue.h>
|
|
#include "config.h"
|
|
|
|
extern QueueHandle_t queueSD;
|
|
extern QueueHandle_t queueWeb;
|
|
extern QueueHandle_t queueTX;
|
|
|
|
extern volatile uint32_t serialBaud;
|
|
extern volatile uint8_t serialDataBits;
|
|
extern volatile char serialParity;
|
|
extern volatile uint8_t serialStopBits;
|
|
extern volatile uint8_t serialPort; // 0=UART2(GPIO16/17), 1=UART0(USB)
|
|
|
|
extern HardwareSerial* monSerial; // Active monitoring serial port
|
|
|
|
void serialTaskInit();
|
|
void serialRxTask(void *param);
|
|
void serialTxTask(void *param);
|
|
void reconfigureSerial(uint32_t baud, uint8_t dataBits, char parity, uint8_t stopBits);
|
|
void switchSerialPort(uint8_t port);
|
|
void getTimestamp(char *buf, size_t len);
|
|
|
|
#endif
|