Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions variants/nrf52840/rak_wismeshtag/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions variants/nrf52840/rak_wismeshtag/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion variants/nrf52840/rak_wismeshtag/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down