Microchip® Advanced Software Framework

USART-CLI-task.c File Reference

FreeRTOS+CLI task implementation example.

Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.

#include <stdint.h>
#include <string.h>
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"
#include "FreeRTOS_CLI.h"
#include <freertos_usart_serial.h>
#include "demo-tasks.h"

Macros

#define CLI_BAUD_RATE   115200
 
#define MAX_INPUT_SIZE   50
 
#define RX_BUFFER_SIZE_BYTES   (50)
 

Functions

void create_usart_cli_task (Usart *usart_base, uint16_t stack_depth_words, unsigned portBASE_TYPE task_priority)
 
void usart_cli_output (const uint8_t *message_string)
 
static void usart_command_console_task (void *pvParameters)
 

Variables

static freertos_usart_if cli_usart = NULL
 
static const uint8_t *const line_separator = (uint8_t *) "\r\n[Press ENTER to execute the previous command again]\r\n>"
 
static const uint8_t *const new_line = (uint8_t *) "\r\n"
 
static uint8_t receive_buffer [RX_BUFFER_SIZE_BYTES] = {0}
 
static const uint8_t *const welcome_message = (uint8_t *) "FreeRTOS command server.\r\nType Help to view a list of registered commands.\r\n\r\n>"
 

#define CLI_BAUD_RATE   115200

Referenced by create_usart_cli_task().

#define MAX_INPUT_SIZE   50
#define RX_BUFFER_SIZE_BYTES   (50)

Referenced by create_usart_cli_task().

void create_usart_cli_task ( Usart *  usart_base,
uint16_t  stack_depth_words,
unsigned portBASE_TYPE  task_priority 
)
void usart_cli_output ( const uint8_t *  message_string)

freertos_usart_if cli_usart = NULL
static
const uint8_t* const line_separator = (uint8_t *) "\r\n[Press ENTER to execute the previous command again]\r\n>"
static
const uint8_t* const new_line = (uint8_t *) "\r\n"
static
uint8_t receive_buffer[RX_BUFFER_SIZE_BYTES] = {0}
static

Referenced by create_usart_cli_task().

const uint8_t* const welcome_message = (uint8_t *) "FreeRTOS command server.\r\nType Help to view a list of registered commands.\r\n\r\n>"
static