this locks like shit

Dependencies:   MenuLCD mbed

Fork of MenuLCD_copy by Vinícius Alves

Committer:
ViniR
Date:
Fri May 19 13:07:52 2017 +0000
Revision:
0:92357d1220f3
Ent?o PARA...

Who changed what in which revision?

UserRevisionLine numberNew 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 }