Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision |
en:iot-open:introductiontoembeddedprogramming2:cppfundamentals:programmingpatterns [2023/11/21 22:26] – pczekalski | en:iot-open:introductiontoembeddedprogramming2:cppfundamentals:programmingpatterns [2024/05/27 10:53] (current) – [Finite State Machine] ktokarz |
---|
====== Programming patterns ====== | ====== Programming patterns ====== |
| {{:en:iot-open:czapka_b.png?50| General audience classification icon }}{{:en:iot-open:czapka_m.png?50| General audience classification icon }}{{:en:iot-open:czapka_e.png?50| General audience classification icon }}\\ |
This chapter presents some programming templates and fragments of the code that are common in embedded systems. Some patterns, such as non-blocking algorithms, do not use ''delay(x)'' to hold program execution but use a timer-based approach instead. It has also been discussed in other chapters, such as in the context of timers | This chapter presents some programming templates and fragments of the code that are common in embedded systems. Some patterns, such as non-blocking algorithms, do not use ''delay(x)'' to hold program execution but use a timer-based approach instead. It has also been discussed in other chapters, such as in the context of timers |
[[en:iot-open:introductiontoembeddedprogramming2:cppfundamentals:timing|]] or interrupts [[en:iot-open:introductiontoembeddedprogramming2:cppfundamentals:interrupts|]]. | [[en:iot-open:introductiontoembeddedprogramming2:cppfundamentals:timing|]] or interrupts [[en:iot-open:introductiontoembeddedprogramming2:cppfundamentals:interrupts|]]. |
A flow between the states can be then described in the following diagram (figure {{ref>statemachine}}). | A flow between the states can be then described in the following diagram (figure {{ref>statemachine}}). |
<figure statemachine> | <figure statemachine> |
{{ :en:iot-open:introductiontoembeddedprogramming2:cppfundamentals:debouncing_state_diagram.drawio.png?400 | State machine and transitions for button handling with software debouncing}} | {{ :en:iot-open:introductiontoembeddedprogramming2:cppfundamentals:debouncing_state_diagram.drawio.png?350 | State machine and transitions for button handling with software debouncing}} |
<caption>State machine and transitions for button handling with software debouncing</caption> | <caption>State machine and transitions for button handling with software debouncing</caption> |
</figure> | </figure> |