Microchip® Advanced Software Framework

USB-CDC-CLI-task.c File Reference

FreeRTOS+CLI task implementation example.

Copyright (c) 2014-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 <udi_cdc.h>
#include <udc.h>
#include "demo-tasks.h"

Macros

#define EVENT_QUEUE_LENGTH   (5)
 
#define MAX_INPUT_SIZE   50
 
#define RX_BUFFER_SIZE_BYTES   (50)
 

Functions

void cdc_cli_output (const uint8_t const *message_string)
 
void cli_cdc_disable (uint8_t port)
 
bool cli_cdc_enable (uint8_t port)
 
void cli_cdc_rx_notify (uint8_t port)
 
void cli_vbus_event (bool b_vbus_high)
 
void create_usb_cdc_cli_task (uint16_t stack_depth_words, unsigned portBASE_TYPE task_priority)
 
static void usb_cdc_command_console_task (void *pvParameters)
 

Variables

static xSemaphoreHandle access_mutex = NULL
 
static volatile bool cdc_connected = false
 
static xSemaphoreHandle cdc_new_data_semaphore = 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"
 

#define EVENT_QUEUE_LENGTH   (5)
#define MAX_INPUT_SIZE   50
#define RX_BUFFER_SIZE_BYTES   (50)

void cdc_cli_output ( const uint8_t const *  message_string)
void cli_cdc_disable ( uint8_t  port)

References cdc_connected.

bool cli_cdc_enable ( uint8_t  port)

References cdc_connected.

void cli_cdc_rx_notify ( uint8_t  port)
void cli_vbus_event ( bool  b_vbus_high)

References udc_attach(), and udc_detach().

Referenced by usb_cdc_command_console_task().

void create_usb_cdc_cli_task ( uint16_t  stack_depth_words,
unsigned portBASE_TYPE  task_priority 
)

volatile bool cdc_connected = false
static
xSemaphoreHandle cdc_new_data_semaphore = 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