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

Public functions

VirtualComDriver.c  currently has three publicly available functions: 

  • TransmitUsbDataLossy
  • TransmitUsbData 
  • VirtualCommInit

TransmitUsbDataLossy is simply a wrapper around a stream buffer function call. It uses an ISR-safe variant, which is guaranteed not to block (but may also not copy all data into the buffer). The number of bytes copied into the buffer is returned. In this case, it is up to the calling code to determine whether or not to finish copying data into the buffer:

int32_t TransmitUsbDataLossy(uint8_t const* Buff, uint16_t Len){  int32_t numBytesCopied = xStreamBufferSendFromISR( txStream, Buff, Len,                                                                   NULL);  return numBytesCopied;}

TransmitUsbData provides a bit more convenience. It will block up to two ticks ...

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