#pragma once #define RADIOLIB_STATIC_ONLY 1 #include #include #include "MuziBaseBoard.h" #if defined(USE_LR1121) #include #elif defined(USE_SX1262) #include #else #error "muzi_base: no radio selected (define USE_LR1121 or USE_SX1262)" #endif #include #include #include #include #include // Added: Include for EnvironmentSensorManager #include #ifdef MUZI_BASE_SUPERIO #include extern DISPLAY_CLASS display; extern MomentaryButton user_btn; extern MomentaryButton joystick_left; extern MomentaryButton joystick_right; extern MomentaryButton back_btn; #elif defined(DISPLAY_CLASS) #include "helpers/ui/NullDisplayDriver.h" extern DISPLAY_CLASS display; extern MomentaryButton user_btn; #endif extern MuziBaseBoard board; extern WRAPPER_CLASS radio_driver; extern AutoDiscoverRTCClock rtc_clock; // muzi sensor manager, polled from main loop via sensors.loop(): // - user button: USER_BTN_POWER_OFF_CLICKS quick presses -> power off (all builds) // - gps mode switch on/off (superIO only, see thinknode_m1) class MuziBaseSensorManager : public EnvironmentSensorManager { unsigned long _pwr_last_click = 0; uint8_t _pwr_clicks = 0; #if ENV_INCLUDE_GPS int _last_gps_sw = -1; unsigned long _next_sw_check = 0; #endif public: #if ENV_INCLUDE_GPS MuziBaseSensorManager(LocationProvider& location) : EnvironmentSensorManager(location) {} #else MuziBaseSensorManager() {} #endif bool begin() override; void loop() override; }; extern MuziBaseSensorManager sensors; bool radio_init(); uint32_t radio_get_rng_seed(); void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); void radio_set_tx_power(int8_t dbm); mesh::LocalIdentity radio_new_identity();