Non Blocking programming
I have a STM32F411 board connected with a GPS module connected onto USART2
I also have Tim1 and Tim3 configured for PWM generation on their channels respectively.
I am running a list of commands (from an array) to execute line for line.
Most of the execution is in the form of assigning new values to the Timer channels
Eg: __HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_2, motor1_speed); Motor speed is a variable assigned from the list. As the program executes the list (by iterating line for line, these variables get assigned those values.)
The GPS on the other hand is being polled via USART2
The problem is that I need both the execution of the array as well as the GPS to continue running.
However, the array execution is causing a "blocking issue". I have about 15 lines of instructions in the executing array. The GPS will only work AFTER ALL the commands of the array has been executed due to its blocking issue.
I investigated from many sources who advised:
- Use RTOS - this did not work. It still blocks
- Use another Timer to run the GPS. - Still did not work.
Any assistance here?
