60 if (data == -1) {
return; }
63 if (c ==
'\r' || c ==
'\n') {
96 for (
int i = 0; i <
cmd_idx; i++) {
101 uint8_t response[] =
" - user asked for help";
102 for (
uint16_t i = 0; i <
sizeof(response); i++) {
106 uint8_t response[] =
" Command not recognized";
107 for (
uint16_t i = 0; i <
sizeof(response); i++) {
void VCOM_event(void)
Poll usb (required by libopencm3).
int VCOM_getchar(void)
Reads one character from VCOM port.
int VCOM_putchar(int c)
Writes one character to VCOM port fifo.
int VCOM_check_available(void)
Checks if data available in VCOM buffer.
void VCOM_send_message(void)
Send data from fifo right now.
header for serial over USB modules
static void ReadUsbBuffer(void)
Helper function.
void usb_serial_parse_packet(int data)
Parse data from buffer Note that the function receives int, not char Because we want to be able to ca...
void cmd_execute(void)
Execute command from user use strncmp.
void init_usb_serial(void)
Init module, call VCOM_init() from here.
void event_usb_serial(void)
Call VCOM_poll() from module event function.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.