kloon / OpenBeerFiller

An opensource beer filling line microcontroller
GNU General Public License v3.0
39 stars 13 forks source link

[WIP]Move fill sensor checking to an interrupt timer #5

Closed kloon closed 4 years ago

kloon commented 4 years ago

This PR addresses the issue where the current fill sensors are being read in a while loop in the main program loop, this causes a blocking effect on the main program loop which is not ideal.

The changes here introduce the use of Timer1 and attaching an interrupt to the timer to check the fill sensors in the background thus freeing up the main loop for other real-time functionality.

It also refactors the main program loop to utilise program states to allow for better control and execution of the different states of operation.

Closes #3