diff --git a/include/main.h b/include/main.h index 824b020e..571d1338 100644 --- a/include/main.h +++ b/include/main.h @@ -23,5 +23,6 @@ #include "boot.h" #include "power.h" #include "antenna.h" +#include "button.h" #endif \ No newline at end of file diff --git a/include/payload.h b/include/payload.h index 2add80b7..b272daa3 100644 --- a/include/payload.h +++ b/include/payload.h @@ -100,6 +100,5 @@ private: }; extern PayloadConvert payload; -extern int8_t batt_level; #endif // _PAYLOAD_H_ diff --git a/include/power.h b/include/power.h index 1f7b7333..1bbcbae3 100644 --- a/include/power.h +++ b/include/power.h @@ -53,11 +53,13 @@ typedef uint8_t (*mapFn_t)(uint16_t, uint16_t, uint16_t); uint16_t read_voltage(void); void calibrate_voltage(void); bool batt_sufficient(void); +extern int8_t batt_level; #ifdef HAS_PMU #include extern XPowersPMU pmu; enum pmu_power_t { pmu_power_on, pmu_power_off, pmu_power_sleep }; +void IRAM_ATTR PMUIRQ(); void AXP192_powerevent_IRQ(void); void AXP192_power(pmu_power_t powerlevel); void AXP192_init(void); diff --git a/include/rcommand.h b/include/rcommand.h index e01369b1..94e833b6 100644 --- a/include/rcommand.h +++ b/include/rcommand.h @@ -15,6 +15,7 @@ #include "timesync.h" #include "power.h" #include "antenna.h" +#include "payload.h" // maximum number of elements in rcommand interpreter queue #define RCMD_QUEUE_SIZE 5 diff --git a/include/senddata.h b/include/senddata.h index ff0a382b..3e0f0711 100644 --- a/include/senddata.h +++ b/include/senddata.h @@ -8,6 +8,7 @@ #include "lorawan.h" #include "display.h" #include "sdcard.h" +#include "payload.h" void SendPayload(uint8_t port); void sendData(void);