mirror of https://github.com/jscrane/r65emu.git
Pwm sound (#18)
* just use tone()/noTone() to support PWM sound now * remove sound_pwm now * remove sound_pwm
This commit is contained in:
parent
0ad9cb1741
commit
628a507fe8
1
r65emu.h
1
r65emu.h
|
@ -17,6 +17,5 @@
|
||||||
#include "timed.h"
|
#include "timed.h"
|
||||||
#include "hardware.h"
|
#include "hardware.h"
|
||||||
#include "sound_dac.h"
|
#include "sound_dac.h"
|
||||||
#include "sound_pwm.h"
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
#include <Arduino.h>
|
|
||||||
#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);
|
|
||||||
}
|
|
11
sound_pwm.h
11
sound_pwm.h
|
@ -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
|
|
Loading…
Reference in New Issue