Skip to Content
Hands-On RTOS with Microcontrollers
book

Hands-On RTOS with Microcontrollers

by Brian Amos
May 2020
Intermediate to advanced
496 pages
13h 54m
English
Packt Publishing
Content preview from Hands-On RTOS with Microcontrollers

Private functions

usbTask is a private function that takes care of the initial setup of our CDC overrides. It also monitors the stream buffer and task notifications, making the required calls to the CDC implementation provided by STM.

Before starting its main loop, there are a few items that need to be initialized:

  1. The task must wait until all of the underlying peripherals and USB stack initialization are performed. This is because the task will be accessing data structures created by the USB CDC stack:
  USBD_CDC_HandleTypeDef *hcdc = NULL;  while(hcdc == NULL)  {    hcdc = (USBD_CDC_HandleTypeDef*)hUsbDeviceFS.pClassData;    vTaskDelay(10);  }
  1. A task notification is given, provided a transmission is not already in progress. The notification is ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On RTOS with Microcontrollers - Second Edition

Hands-On RTOS with Microcontrollers - Second Edition

Jim Yuill, Penn Linder

Publisher Resources

ISBN: 9781838826734Supplemental Content