Fixed EEPROM Crashing

Turning off the sound interrupt durring EEPROM writing fixed the
problem.
This commit is contained in:
bdring
2018-03-27 14:00:08 -05:00
parent 97341671b9
commit 494067d83a
3 changed files with 37 additions and 22 deletions

15
sound.h
View File

@@ -7,7 +7,8 @@
*
*
*/
#ifndef SOUND_H
#define SOUND_H
#include "esp32-hal-timer.h";
@@ -55,6 +56,16 @@ void sound_init(int pin){ // pin must be a DAC pin number !! (typically 25 or 2
timerAlarmEnable(sndTimer);
}
void sound_pause() // this prevents the interrupt from firing ... use during eeprom write
{
timerStop(sndTimer);
}
void sound_resume() // resume from pause ... after eeprom write
{
timerRestart(sndTimer);
}
bool sound(uint16_t freq, uint8_t volume){
if (volume == 0) {
soundOff();
@@ -77,7 +88,7 @@ void soundOff(){
#endif