Sending messages using a simple USB API
The chapter’s first example-program is Src/mainVcpSimple.c. It sends messages to the serial-console on the development-computer. The messages displayed on the serial-console are similar those shown earlier in Figure 2. The example-program sends messages over USB by using the API CDC_Transmit_FS(). As we’ll see, there are limitations to CDC_Transmit_FS(). The chapter’s second-example shows a better way of sending messages, without those limitations. CDC_Transmit_FS() is used here because it’s a simple introduction to sending messages over USB. Also, CDC_Transmit_FS() illustrates the need for better ways of sending messages over USB, and FreeRTOS can help with that.
Understanding the code
The example-program’s main() is shown below. It’s very similar to the prior example-programs’ main(). A FreeRTOS task is created, and the scheduler is started. The task created is sendDataTask, and it sends...