mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-06 01:48:13 +00:00
Merge branch 'develop' into multi-message-Storage
This commit is contained in:
@@ -228,6 +228,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define ICM20948_ADDR_ALT 0x68
|
||||
#define BHI260AP_ADDR 0x28
|
||||
#define BMM150_ADDR 0x13
|
||||
#define DA217_ADDR 0x26
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// LED
|
||||
|
||||
@@ -83,7 +83,8 @@ class ScanI2C
|
||||
BMM150,
|
||||
TSL2561,
|
||||
DRV2605,
|
||||
BH1750
|
||||
BH1750,
|
||||
DA217
|
||||
} DeviceType;
|
||||
|
||||
// typedef uint8_t DeviceAddress;
|
||||
|
||||
@@ -465,8 +465,23 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
||||
break;
|
||||
|
||||
SCAN_SIMPLE_CASE(LSM6DS3_ADDR, LSM6DS3, "LSM6DS3", (uint8_t)addr.address);
|
||||
SCAN_SIMPLE_CASE(TCA9555_ADDR, TCA9555, "TCA9555", (uint8_t)addr.address);
|
||||
SCAN_SIMPLE_CASE(VEML7700_ADDR, VEML7700, "VEML7700", (uint8_t)addr.address);
|
||||
case TCA9555_ADDR:
|
||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x01), 1);
|
||||
if (registerValue == 0x13) {
|
||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1);
|
||||
if (registerValue == 0x81) {
|
||||
type = DA217;
|
||||
logFoundDevice("DA217", (uint8_t)addr.address);
|
||||
} else {
|
||||
type = TCA9555;
|
||||
logFoundDevice("TCA9555", (uint8_t)addr.address);
|
||||
}
|
||||
} else {
|
||||
type = TCA9555;
|
||||
logFoundDevice("TCA9555", (uint8_t)addr.address);
|
||||
}
|
||||
break;
|
||||
case TSL25911_ADDR:
|
||||
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x12), 1);
|
||||
if (registerValue == 0x50) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "InputBroker.h"
|
||||
#include "PowerFSM.h" // needed for event trigger
|
||||
#include "configuration.h"
|
||||
#include "modules/ExternalNotificationModule.h"
|
||||
|
||||
InputBroker *inputBroker = nullptr;
|
||||
|
||||
@@ -48,6 +50,12 @@ void InputBroker::processInputEventQueue()
|
||||
int InputBroker::handleInputEvent(const InputEvent *event)
|
||||
{
|
||||
powerFSM.trigger(EVENT_INPUT); // todo: not every input should wake, like long hold release
|
||||
|
||||
if (event && event->inputEvent != INPUT_BROKER_NONE && externalNotificationModule &&
|
||||
moduleConfig.external_notification.enabled) {
|
||||
externalNotificationModule->stopNow();
|
||||
}
|
||||
|
||||
this->notifyObservers(event);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -325,6 +325,10 @@ void ExternalNotificationModule::stopNow()
|
||||
drv.stop();
|
||||
#endif
|
||||
|
||||
// Prevent the state machine from immediately re-triggering outputs after a manual stop.
|
||||
isNagging = false;
|
||||
nagCycleCutoff = UINT32_MAX;
|
||||
|
||||
#ifdef HAS_I2S
|
||||
// GPIO0 is used as mclk for I2S audio and set to OUTPUT by the sound library
|
||||
// T-Deck uses GPIO0 as trackball button, so restore the mode
|
||||
|
||||
@@ -191,6 +191,8 @@
|
||||
#define HW_VENDOR meshtastic_HardwareModel_CROWPANEL
|
||||
#elif defined(RAK3312)
|
||||
#define HW_VENDOR meshtastic_HardwareModel_RAK3312
|
||||
#elif defined(RAK_WISMESH_TAP_V2)
|
||||
#define HW_VENDOR meshtastic_HardwareModel_WISMESH_TAP_V2
|
||||
#elif defined(LINK_32)
|
||||
#define HW_VENDOR meshtastic_HardwareModel_LINK_32
|
||||
#elif defined(T_DECK_PRO)
|
||||
|
||||
@@ -60,6 +60,8 @@
|
||||
// MAke sure all custom RAK4630 boards are defined before the generic RAK4630
|
||||
#elif defined(RAK4630)
|
||||
#define HW_VENDOR meshtastic_HardwareModel_RAK4631
|
||||
#elif defined(RAK3401)
|
||||
#define HW_VENDOR meshtastic_HardwareModel_RAK3401
|
||||
#elif defined(TTGO_T_ECHO)
|
||||
#define HW_VENDOR meshtastic_HardwareModel_T_ECHO
|
||||
#elif defined(T_ECHO_LITE)
|
||||
|
||||
@@ -4,6 +4,13 @@
|
||||
#include <InternalFileSystem.h>
|
||||
#include <SPI.h>
|
||||
#include <Wire.h>
|
||||
|
||||
#define NRFX_WDT_ENABLED 1
|
||||
#define NRFX_WDT0_ENABLED 1
|
||||
#define NRFX_WDT_CONFIG_NO_IRQ 1
|
||||
#include <nrfx_wdt.c>
|
||||
#include <nrfx_wdt.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <ble_gap.h>
|
||||
#include <memory.h>
|
||||
@@ -19,6 +26,9 @@
|
||||
#include "BQ25713.h"
|
||||
#endif
|
||||
|
||||
static nrfx_wdt_t nrfx_wdt = NRFX_WDT_INSTANCE(0);
|
||||
static nrfx_wdt_channel_id nrfx_wdt_channel_id_nrf52_main;
|
||||
|
||||
static inline void debugger_break(void)
|
||||
{
|
||||
__asm volatile("bkpt #0x01\n\t"
|
||||
@@ -202,6 +212,15 @@ void checkSDEvents()
|
||||
|
||||
void nrf52Loop()
|
||||
{
|
||||
{
|
||||
static bool watchdog_running = false;
|
||||
if (!watchdog_running) {
|
||||
nrfx_wdt_enable(&nrfx_wdt);
|
||||
watchdog_running = true;
|
||||
}
|
||||
}
|
||||
nrfx_wdt_channel_feed(&nrfx_wdt, nrfx_wdt_channel_id_nrf52_main);
|
||||
|
||||
checkSDEvents();
|
||||
reportLittleFSCorruptionOnce();
|
||||
}
|
||||
@@ -269,6 +288,20 @@ void nrf52Setup()
|
||||
LOG_DEBUG("Set random seed %u", seed.seed32);
|
||||
randomSeed(seed.seed32);
|
||||
nRFCrypto.end();
|
||||
|
||||
// Set up nrfx watchdog. Do not enable the watchdog yet (we do that
|
||||
// the first time through the main loop), so that other threads can
|
||||
// allocate their own wdt channel to protect themselves from hangs.
|
||||
nrfx_wdt_config_t wdt0_config = {
|
||||
.behaviour = NRF_WDT_BEHAVIOUR_RUN_SLEEP, .reload_value = 2000,
|
||||
// Note: Not using wdt interrupts.
|
||||
// .interrupt_priority = NRFX_WDT_DEFAULT_CONFIG_IRQ_PRIORITY
|
||||
};
|
||||
nrfx_err_t r = nrfx_wdt_init(&nrfx_wdt, &wdt0_config,
|
||||
nullptr // Watchdog event handler, not used, we just reset.
|
||||
);
|
||||
|
||||
r = nrfx_wdt_channel_alloc(&nrfx_wdt, &nrfx_wdt_channel_id_nrf52_main);
|
||||
}
|
||||
|
||||
void cpuDeepSleep(uint32_t msecToWake)
|
||||
|
||||
Reference in New Issue
Block a user