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

USART2_IRQHandler

This ISR is also slightly more involved since it is required to keep track of the position in a queue:

  1. Private globals are used by USART2_IRQHandler because they need to be accessible by both the ISR and used by both USART2_IRQHandler  and startReceiveInt:
static bool rxInProgress = false;static uint_fast16_t rxLen = 0;static uint8_t* rxBuff = NULL;static uint_fast16_t rxItr = 0;
  1. The same paradigm for storing xHigherPriorityTaskWoken and SEGGER SystemView tracing is used in this ISR, just like in the last example:
void USART2_IRQHandler( void ){     portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;     SEGGER_SYSVIEW_RecordEnterISR();
  1. Next, errors are checked by reading the overrun (ORE), noise error (NE), framing error (
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