TargetManager
Dependents: TargetManagerManualTest NerfUSTarget
NerfusTicker.cpp
00001 #include "NerfusTicker.hpp" 00002 00003 void NerfusTicker::start(int timeout_ms) 00004 { 00005 ticker = Ticker(); 00006 ticker.attach_us(callback(this, &NerfusTicker::timeout), timeout_ms * 1000); 00007 timer.reset(); 00008 timer.start(); 00009 } 00010 00011 void NerfusTicker::stop() 00012 { 00013 ticker.detach(); 00014 timer.stop(); 00015 } 00016 00017 int NerfusTicker::get_time_ms() 00018 { 00019 return timer.read_ms(); 00020 } 00021 00022 void NerfusTicker::init(NerfusCallbackInterface *nerfus_callback) 00023 { 00024 this->nerfus_callback = nerfus_callback; 00025 } 00026 00027 void NerfusTicker::timeout() 00028 { 00029 nerfus_callback->call(); 00030 stop(); 00031 }
Generated on Tue Jul 12 2022 17:18:21 by
1.7.2