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 |
Referenced by usart_command_console_task().
#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 | ) |
References cli_usart, freertos_usart_write_packet, portTICK_RATE_MS, and portTickType.
Referenced by created_task().
|
static |
References cli_usart, configASSERT, configCOMMAND_INT_MAX_OUTPUT_SIZE, FreeRTOS_CLIGetOutputBuffer(), FreeRTOS_CLIProcessCommand(), freertos_usart_serial_read_packet(), freertos_usart_write_packet, line_separator, MAX_INPUT_SIZE, new_line, pdFALSE, portTICK_RATE_MS, portTickType, and welcome_message.
Referenced by create_usart_cli_task().
|
static |
Referenced by usart_cli_output(), and usart_command_console_task().
|
static |
Referenced by usart_command_console_task().
|
static |
Referenced by usart_command_console_task().
|
static |
Referenced by create_usart_cli_task().
|
static |
Referenced by usart_command_console_task().