Lucas Borges
/
MenuLCD_Copy
this locks like shit
Fork of MenuLCD_copy by
menbed/menbedRefresher.cpp@1:f105b690aeb7, 2017-05-19 (annotated)
- Committer:
- LucasMatBorges
- Date:
- Fri May 19 18:48:04 2017 +0000
- Revision:
- 1:f105b690aeb7
- Parent:
- 0:92357d1220f3
R?row mein
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ViniR | 0:92357d1220f3 | 1 | #include "mbed.h" |
ViniR | 0:92357d1220f3 | 2 | #include "include/menbedRefresher.h" |
ViniR | 0:92357d1220f3 | 3 | #include "include/menbedNavigator.h" |
ViniR | 0:92357d1220f3 | 4 | |
ViniR | 0:92357d1220f3 | 5 | MenbedRefresher::MenbedRefresher (MenbedNavigator *navigator) : |
ViniR | 0:92357d1220f3 | 6 | navigator(navigator), refreshPeriod_us(50000) |
ViniR | 0:92357d1220f3 | 7 | { |
ViniR | 0:92357d1220f3 | 8 | ticker.attach_us (navigator, &MenbedNavigator::updateDisplay, refreshPeriod_us); |
ViniR | 0:92357d1220f3 | 9 | } |
ViniR | 0:92357d1220f3 | 10 | |
ViniR | 0:92357d1220f3 | 11 | MenbedRefresher::MenbedRefresher (MenbedNavigator *navigator, uint32_t refreshPeriod_us) : |
ViniR | 0:92357d1220f3 | 12 | navigator(navigator), refreshPeriod_us(refreshPeriod_us) |
ViniR | 0:92357d1220f3 | 13 | { |
ViniR | 0:92357d1220f3 | 14 | ticker.attach_us (navigator, &MenbedNavigator::updateDisplay, refreshPeriod_us); |
ViniR | 0:92357d1220f3 | 15 | } |
ViniR | 0:92357d1220f3 | 16 | |
ViniR | 0:92357d1220f3 | 17 | void MenbedRefresher::refreshed (void) |
ViniR | 0:92357d1220f3 | 18 | { |
ViniR | 0:92357d1220f3 | 19 | // Detatch and then re-attached the ticker to reset it |
ViniR | 0:92357d1220f3 | 20 | ticker.detach(); |
ViniR | 0:92357d1220f3 | 21 | ticker.attach_us (navigator, &MenbedNavigator::updateDisplay, refreshPeriod_us); |
ViniR | 0:92357d1220f3 | 22 | } |