diff --git a/platformio.ini b/platformio.ini index 885ce9a1..d91aec41 100644 --- a/platformio.ini +++ b/platformio.ini @@ -67,6 +67,9 @@ build_flags = ;Have RTC Chip -DHAS_RTC=1 + + ;Have buzzer + -DBUZZ_PIN=2 ;Buttons configuration -DHAS_BTN=1 diff --git a/src/core/globals.cpp b/src/core/globals.cpp index 1acb7b7b..f649d943 100644 --- a/src/core/globals.cpp +++ b/src/core/globals.cpp @@ -1,7 +1,5 @@ #include "globals.h" -#define BUZZ_PIN 2 - /********************************************************************* ** Function: backToMenu ** sets the global var to be be used in the options second parameter @@ -74,5 +72,9 @@ void updateTimeStr(struct tm timeInfo) { } void _tone(unsigned int frequency, unsigned long duration = 0UL) { +#if defined(BUZZ_PIN) tone(BUZZ_PIN, frequency, duration); +//#elif defined(HAS_NS4168_SPKR) +//TODO: alt. implementation using the speaker +#endif }