merge new remote#2

This commit is contained in:
2022-09-30 09:49:47 +02:00
parent dd205539df
commit 6daf89c1f8
6 changed files with 13 additions and 2 deletions

View File

@@ -15,6 +15,7 @@ uint32_t looptime = 0;
void setup() void setup()
{ {
initPower(); initPower();
Serial.begin(115200); Serial.begin(115200);
Serial.setDebugOutput(true); Serial.setDebugOutput(true);
log_i("muziekdoos v2"); log_i("muziekdoos v2");

View File

@@ -164,6 +164,7 @@ void OtaProcess_class::active(void)
{ {
log_i("Otastate = active(=>idle)"); log_i("Otastate = active(=>idle)");
m_newState = false; m_newState = false;
setProcessState(processIdle);
} }
idle(); idle();
} }

View File

@@ -1,10 +1,12 @@
#pragma once #pragma once
#include "ArduinoOTA.h"
#include "secrets.h" #include "secrets.h"
#include "defines.h" #include "defines.h"
#include "process.h" #include "process.h"
#include "config.h" #include "config.h"
#include "power.h"
#include "ArduinoOTA.h"
#include "JC_Button.h"
#include "LITTLEFS.h" #include "LITTLEFS.h"
#define WIFICONNECTINTERVAL 1000 #define WIFICONNECTINTERVAL 1000

View File

@@ -12,6 +12,11 @@ POWERSTATES lastState = off;
Button buttonPower(PWR_BTN, 250UL, 1U, 0); Button buttonPower(PWR_BTN, 250UL, 1U, 0);
extern OtaProcess_class ota; extern OtaProcess_class ota;
Button* getPowerButton()
{
return &buttonPower;
}
void initPowerOn(void) void initPowerOn(void)
{ {
pinMode(PWR_HOLD, OUTPUT); pinMode(PWR_HOLD, OUTPUT);

View File

@@ -36,5 +36,7 @@ void PowerKeepAlive(void);
void initBattery(void); void initBattery(void);
bool handleBattery(void); bool handleBattery(void);
Button* getPowerButton();
void initPower(void); void initPower(void);
void handlePower(void); void handlePower(void);