add short and long press timer integration
This commit is contained in:
parent
d815507bcc
commit
2d8e2ce6ee
1 changed files with 8 additions and 0 deletions
|
|
@ -288,11 +288,13 @@ impl App {
|
||||||
self.timers.batt_adc_timer.service();
|
self.timers.batt_adc_timer.service();
|
||||||
#[cfg(feature = "enable_print")]
|
#[cfg(feature = "enable_print")]
|
||||||
println!("sp service");
|
println!("sp service");
|
||||||
|
self.timers.sp_timer.reset();
|
||||||
}
|
}
|
||||||
if self.timers.lp_timer.need_service() {
|
if self.timers.lp_timer.need_service() {
|
||||||
self.timers.batt_adc_timer.service();
|
self.timers.batt_adc_timer.service();
|
||||||
#[cfg(feature = "enable_print")]
|
#[cfg(feature = "enable_print")]
|
||||||
println!("lp service");
|
println!("lp service");
|
||||||
|
self.timers.lp_timer.reset();
|
||||||
}
|
}
|
||||||
if self.timers.batt_adc_timer.need_service() {
|
if self.timers.batt_adc_timer.need_service() {
|
||||||
self.timers.batt_adc_timer.service();
|
self.timers.batt_adc_timer.service();
|
||||||
|
|
@ -385,11 +387,17 @@ impl App {
|
||||||
// TODO
|
// TODO
|
||||||
#[cfg(feature = "enable_print")]
|
#[cfg(feature = "enable_print")]
|
||||||
println!("main button press");
|
println!("main button press");
|
||||||
|
self.timers.sp_timer.reset();
|
||||||
|
self.timers.lp_timer.reset();
|
||||||
|
self.timers.sp_timer.enable(true);
|
||||||
|
self.timers.lp_timer.enable(true);
|
||||||
}
|
}
|
||||||
pub fn main_button_release(&mut self) {
|
pub fn main_button_release(&mut self) {
|
||||||
// TODO
|
// TODO
|
||||||
#[cfg(feature = "enable_print")]
|
#[cfg(feature = "enable_print")]
|
||||||
println!("main button release");
|
println!("main button release");
|
||||||
|
self.timers.sp_timer.reset();
|
||||||
|
self.timers.lp_timer.reset();
|
||||||
}
|
}
|
||||||
pub fn coin_detect(&self) {
|
pub fn coin_detect(&self) {
|
||||||
#[cfg(feature = "enable_print")]
|
#[cfg(feature = "enable_print")]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue