Add RAK WisMesh Pod variant and fix Tag LPCOMP wake on user shutdown (#11049)
* Add RAK WisMesh Pod variant and fix Tag LPCOMP wake on user shutdown * chore: trunk fmt - replace Unicode em-dash in Pod comment Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
GitHub
Ben Meadors
Cursor
parent
d4aa7760cc
commit
37fdbb49bf
@@ -23,3 +23,11 @@ build_flags = ${nrf52840_base.build_flags}
|
||||
-DRADIOLIB_EXCLUDE_LR2021=1
|
||||
-DMESHTASTIC_EXCLUDE_WIFI=1
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak_wismeshtag>
|
||||
|
||||
; RAK WisMesh Pod - same board as Tag (no user buttons on hardware; shares Tag pin map)
|
||||
[env:rak_wismesh_pod]
|
||||
extends = env:rak_wismeshtag
|
||||
custom_meshtastic_display_name = RAK WisMesh Pod
|
||||
build_flags =
|
||||
${env:rak_wismeshtag.build_flags}
|
||||
-D WISMESH_POD
|
||||
@@ -46,6 +46,14 @@ void initVariant()
|
||||
}
|
||||
|
||||
#ifdef LOW_VDD_SYSTEMOFF_DELAY_MS
|
||||
static bool lowVddSystemOff = false; // Set when brownout forces System OFF (enables LPCOMP wake).
|
||||
|
||||
// Strong override; must be noinline (see main-nrf52.cpp weak default).
|
||||
__attribute__((noinline)) bool variant_enableBatteryLpcompWake()
|
||||
{
|
||||
return lowVddSystemOff;
|
||||
}
|
||||
|
||||
void variant_nrf52LoopHook(void)
|
||||
{
|
||||
// If VDD stays unsafe for a while (brownout), force System OFF.
|
||||
@@ -72,6 +80,7 @@ void variant_nrf52LoopHook(void)
|
||||
low_vdd_timer_armed = true;
|
||||
}
|
||||
if ((uint32_t)(now - low_vdd_since_ms) >= (uint32_t)LOW_VDD_SYSTEMOFF_DELAY_MS) {
|
||||
lowVddSystemOff = true;
|
||||
cpuDeepSleep(portMAX_DELAY);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -55,10 +55,13 @@ extern "C" {
|
||||
/*
|
||||
* Buttons
|
||||
*/
|
||||
|
||||
#ifndef WISMESH_POD
|
||||
#define PIN_BUTTON1 9 // Pin for button on E-ink button module or IO expansion
|
||||
#define BUTTON_NEED_PULLUP
|
||||
#define PIN_BUTTON2 12
|
||||
#else
|
||||
#define HAS_BUTTON 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Analog pins
|
||||
|
||||
Reference in New Issue
Block a user