mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-01-28 21:30:54 +03:00
Add set_GPIO, handle GPIO 36/39 bug
This commit is contained in:
@@ -17,6 +17,13 @@
|
||||
#include "driver/adc.h"
|
||||
#include "battery.h"
|
||||
|
||||
/*
|
||||
There is a bug in esp32 which causes a spurious interrupt on gpio 36/39 when
|
||||
using ADC, AMP and HALL sensor. Rather than making battery aware, we just ignore
|
||||
if as the interrupt lasts 80ns and should be debounced (and the ADC read does not
|
||||
happen very often)
|
||||
*/
|
||||
|
||||
#define BATTERY_TIMER (10*1000)
|
||||
|
||||
static const char *TAG = "battery";
|
||||
@@ -27,6 +34,13 @@ static struct {
|
||||
TimerHandle_t timer;
|
||||
} battery;
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
int battery_value_svc(void) {
|
||||
return battery.avg;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
*
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user