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

An example without abstraction

On the flip side, imagine that instead you were given the following lines of code (they are functionally equivalent to the preceding code):

bufferX[i] = adc_avg(0, 1);bufferY[i] = adc_avg(1, 1);bufferZ[i] = HAL_ADC_GetValue(adc2_ch0_h);

This immediately raises several questions, such as what the arguments being passed into adc_avg() and HAL_ADC_GetValue() are. At a minimum, we'd likely need to track down the relevant function prototypes and read through them:

/**  * return an average of numSamp samples collected  * by the ADC who's channel is defined by chNum  * @param chNum channel number of the ADC   * @param numSamp number of samples to average  * @retval avera **/uint32_t adc_avg(uint8_t chNum, uint16_t numSamp); ...
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