#include "buzzer.h" #include "pins.h" #include static bool g_on = false; static void apply() { digitalWrite(BUZZER_PIN, g_on ? HIGH : LOW); } void buzzer_init() { pinMode(BUZZER_PIN, OUTPUT); g_on = false; apply(); Serial.printf("Buzzer GPIO%d OFF (default)\n", BUZZER_PIN); } void buzzer_set_on(bool on) { g_on = on; apply(); Serial.printf("Buzzer %s\n", g_on ? "ON" : "OFF"); } bool buzzer_is_on() { return g_on; }