From 628a507fe813197ba51d1349b5a998e49f6d32f9 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Thu, 27 Jul 2023 10:50:25 +0100 Subject: [PATCH] Pwm sound (#18) * just use tone()/noTone() to support PWM sound now * remove sound_pwm now * remove sound_pwm --- r65emu.h | 1 - sound_pwm.cpp | 16 ---------------- sound_pwm.h | 11 ----------- 3 files changed, 28 deletions(-) delete mode 100644 sound_pwm.cpp delete mode 100644 sound_pwm.h diff --git a/r65emu.h b/r65emu.h index b66a853..c2e50d2 100644 --- a/r65emu.h +++ b/r65emu.h @@ -17,6 +17,5 @@ #include "timed.h" #include "hardware.h" #include "sound_dac.h" -#include "sound_pwm.h" #endif diff --git a/sound_pwm.cpp b/sound_pwm.cpp deleted file mode 100644 index de4c2f5..0000000 --- a/sound_pwm.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include "sound_pwm.h" - -static unsigned gpio; - -void PWM::begin(unsigned gpio) { - ::gpio = gpio; -} - -void PWM::stop() { - noTone(gpio); -} - -void PWM::start(unsigned freq) { - tone(gpio, freq); -} diff --git a/sound_pwm.h b/sound_pwm.h deleted file mode 100644 index 89e5609..0000000 --- a/sound_pwm.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __SOUND_PWM_H__ -#define __SOUND_PWM_H__ - -class PWM { -public: - void begin(unsigned gpio); - void stop(); - void start(unsigned freq); -}; - -#endif