mirror of
https://github.com/jscrane/r65emu.git
synced 2025-02-11 11:31:26 +00:00
warn if no sound configured
This commit is contained in:
parent
e0e80a0d87
commit
c4cc897319
@ -55,6 +55,8 @@ const uint8_t *DAC::play(const uint8_t *bytes, unsigned size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
#pragma message "No DAC"
|
||||||
|
|
||||||
// does nothing by default
|
// does nothing by default
|
||||||
void DAC::begin(unsigned channel, unsigned freq) {
|
void DAC::begin(unsigned channel, unsigned freq) {
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "sound_pwm.h"
|
#include "sound_pwm.h"
|
||||||
#include "hardware.h"
|
#include "hardware.h"
|
||||||
|
|
||||||
#if defined(ESP32)
|
#if defined(PWM_SOUND) && defined(ESP32)
|
||||||
#include <driver/ledc.h>
|
#include <driver/ledc.h>
|
||||||
|
|
||||||
#define CHANNEL LEDC_CHANNEL_0
|
#define CHANNEL LEDC_CHANNEL_0
|
||||||
@ -40,7 +40,7 @@ void PWM::set_freq(unsigned freq) {
|
|||||||
ESP_ERROR_CHECK(::ledc_set_freq(SPEED_MODE, TIMER, freq));
|
ESP_ERROR_CHECK(::ledc_set_freq(SPEED_MODE, TIMER, freq));
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(ESP8266)
|
#elif defined(PWM_SOUND) && defined(ESP8266)
|
||||||
#include <core_esp8266_waveform.h>
|
#include <core_esp8266_waveform.h>
|
||||||
|
|
||||||
static unsigned gpio, duty;
|
static unsigned gpio, duty;
|
||||||
@ -66,6 +66,8 @@ void PWM::set_freq(unsigned freq) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
#pragma message "No PWM"
|
||||||
|
|
||||||
void PWM::begin(unsigned gpio) {
|
void PWM::begin(unsigned gpio) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user