mastering-stm32-2nd
mastering-stm32-2nd copied to clipboard
Update main-ex3.c
I'm reading the book and testing every example using a "BluePill" board which contains an STM32F103 microcontroller. In this example i've found that it didn't work as described in the textbook so i changed the lines of the code to match what is described in the book. For the timer Period i set to generate an event every 1sec as described in the book. If the number of conversions for the ADC is set to 3, every TRGO request will sample three times the temp sensor and set the "convCompleted" variable in the ADC interrupt funciton callback. Setting the number of conversions to 1 will require three TRGO requests since in one request only one sample of the temp sensor will be converted.