18 {
19 mode_manager_ = mode_manager;
20 gui_ = gui;
21 buzzer_ = buzzer;
22 onStopwatchToggle_ = std::move(onStopwatchToggle);
23 onTimerStop_ = std::move(onTimerStop);
24
25
26
27
28
30 gpio_int_sem_1_.release();
31 mode_manager_->NextMode();
33 std::cout << "Button 1\n";
34 buzzer_->
PlayNote(PWM::NoteName::C, 7, 50);
35 });
36
37
38
39
40
41
43 gpio_int_sem_2_.release();
44 std::cout << "Button 2\n";
45 buzzer_->
PlayNote(PWM::NoteName::C, 7, 50);
46
47 auto mode = mode_manager_->GetMode();
48 if (mode == ModeManager::Mode::STOPWATCH) {
49 onStopwatchToggle_();
50 } else if (mode == ModeManager::Mode::TIMER &&
51 mode_manager_->IsTimerRunning()) {
52 onTimerStop_();
54 }
55 });
56 }
void SandDisable()
Disable sand simulation.
void EnableInterruptRisingEdgeWithCallback(Callback cb)
void PlayNote(NoteName note, uint32_t octave, uint32_t duration_ms)
Play a musical note based on note name and octave.