May 2020
Intermediate to advanced
496 pages
13h 54m
English
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); ...