Skip to content
Merged
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
16 changes: 7 additions & 9 deletions src/modules/DetectionSensorModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@
#include "PowerFSM.h"
#include "configuration.h"
#include "main.h"
#include "sleep.h"
#include <Throttle.h>
#ifdef ARCH_NRF52
#include "sleep.h"
if (config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR && config.power.is_power_saving) {
nRFSenseSleep = true;
}
#endif

DetectionSensorModule *detectionSensorModule;

#define GPIO_POLLING_INTERVAL 100
Expand Down Expand Up @@ -64,12 +70,6 @@ int32_t DetectionSensorModule::runOnce()

if (moduleConfig.detection_sensor.enabled == false)
return disable();

#ifdef ARCH_NRF52
if (config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR && config.power.is_power_saving) {
nRFSenseSleep = true;
}
#endif

if (firstTime) {

Expand Down Expand Up @@ -202,8 +202,6 @@ void DetectionSensorModule::sendCurrentStateMessage(bool state)
p->decoded.payload.size = strlen(message);
if (config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR)
p->priority = meshtastic_MeshPacket_Priority_RELIABLE;
else
p->priority = meshtastic_MeshPacket_Priority_BACKGROUND;

memcpy(p->decoded.payload.bytes, message, p->decoded.payload.size);
lastSentToMesh = millis();
Expand Down