57 lines
1.0 KiB
C++
57 lines
1.0 KiB
C++
/*
|
|
* Programm.hpp
|
|
*
|
|
* Created: 19.10.2020 18:03:50
|
|
* Author: netz
|
|
*/
|
|
|
|
#define F_CPU 8000000
|
|
|
|
#include "peripheral.h"
|
|
#include "io/AudioSwitcher.hpp"
|
|
#include "io/LED.hpp"
|
|
|
|
template <int delay_plus>
|
|
class ProgrammT {
|
|
private:
|
|
void ResetTimer() {
|
|
led.SetColor(Led::CYAN);
|
|
if(!this->timer_running) {
|
|
audio.SetFunk();
|
|
}
|
|
this->timer_running = true;
|
|
}
|
|
void TimerEnd() {
|
|
audio.SetRadio();
|
|
this->timer_running = false;
|
|
}
|
|
protected:
|
|
public:
|
|
ProgrammT() : timer_running(false) {
|
|
|
|
}
|
|
|
|
void Setup() {
|
|
led.SetColor(Led::RED);
|
|
}
|
|
|
|
void Loop() {
|
|
if(this->timer_running) {
|
|
led.SetColor(Led::YELLOW);
|
|
} else {
|
|
led.SetColor(Led::GREEN);
|
|
}
|
|
|
|
}
|
|
|
|
void Vect_Ptt() {
|
|
this->ResetTimer();
|
|
}
|
|
private:
|
|
AudioSwitcher audio;
|
|
Led led;
|
|
protected:
|
|
bool timer_running;
|
|
public:
|
|
};
|
|
typedef ProgrammT<settings_prog_delay_plus> Programm; |