mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-29 05:01:54 +00:00
Compare commits
1 Commits
status-mes
...
test/ai-sl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
069e8f6265 |
@@ -56,7 +56,6 @@ build_flags = -Wno-missing-field-initializers
|
||||
-DMESHTASTIC_EXCLUDE_GENERIC_THREAD_MODULE=1
|
||||
-DMESHTASTIC_EXCLUDE_POWERMON=1
|
||||
-D MAX_THREADS=40 ; As we've split modules, we have more threads to manage
|
||||
-DLED_BUILTIN=-1
|
||||
#-DBUILD_EPOCH=$UNIX_TIME ; set in platformio-custom.py now
|
||||
#-D OLED_PL=1
|
||||
#-D DEBUG_HEAP=1 ; uncomment to add free heap space / memory leak debugging logs
|
||||
|
||||
@@ -1,59 +1,8 @@
|
||||
#include "InputBroker.h"
|
||||
#include "PowerFSM.h" // needed for event trigger
|
||||
#include "configuration.h"
|
||||
#include "graphics/Screen.h"
|
||||
#include "modules/ExternalNotificationModule.h"
|
||||
|
||||
#if ARCH_PORTDUINO
|
||||
#include "input/LinuxInputImpl.h"
|
||||
#include "input/SeesawRotary.h"
|
||||
#include "platform/portduino/PortduinoGlue.h"
|
||||
#endif
|
||||
|
||||
#if !MESHTASTIC_EXCLUDE_INPUTBROKER
|
||||
#include "input/ExpressLRSFiveWay.h"
|
||||
#include "input/RotaryEncoderImpl.h"
|
||||
#include "input/RotaryEncoderInterruptImpl1.h"
|
||||
#include "input/SerialKeyboardImpl.h"
|
||||
#include "input/UpDownInterruptImpl1.h"
|
||||
#include "input/i2cButton.h"
|
||||
#if HAS_TRACKBALL
|
||||
#include "input/TrackballInterruptImpl1.h"
|
||||
#endif
|
||||
|
||||
#include "modules/StatusLEDModule.h"
|
||||
|
||||
#if !MESHTASTIC_EXCLUDE_I2C
|
||||
#include "input/cardKbI2cImpl.h"
|
||||
#endif
|
||||
#include "input/kbMatrixImpl.h"
|
||||
#endif
|
||||
|
||||
#if HAS_BUTTON || defined(ARCH_PORTDUINO)
|
||||
#include "input/ButtonThread.h"
|
||||
|
||||
#if defined(BUTTON_PIN_TOUCH)
|
||||
ButtonThread *TouchButtonThread = nullptr;
|
||||
#if defined(TTGO_T_ECHO_PLUS) && defined(PIN_EINK_EN)
|
||||
static bool touchBacklightWasOn = false;
|
||||
static bool touchBacklightActive = false;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(BUTTON_PIN) || defined(ARCH_PORTDUINO)
|
||||
ButtonThread *UserButtonThread = nullptr;
|
||||
#endif
|
||||
|
||||
#if defined(ALT_BUTTON_PIN)
|
||||
ButtonThread *BackButtonThread = nullptr;
|
||||
#endif
|
||||
|
||||
#if defined(CANCEL_BUTTON_PIN)
|
||||
ButtonThread *CancelButtonThread = nullptr;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
InputBroker *inputBroker = nullptr;
|
||||
|
||||
InputBroker::InputBroker()
|
||||
@@ -125,262 +74,3 @@ void InputBroker::pollSoonWorker(void *p)
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
void InputBroker::Init()
|
||||
{
|
||||
|
||||
#ifdef BUTTON_PIN
|
||||
#ifdef ARCH_ESP32
|
||||
|
||||
#if ESP_ARDUINO_VERSION_MAJOR >= 3
|
||||
#ifdef BUTTON_NEED_PULLUP
|
||||
pinMode(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN, INPUT_PULLUP);
|
||||
#else
|
||||
pinMode(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN, INPUT); // default to BUTTON_PIN
|
||||
#endif
|
||||
#else
|
||||
pinMode(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN, INPUT); // default to BUTTON_PIN
|
||||
#ifdef BUTTON_NEED_PULLUP
|
||||
gpio_pullup_en((gpio_num_t)(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN));
|
||||
delay(10);
|
||||
#endif
|
||||
#ifdef BUTTON_NEED_PULLUP2
|
||||
gpio_pullup_en((gpio_num_t)BUTTON_NEED_PULLUP2);
|
||||
delay(10);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// buttons are now inputBroker, so have to come after setupModules
|
||||
#if HAS_BUTTON
|
||||
int pullup_sense = 0;
|
||||
#ifdef INPUT_PULLUP_SENSE
|
||||
// Some platforms (nrf52) have a SENSE variant which allows wake from sleep - override what OneButton did
|
||||
#ifdef BUTTON_SENSE_TYPE
|
||||
pullup_sense = BUTTON_SENSE_TYPE;
|
||||
#else
|
||||
pullup_sense = INPUT_PULLUP_SENSE;
|
||||
#endif
|
||||
#endif
|
||||
#if defined(ARCH_PORTDUINO)
|
||||
|
||||
if (portduino_config.userButtonPin.enabled) {
|
||||
|
||||
LOG_DEBUG("Use GPIO%02d for button", portduino_config.userButtonPin.pin);
|
||||
UserButtonThread = new ButtonThread("UserButton");
|
||||
if (screen) {
|
||||
ButtonConfig config;
|
||||
config.pinNumber = (uint8_t)portduino_config.userButtonPin.pin;
|
||||
config.activeLow = true;
|
||||
config.activePullup = true;
|
||||
config.pullupSense = INPUT_PULLUP;
|
||||
config.intRoutine = []() {
|
||||
UserButtonThread->userButton.tick();
|
||||
UserButtonThread->setIntervalFromNow(0);
|
||||
runASAP = true;
|
||||
BaseType_t higherWake = 0;
|
||||
concurrency::mainDelay.interruptFromISR(&higherWake);
|
||||
};
|
||||
config.singlePress = INPUT_BROKER_USER_PRESS;
|
||||
config.longPress = INPUT_BROKER_SELECT;
|
||||
UserButtonThread->initButton(config);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BUTTON_PIN_TOUCH
|
||||
TouchButtonThread = new ButtonThread("BackButton");
|
||||
ButtonConfig touchConfig;
|
||||
touchConfig.pinNumber = BUTTON_PIN_TOUCH;
|
||||
touchConfig.activeLow = true;
|
||||
touchConfig.activePullup = true;
|
||||
touchConfig.pullupSense = pullup_sense;
|
||||
touchConfig.intRoutine = []() {
|
||||
TouchButtonThread->userButton.tick();
|
||||
TouchButtonThread->setIntervalFromNow(0);
|
||||
runASAP = true;
|
||||
BaseType_t higherWake = 0;
|
||||
concurrency::mainDelay.interruptFromISR(&higherWake);
|
||||
};
|
||||
touchConfig.singlePress = INPUT_BROKER_NONE;
|
||||
touchConfig.longPress = INPUT_BROKER_BACK;
|
||||
#if defined(TTGO_T_ECHO_PLUS) && defined(PIN_EINK_EN)
|
||||
// On T-Echo Plus the touch pad should only drive the backlight, not UI navigation/sounds
|
||||
touchConfig.longPress = INPUT_BROKER_NONE;
|
||||
touchConfig.suppressLeadUpSound = true;
|
||||
touchConfig.onPress = []() {
|
||||
touchBacklightWasOn = uiconfig.screen_brightness == 1;
|
||||
if (!touchBacklightWasOn) {
|
||||
digitalWrite(PIN_EINK_EN, HIGH);
|
||||
}
|
||||
touchBacklightActive = true;
|
||||
};
|
||||
touchConfig.onRelease = []() {
|
||||
if (touchBacklightActive && !touchBacklightWasOn) {
|
||||
digitalWrite(PIN_EINK_EN, LOW);
|
||||
}
|
||||
touchBacklightActive = false;
|
||||
};
|
||||
#endif
|
||||
TouchButtonThread->initButton(touchConfig);
|
||||
#endif
|
||||
|
||||
#if defined(CANCEL_BUTTON_PIN)
|
||||
// Buttons. Moved here cause we need NodeDB to be initialized
|
||||
CancelButtonThread = new ButtonThread("CancelButton");
|
||||
ButtonConfig cancelConfig;
|
||||
cancelConfig.pinNumber = CANCEL_BUTTON_PIN;
|
||||
cancelConfig.activeLow = CANCEL_BUTTON_ACTIVE_LOW;
|
||||
cancelConfig.activePullup = CANCEL_BUTTON_ACTIVE_PULLUP;
|
||||
cancelConfig.pullupSense = pullup_sense;
|
||||
cancelConfig.intRoutine = []() {
|
||||
CancelButtonThread->userButton.tick();
|
||||
CancelButtonThread->setIntervalFromNow(0);
|
||||
runASAP = true;
|
||||
BaseType_t higherWake = 0;
|
||||
concurrency::mainDelay.interruptFromISR(&higherWake);
|
||||
};
|
||||
cancelConfig.singlePress = INPUT_BROKER_CANCEL;
|
||||
cancelConfig.longPress = INPUT_BROKER_SHUTDOWN;
|
||||
cancelConfig.longPressTime = 4000;
|
||||
CancelButtonThread->initButton(cancelConfig);
|
||||
#endif
|
||||
|
||||
#if defined(ALT_BUTTON_PIN)
|
||||
// Buttons. Moved here cause we need NodeDB to be initialized
|
||||
BackButtonThread = new ButtonThread("BackButton");
|
||||
ButtonConfig backConfig;
|
||||
backConfig.pinNumber = ALT_BUTTON_PIN;
|
||||
backConfig.activeLow = ALT_BUTTON_ACTIVE_LOW;
|
||||
backConfig.activePullup = ALT_BUTTON_ACTIVE_PULLUP;
|
||||
backConfig.pullupSense = pullup_sense;
|
||||
backConfig.intRoutine = []() {
|
||||
BackButtonThread->userButton.tick();
|
||||
BackButtonThread->setIntervalFromNow(0);
|
||||
runASAP = true;
|
||||
BaseType_t higherWake = 0;
|
||||
concurrency::mainDelay.interruptFromISR(&higherWake);
|
||||
};
|
||||
backConfig.singlePress = INPUT_BROKER_ALT_PRESS;
|
||||
backConfig.longPress = INPUT_BROKER_ALT_LONG;
|
||||
backConfig.longPressTime = 500;
|
||||
BackButtonThread->initButton(backConfig);
|
||||
#endif
|
||||
|
||||
#if defined(BUTTON_PIN)
|
||||
#if defined(USERPREFS_BUTTON_PIN)
|
||||
int _pinNum = config.device.button_gpio ? config.device.button_gpio : USERPREFS_BUTTON_PIN;
|
||||
#else
|
||||
int _pinNum = config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN;
|
||||
#endif
|
||||
#ifndef BUTTON_ACTIVE_LOW
|
||||
#define BUTTON_ACTIVE_LOW true
|
||||
#endif
|
||||
#ifndef BUTTON_ACTIVE_PULLUP
|
||||
#define BUTTON_ACTIVE_PULLUP true
|
||||
#endif
|
||||
|
||||
// Buttons. Moved here cause we need NodeDB to be initialized
|
||||
// If your variant.h has a BUTTON_PIN defined, go ahead and define BUTTON_ACTIVE_LOW and BUTTON_ACTIVE_PULLUP
|
||||
UserButtonThread = new ButtonThread("UserButton");
|
||||
if (screen) {
|
||||
ButtonConfig userConfig;
|
||||
userConfig.pinNumber = (uint8_t)_pinNum;
|
||||
userConfig.activeLow = BUTTON_ACTIVE_LOW;
|
||||
userConfig.activePullup = BUTTON_ACTIVE_PULLUP;
|
||||
userConfig.pullupSense = pullup_sense;
|
||||
userConfig.intRoutine = []() {
|
||||
UserButtonThread->userButton.tick();
|
||||
UserButtonThread->setIntervalFromNow(0);
|
||||
runASAP = true;
|
||||
BaseType_t higherWake = 0;
|
||||
concurrency::mainDelay.interruptFromISR(&higherWake);
|
||||
};
|
||||
userConfig.singlePress = INPUT_BROKER_USER_PRESS;
|
||||
userConfig.longPress = INPUT_BROKER_SELECT;
|
||||
userConfig.longPressTime = 500;
|
||||
userConfig.longLongPress = INPUT_BROKER_SHUTDOWN;
|
||||
UserButtonThread->initButton(userConfig);
|
||||
} else {
|
||||
ButtonConfig userConfigNoScreen;
|
||||
userConfigNoScreen.pinNumber = (uint8_t)_pinNum;
|
||||
userConfigNoScreen.activeLow = BUTTON_ACTIVE_LOW;
|
||||
userConfigNoScreen.activePullup = BUTTON_ACTIVE_PULLUP;
|
||||
userConfigNoScreen.pullupSense = pullup_sense;
|
||||
userConfigNoScreen.intRoutine = []() {
|
||||
UserButtonThread->userButton.tick();
|
||||
UserButtonThread->setIntervalFromNow(0);
|
||||
runASAP = true;
|
||||
BaseType_t higherWake = 0;
|
||||
concurrency::mainDelay.interruptFromISR(&higherWake);
|
||||
};
|
||||
userConfigNoScreen.singlePress = INPUT_BROKER_USER_PRESS;
|
||||
userConfigNoScreen.longPress = INPUT_BROKER_NONE;
|
||||
userConfigNoScreen.longPressTime = 500;
|
||||
userConfigNoScreen.longLongPress = INPUT_BROKER_SHUTDOWN;
|
||||
userConfigNoScreen.doublePress = INPUT_BROKER_SEND_PING;
|
||||
userConfigNoScreen.triplePress = INPUT_BROKER_GPS_TOGGLE;
|
||||
UserButtonThread->initButton(userConfigNoScreen);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (HAS_BUTTON || ARCH_PORTDUINO) && !MESHTASTIC_EXCLUDE_INPUTBROKER
|
||||
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
|
||||
#if defined(T_LORA_PAGER)
|
||||
// use a special FSM based rotary encoder version for T-LoRa Pager
|
||||
rotaryEncoderImpl = new RotaryEncoderImpl();
|
||||
if (!rotaryEncoderImpl->init()) {
|
||||
delete rotaryEncoderImpl;
|
||||
rotaryEncoderImpl = nullptr;
|
||||
}
|
||||
#elif defined(INPUTDRIVER_ENCODER_TYPE) && (INPUTDRIVER_ENCODER_TYPE == 2)
|
||||
upDownInterruptImpl1 = new UpDownInterruptImpl1();
|
||||
if (!upDownInterruptImpl1->init()) {
|
||||
delete upDownInterruptImpl1;
|
||||
upDownInterruptImpl1 = nullptr;
|
||||
}
|
||||
#else
|
||||
rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1();
|
||||
if (!rotaryEncoderInterruptImpl1->init()) {
|
||||
delete rotaryEncoderInterruptImpl1;
|
||||
rotaryEncoderInterruptImpl1 = nullptr;
|
||||
}
|
||||
#endif
|
||||
cardKbI2cImpl = new CardKbI2cImpl();
|
||||
cardKbI2cImpl->init();
|
||||
#if defined(M5STACK_UNITC6L)
|
||||
i2cButton = new i2cButtonThread("i2cButtonThread");
|
||||
#endif
|
||||
#ifdef INPUTBROKER_MATRIX_TYPE
|
||||
kbMatrixImpl = new KbMatrixImpl();
|
||||
kbMatrixImpl->init();
|
||||
#endif // INPUTBROKER_MATRIX_TYPE
|
||||
#ifdef INPUTBROKER_SERIAL_TYPE
|
||||
aSerialKeyboardImpl = new SerialKeyboardImpl();
|
||||
aSerialKeyboardImpl->init();
|
||||
#endif // INPUTBROKER_MATRIX_TYPE
|
||||
}
|
||||
#endif // HAS_BUTTON
|
||||
#if ARCH_PORTDUINO
|
||||
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR && portduino_config.i2cdev != "") {
|
||||
seesawRotary = new SeesawRotary("SeesawRotary");
|
||||
if (!seesawRotary->init()) {
|
||||
delete seesawRotary;
|
||||
seesawRotary = nullptr;
|
||||
}
|
||||
aLinuxInputImpl = new LinuxInputImpl();
|
||||
aLinuxInputImpl->init();
|
||||
}
|
||||
#endif
|
||||
#if !MESHTASTIC_EXCLUDE_INPUTBROKER && HAS_TRACKBALL
|
||||
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
|
||||
trackballInterruptImpl1 = new TrackballInterruptImpl1();
|
||||
trackballInterruptImpl1->init(TB_DOWN, TB_UP, TB_LEFT, TB_RIGHT, TB_PRESS);
|
||||
}
|
||||
#endif
|
||||
#ifdef INPUTBROKER_EXPRESSLRSFIVEWAY_TYPE
|
||||
expressLRSFiveWayInput = new ExpressLRSFiveWay();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "Observer.h"
|
||||
#include "concurrency/OSThread.h"
|
||||
#include "freertosinc.h"
|
||||
|
||||
#ifdef InputBrokerDebug
|
||||
@@ -77,7 +76,6 @@ class InputBroker : public Observable<const InputEvent *>
|
||||
void queueInputEvent(const InputEvent *event);
|
||||
void processInputEventQueue();
|
||||
#endif
|
||||
void Init();
|
||||
|
||||
protected:
|
||||
int handleInputEvent(const InputEvent *event);
|
||||
@@ -91,5 +89,4 @@ class InputBroker : public Observable<const InputEvent *>
|
||||
#endif
|
||||
};
|
||||
|
||||
extern InputBroker *inputBroker;
|
||||
extern bool runASAP;
|
||||
extern InputBroker *inputBroker;
|
||||
226
src/main.cpp
226
src/main.cpp
@@ -120,6 +120,31 @@ void printPartitionTable()
|
||||
#endif // DEBUG_PARTITION_TABLE
|
||||
#endif // ARCH_ESP32
|
||||
|
||||
#if HAS_BUTTON || defined(ARCH_PORTDUINO)
|
||||
#include "input/ButtonThread.h"
|
||||
|
||||
#if defined(BUTTON_PIN_TOUCH)
|
||||
ButtonThread *TouchButtonThread = nullptr;
|
||||
#if defined(TTGO_T_ECHO_PLUS) && defined(PIN_EINK_EN)
|
||||
static bool touchBacklightWasOn = false;
|
||||
static bool touchBacklightActive = false;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(BUTTON_PIN) || defined(ARCH_PORTDUINO)
|
||||
ButtonThread *UserButtonThread = nullptr;
|
||||
#endif
|
||||
|
||||
#if defined(ALT_BUTTON_PIN)
|
||||
ButtonThread *BackButtonThread = nullptr;
|
||||
#endif
|
||||
|
||||
#if defined(CANCEL_BUTTON_PIN)
|
||||
ButtonThread *CancelButtonThread = nullptr;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include "AmbientLightingThread.h"
|
||||
#include "PowerFSMThread.h"
|
||||
|
||||
@@ -484,6 +509,30 @@ void setup()
|
||||
LOG_INFO("Wait for peripherals to stabilize");
|
||||
delay(PERIPHERAL_WARMUP_MS);
|
||||
#endif
|
||||
|
||||
#ifdef BUTTON_PIN
|
||||
#ifdef ARCH_ESP32
|
||||
|
||||
#if ESP_ARDUINO_VERSION_MAJOR >= 3
|
||||
#ifdef BUTTON_NEED_PULLUP
|
||||
pinMode(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN, INPUT_PULLUP);
|
||||
#else
|
||||
pinMode(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN, INPUT); // default to BUTTON_PIN
|
||||
#endif
|
||||
#else
|
||||
pinMode(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN, INPUT); // default to BUTTON_PIN
|
||||
#ifdef BUTTON_NEED_PULLUP
|
||||
gpio_pullup_en((gpio_num_t)(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN));
|
||||
delay(10);
|
||||
#endif
|
||||
#ifdef BUTTON_NEED_PULLUP2
|
||||
gpio_pullup_en((gpio_num_t)BUTTON_NEED_PULLUP2);
|
||||
delay(10);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
initSPI();
|
||||
|
||||
OSThread::setup();
|
||||
@@ -950,9 +999,180 @@ void setup()
|
||||
nodeDB->hasWarned = true;
|
||||
}
|
||||
#endif
|
||||
#if !MESHTASTIC_EXCLUDE_INPUTBROKER
|
||||
if (inputBroker)
|
||||
inputBroker->Init();
|
||||
|
||||
// buttons are now inputBroker, so have to come after setupModules
|
||||
#if HAS_BUTTON
|
||||
int pullup_sense = 0;
|
||||
#ifdef INPUT_PULLUP_SENSE
|
||||
// Some platforms (nrf52) have a SENSE variant which allows wake from sleep - override what OneButton did
|
||||
#ifdef BUTTON_SENSE_TYPE
|
||||
pullup_sense = BUTTON_SENSE_TYPE;
|
||||
#else
|
||||
pullup_sense = INPUT_PULLUP_SENSE;
|
||||
#endif
|
||||
#endif
|
||||
#if defined(ARCH_PORTDUINO)
|
||||
|
||||
if (portduino_config.userButtonPin.enabled) {
|
||||
|
||||
LOG_DEBUG("Use GPIO%02d for button", portduino_config.userButtonPin.pin);
|
||||
UserButtonThread = new ButtonThread("UserButton");
|
||||
if (screen) {
|
||||
ButtonConfig config;
|
||||
config.pinNumber = (uint8_t)portduino_config.userButtonPin.pin;
|
||||
config.activeLow = true;
|
||||
config.activePullup = true;
|
||||
config.pullupSense = INPUT_PULLUP;
|
||||
config.intRoutine = []() {
|
||||
UserButtonThread->userButton.tick();
|
||||
UserButtonThread->setIntervalFromNow(0);
|
||||
runASAP = true;
|
||||
BaseType_t higherWake = 0;
|
||||
mainDelay.interruptFromISR(&higherWake);
|
||||
};
|
||||
config.singlePress = INPUT_BROKER_USER_PRESS;
|
||||
config.longPress = INPUT_BROKER_SELECT;
|
||||
UserButtonThread->initButton(config);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BUTTON_PIN_TOUCH
|
||||
TouchButtonThread = new ButtonThread("BackButton");
|
||||
ButtonConfig touchConfig;
|
||||
touchConfig.pinNumber = BUTTON_PIN_TOUCH;
|
||||
touchConfig.activeLow = true;
|
||||
touchConfig.activePullup = true;
|
||||
touchConfig.pullupSense = pullup_sense;
|
||||
touchConfig.intRoutine = []() {
|
||||
TouchButtonThread->userButton.tick();
|
||||
TouchButtonThread->setIntervalFromNow(0);
|
||||
runASAP = true;
|
||||
BaseType_t higherWake = 0;
|
||||
mainDelay.interruptFromISR(&higherWake);
|
||||
};
|
||||
touchConfig.singlePress = INPUT_BROKER_NONE;
|
||||
touchConfig.longPress = INPUT_BROKER_BACK;
|
||||
#if defined(TTGO_T_ECHO_PLUS) && defined(PIN_EINK_EN)
|
||||
// On T-Echo Plus the touch pad should only drive the backlight, not UI navigation/sounds
|
||||
touchConfig.longPress = INPUT_BROKER_NONE;
|
||||
touchConfig.suppressLeadUpSound = true;
|
||||
touchConfig.onPress = []() {
|
||||
touchBacklightWasOn = uiconfig.screen_brightness == 1;
|
||||
if (!touchBacklightWasOn) {
|
||||
digitalWrite(PIN_EINK_EN, HIGH);
|
||||
}
|
||||
touchBacklightActive = true;
|
||||
};
|
||||
touchConfig.onRelease = []() {
|
||||
if (touchBacklightActive && !touchBacklightWasOn) {
|
||||
digitalWrite(PIN_EINK_EN, LOW);
|
||||
}
|
||||
touchBacklightActive = false;
|
||||
};
|
||||
#endif
|
||||
TouchButtonThread->initButton(touchConfig);
|
||||
#endif
|
||||
|
||||
#if defined(CANCEL_BUTTON_PIN)
|
||||
// Buttons. Moved here cause we need NodeDB to be initialized
|
||||
CancelButtonThread = new ButtonThread("CancelButton");
|
||||
ButtonConfig cancelConfig;
|
||||
cancelConfig.pinNumber = CANCEL_BUTTON_PIN;
|
||||
cancelConfig.activeLow = CANCEL_BUTTON_ACTIVE_LOW;
|
||||
cancelConfig.activePullup = CANCEL_BUTTON_ACTIVE_PULLUP;
|
||||
cancelConfig.pullupSense = pullup_sense;
|
||||
cancelConfig.intRoutine = []() {
|
||||
CancelButtonThread->userButton.tick();
|
||||
CancelButtonThread->setIntervalFromNow(0);
|
||||
runASAP = true;
|
||||
BaseType_t higherWake = 0;
|
||||
mainDelay.interruptFromISR(&higherWake);
|
||||
};
|
||||
cancelConfig.singlePress = INPUT_BROKER_CANCEL;
|
||||
cancelConfig.longPress = INPUT_BROKER_SHUTDOWN;
|
||||
cancelConfig.longPressTime = 4000;
|
||||
CancelButtonThread->initButton(cancelConfig);
|
||||
#endif
|
||||
|
||||
#if defined(ALT_BUTTON_PIN)
|
||||
// Buttons. Moved here cause we need NodeDB to be initialized
|
||||
BackButtonThread = new ButtonThread("BackButton");
|
||||
ButtonConfig backConfig;
|
||||
backConfig.pinNumber = ALT_BUTTON_PIN;
|
||||
backConfig.activeLow = ALT_BUTTON_ACTIVE_LOW;
|
||||
backConfig.activePullup = ALT_BUTTON_ACTIVE_PULLUP;
|
||||
backConfig.pullupSense = pullup_sense;
|
||||
backConfig.intRoutine = []() {
|
||||
BackButtonThread->userButton.tick();
|
||||
BackButtonThread->setIntervalFromNow(0);
|
||||
runASAP = true;
|
||||
BaseType_t higherWake = 0;
|
||||
mainDelay.interruptFromISR(&higherWake);
|
||||
};
|
||||
backConfig.singlePress = INPUT_BROKER_ALT_PRESS;
|
||||
backConfig.longPress = INPUT_BROKER_ALT_LONG;
|
||||
backConfig.longPressTime = 500;
|
||||
BackButtonThread->initButton(backConfig);
|
||||
#endif
|
||||
|
||||
#if defined(BUTTON_PIN)
|
||||
#if defined(USERPREFS_BUTTON_PIN)
|
||||
int _pinNum = config.device.button_gpio ? config.device.button_gpio : USERPREFS_BUTTON_PIN;
|
||||
#else
|
||||
int _pinNum = config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN;
|
||||
#endif
|
||||
#ifndef BUTTON_ACTIVE_LOW
|
||||
#define BUTTON_ACTIVE_LOW true
|
||||
#endif
|
||||
#ifndef BUTTON_ACTIVE_PULLUP
|
||||
#define BUTTON_ACTIVE_PULLUP true
|
||||
#endif
|
||||
|
||||
// Buttons. Moved here cause we need NodeDB to be initialized
|
||||
// If your variant.h has a BUTTON_PIN defined, go ahead and define BUTTON_ACTIVE_LOW and BUTTON_ACTIVE_PULLUP
|
||||
UserButtonThread = new ButtonThread("UserButton");
|
||||
if (screen) {
|
||||
ButtonConfig userConfig;
|
||||
userConfig.pinNumber = (uint8_t)_pinNum;
|
||||
userConfig.activeLow = BUTTON_ACTIVE_LOW;
|
||||
userConfig.activePullup = BUTTON_ACTIVE_PULLUP;
|
||||
userConfig.pullupSense = pullup_sense;
|
||||
userConfig.intRoutine = []() {
|
||||
UserButtonThread->userButton.tick();
|
||||
UserButtonThread->setIntervalFromNow(0);
|
||||
runASAP = true;
|
||||
BaseType_t higherWake = 0;
|
||||
mainDelay.interruptFromISR(&higherWake);
|
||||
};
|
||||
userConfig.singlePress = INPUT_BROKER_USER_PRESS;
|
||||
userConfig.longPress = INPUT_BROKER_SELECT;
|
||||
userConfig.longPressTime = 500;
|
||||
userConfig.longLongPress = INPUT_BROKER_SHUTDOWN;
|
||||
UserButtonThread->initButton(userConfig);
|
||||
} else {
|
||||
ButtonConfig userConfigNoScreen;
|
||||
userConfigNoScreen.pinNumber = (uint8_t)_pinNum;
|
||||
userConfigNoScreen.activeLow = BUTTON_ACTIVE_LOW;
|
||||
userConfigNoScreen.activePullup = BUTTON_ACTIVE_PULLUP;
|
||||
userConfigNoScreen.pullupSense = pullup_sense;
|
||||
userConfigNoScreen.intRoutine = []() {
|
||||
UserButtonThread->userButton.tick();
|
||||
UserButtonThread->setIntervalFromNow(0);
|
||||
runASAP = true;
|
||||
BaseType_t higherWake = 0;
|
||||
mainDelay.interruptFromISR(&higherWake);
|
||||
};
|
||||
userConfigNoScreen.singlePress = INPUT_BROKER_USER_PRESS;
|
||||
userConfigNoScreen.longPress = INPUT_BROKER_NONE;
|
||||
userConfigNoScreen.longPressTime = 500;
|
||||
userConfigNoScreen.longLongPress = INPUT_BROKER_SHUTDOWN;
|
||||
userConfigNoScreen.doublePress = INPUT_BROKER_SEND_PING;
|
||||
userConfigNoScreen.triplePress = INPUT_BROKER_GPS_TOGGLE;
|
||||
UserButtonThread->initButton(userConfigNoScreen);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS
|
||||
|
||||
@@ -1419,15 +1419,6 @@ void NodeDB::loadFromDisk()
|
||||
if (portduino_config.has_configDisplayMode) {
|
||||
config.display.displaymode = (_meshtastic_Config_DisplayConfig_DisplayMode)portduino_config.configDisplayMode;
|
||||
}
|
||||
if (portduino_config.has_statusMessage) {
|
||||
moduleConfig.has_statusmessage = true;
|
||||
strncpy(moduleConfig.statusmessage.node_status, portduino_config.statusMessage.c_str(),
|
||||
sizeof(moduleConfig.statusmessage.node_status));
|
||||
moduleConfig.statusmessage.node_status[sizeof(moduleConfig.statusmessage.node_status) - 1] = '\0';
|
||||
}
|
||||
if (portduino_config.enable_UDP) {
|
||||
config.network.enabled_protocols = true;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -1568,7 +1559,6 @@ bool NodeDB::saveToDiskNoRetry(int saveWhat)
|
||||
moduleConfig.has_ambient_lighting = true;
|
||||
moduleConfig.has_audio = true;
|
||||
moduleConfig.has_paxcounter = true;
|
||||
moduleConfig.has_statusmessage = true;
|
||||
|
||||
success &=
|
||||
saveProto(moduleConfigFileName, meshtastic_LocalModuleConfig_size, &meshtastic_LocalModuleConfig_msg, &moduleConfig);
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
ErrorCode ReliableRouter::send(meshtastic_MeshPacket *p)
|
||||
{
|
||||
if (p->want_ack) {
|
||||
// If someone asks for acks on broadcast, we need the hop limit to be at least one, so that first node that receives our
|
||||
// message will rebroadcast. But asking for hop_limit 0 in that context means the client app has no preference on hop
|
||||
// counts and we want this message to get through the whole mesh, so use the default.
|
||||
if (p->hop_limit == 0) {
|
||||
p->hop_limit = Default::getConfiguredOrDefaultHopLimit(config.lora.hop_limit);
|
||||
}
|
||||
DEBUG_HEAP_BEFORE;
|
||||
auto copy = packetPool.allocCopy(*p);
|
||||
DEBUG_HEAP_AFTER("ReliableRouter::send", copy);
|
||||
|
||||
@@ -266,13 +266,6 @@ ErrorCode Router::sendLocal(meshtastic_MeshPacket *p, RxSource src)
|
||||
}
|
||||
}
|
||||
|
||||
// If someone asks for acks on broadcast, we need the hop limit to be at least one, so that first node that receives our
|
||||
// message will rebroadcast. But asking for hop_limit 0 in that context means the client app has no preference on hop
|
||||
// counts and we want this message to get through the whole mesh, so use the default.
|
||||
if (src == RX_SRC_USER && p->want_ack && p->hop_limit == 0) {
|
||||
p->hop_limit = Default::getConfiguredOrDefaultHopLimit(config.lora.hop_limit);
|
||||
}
|
||||
|
||||
return send(p);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -905,11 +905,10 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
|
||||
|
||||
bool AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c)
|
||||
{
|
||||
bool shouldReboot = true;
|
||||
// If we are in an open transaction or configuring MQTT or Serial (which have validation), defer disabling Bluetooth
|
||||
// Otherwise, disable Bluetooth to prevent the phone from interfering with the config
|
||||
if (!hasOpenEditTransaction && !IS_ONE_OF(c.which_payload_variant, meshtastic_ModuleConfig_mqtt_tag,
|
||||
meshtastic_ModuleConfig_serial_tag, meshtastic_ModuleConfig_statusmessage_tag)) {
|
||||
if (!hasOpenEditTransaction &&
|
||||
!IS_ONE_OF(c.which_payload_variant, meshtastic_ModuleConfig_mqtt_tag, meshtastic_ModuleConfig_serial_tag)) {
|
||||
disableBluetooth();
|
||||
}
|
||||
|
||||
@@ -1001,14 +1000,8 @@ bool AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c)
|
||||
moduleConfig.has_paxcounter = true;
|
||||
moduleConfig.paxcounter = c.payload_variant.paxcounter;
|
||||
break;
|
||||
case meshtastic_ModuleConfig_statusmessage_tag:
|
||||
LOG_INFO("Set module config: StatusMessage");
|
||||
moduleConfig.has_statusmessage = true;
|
||||
moduleConfig.statusmessage = c.payload_variant.statusmessage;
|
||||
shouldReboot = false;
|
||||
break;
|
||||
}
|
||||
saveChanges(SEGMENT_MODULECONFIG, shouldReboot);
|
||||
saveChanges(SEGMENT_MODULECONFIG);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1187,11 +1180,6 @@ void AdminModule::handleGetModuleConfig(const meshtastic_MeshPacket &req, const
|
||||
res.get_module_config_response.which_payload_variant = meshtastic_ModuleConfig_paxcounter_tag;
|
||||
res.get_module_config_response.payload_variant.paxcounter = moduleConfig.paxcounter;
|
||||
break;
|
||||
case meshtastic_AdminMessage_ModuleConfigType_STATUSMESSAGE_CONFIG:
|
||||
LOG_INFO("Get module config: StatusMessage");
|
||||
res.get_module_config_response.which_payload_variant = meshtastic_ModuleConfig_statusmessage_tag;
|
||||
res.get_module_config_response.payload_variant.statusmessage = moduleConfig.statusmessage;
|
||||
break;
|
||||
}
|
||||
|
||||
// NOTE: The phone app needs to know the ls_secsvalue so it can properly expect sleep behavior.
|
||||
|
||||
@@ -1,7 +1,24 @@
|
||||
#include "configuration.h"
|
||||
#if !MESHTASTIC_EXCLUDE_INPUTBROKER
|
||||
#include "buzz/BuzzerFeedbackThread.h"
|
||||
#include "input/ExpressLRSFiveWay.h"
|
||||
#include "input/InputBroker.h"
|
||||
#include "input/RotaryEncoderImpl.h"
|
||||
#include "input/RotaryEncoderInterruptImpl1.h"
|
||||
#include "input/SerialKeyboardImpl.h"
|
||||
#include "input/UpDownInterruptImpl1.h"
|
||||
#include "input/i2cButton.h"
|
||||
#include "modules/SystemCommandsModule.h"
|
||||
#if HAS_TRACKBALL
|
||||
#include "input/TrackballInterruptImpl1.h"
|
||||
#endif
|
||||
|
||||
#include "modules/StatusLEDModule.h"
|
||||
|
||||
#if !MESHTASTIC_EXCLUDE_I2C
|
||||
#include "input/cardKbI2cImpl.h"
|
||||
#endif
|
||||
#include "input/kbMatrixImpl.h"
|
||||
#endif
|
||||
#if !MESHTASTIC_EXCLUDE_PKI
|
||||
#include "KeyVerificationModule.h"
|
||||
@@ -42,6 +59,8 @@
|
||||
#include "modules/WaypointModule.h"
|
||||
#endif
|
||||
#if ARCH_PORTDUINO
|
||||
#include "input/LinuxInputImpl.h"
|
||||
#include "input/SeesawRotary.h"
|
||||
#include "modules/Telemetry/HostMetrics.h"
|
||||
#if !MESHTASTIC_EXCLUDE_STOREFORWARD
|
||||
#include "modules/StoreForwardModule.h"
|
||||
@@ -89,9 +108,6 @@
|
||||
#if !MESHTASTIC_EXCLUDE_DROPZONE
|
||||
#include "modules/DropzoneModule.h"
|
||||
#endif
|
||||
#if !MESHTASTIC_EXCLUDE_STATUS
|
||||
#include "modules/StatusMessageModule.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Create module instances here. If you are adding a new module, you must 'new' it here (or somewhere else)
|
||||
@@ -149,9 +165,6 @@ void setupModules()
|
||||
#if !MESHTASTIC_EXCLUDE_DROPZONE
|
||||
dropzoneModule = new DropzoneModule();
|
||||
#endif
|
||||
#if !MESHTASTIC_EXCLUDE_STATUS
|
||||
statusMessageModule = new StatusMessageModule();
|
||||
#endif
|
||||
#if !MESHTASTIC_EXCLUDE_GENERIC_THREAD_MODULE
|
||||
new GenericThreadModule();
|
||||
#endif
|
||||
@@ -166,6 +179,63 @@ void setupModules()
|
||||
#endif
|
||||
// Example: Put your module here
|
||||
// new ReplyModule();
|
||||
#if (HAS_BUTTON || ARCH_PORTDUINO) && !MESHTASTIC_EXCLUDE_INPUTBROKER
|
||||
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
|
||||
#if defined(T_LORA_PAGER)
|
||||
// use a special FSM based rotary encoder version for T-LoRa Pager
|
||||
rotaryEncoderImpl = new RotaryEncoderImpl();
|
||||
if (!rotaryEncoderImpl->init()) {
|
||||
delete rotaryEncoderImpl;
|
||||
rotaryEncoderImpl = nullptr;
|
||||
}
|
||||
#elif defined(INPUTDRIVER_ENCODER_TYPE) && (INPUTDRIVER_ENCODER_TYPE == 2)
|
||||
upDownInterruptImpl1 = new UpDownInterruptImpl1();
|
||||
if (!upDownInterruptImpl1->init()) {
|
||||
delete upDownInterruptImpl1;
|
||||
upDownInterruptImpl1 = nullptr;
|
||||
}
|
||||
#else
|
||||
rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1();
|
||||
if (!rotaryEncoderInterruptImpl1->init()) {
|
||||
delete rotaryEncoderInterruptImpl1;
|
||||
rotaryEncoderInterruptImpl1 = nullptr;
|
||||
}
|
||||
#endif
|
||||
cardKbI2cImpl = new CardKbI2cImpl();
|
||||
cardKbI2cImpl->init();
|
||||
#if defined(M5STACK_UNITC6L)
|
||||
i2cButton = new i2cButtonThread("i2cButtonThread");
|
||||
#endif
|
||||
#ifdef INPUTBROKER_MATRIX_TYPE
|
||||
kbMatrixImpl = new KbMatrixImpl();
|
||||
kbMatrixImpl->init();
|
||||
#endif // INPUTBROKER_MATRIX_TYPE
|
||||
#ifdef INPUTBROKER_SERIAL_TYPE
|
||||
aSerialKeyboardImpl = new SerialKeyboardImpl();
|
||||
aSerialKeyboardImpl->init();
|
||||
#endif // INPUTBROKER_MATRIX_TYPE
|
||||
}
|
||||
#endif // HAS_BUTTON
|
||||
#if ARCH_PORTDUINO
|
||||
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR && portduino_config.i2cdev != "") {
|
||||
seesawRotary = new SeesawRotary("SeesawRotary");
|
||||
if (!seesawRotary->init()) {
|
||||
delete seesawRotary;
|
||||
seesawRotary = nullptr;
|
||||
}
|
||||
aLinuxInputImpl = new LinuxInputImpl();
|
||||
aLinuxInputImpl->init();
|
||||
}
|
||||
#endif
|
||||
#if !MESHTASTIC_EXCLUDE_INPUTBROKER && HAS_TRACKBALL
|
||||
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
|
||||
trackballInterruptImpl1 = new TrackballInterruptImpl1();
|
||||
trackballInterruptImpl1->init(TB_DOWN, TB_UP, TB_LEFT, TB_RIGHT, TB_PRESS);
|
||||
}
|
||||
#endif
|
||||
#ifdef INPUTBROKER_EXPRESSLRSFIVEWAY_TYPE
|
||||
expressLRSFiveWayInput = new ExpressLRSFiveWay();
|
||||
#endif
|
||||
#if HAS_SCREEN && !MESHTASTIC_EXCLUDE_CANNEDMESSAGES
|
||||
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
|
||||
cannedMessageModule = new CannedMessageModule();
|
||||
|
||||
@@ -67,8 +67,6 @@ uint8_t RoutingModule::getHopLimitForResponse(const meshtastic_MeshPacket &mp)
|
||||
#if !(EVENTMODE) // This falls through to the default.
|
||||
return hopsUsed; // If the request used more hops than the limit, use the same amount of hops
|
||||
#endif
|
||||
} else if (mp.hop_start == 0) {
|
||||
return 0; // The requesting node wanted 0 hops, so the response also uses a direct/local path.
|
||||
} else if ((uint8_t)(hopsUsed + 2) < config.lora.hop_limit) {
|
||||
return hopsUsed + 2; // Use only the amount of hops needed with some margin as the way back may be different
|
||||
}
|
||||
|
||||
@@ -63,25 +63,28 @@
|
||||
SerialModule *serialModule;
|
||||
SerialModuleRadio *serialModuleRadio;
|
||||
|
||||
#ifndef SERIAL_PRINT_PORT
|
||||
#define SERIAL_PRINT_PORT 2
|
||||
#endif
|
||||
#if defined(TTGO_T_ECHO) || defined(TTGO_T_ECHO_PLUS) || defined(CANARYONE) || defined(MESHLINK) || \
|
||||
defined(ELECROW_ThinkNode_M1) || defined(ELECROW_ThinkNode_M4) || defined(ELECROW_ThinkNode_M5) || \
|
||||
defined(HELTEC_MESH_SOLAR) || defined(T_ECHO_LITE) || defined(ELECROW_ThinkNode_M3) || defined(MUZI_BASE)
|
||||
|
||||
#if SERIAL_PRINT_PORT == 0
|
||||
#define SERIAL_PRINT_OBJECT Serial
|
||||
#elif SERIAL_PRINT_PORT == 1
|
||||
#define SERIAL_PRINT_OBJECT Serial1
|
||||
#elif SERIAL_PRINT_PORT == 2
|
||||
#define SERIAL_PRINT_OBJECT Serial2
|
||||
#else
|
||||
#error "Unsupported SERIAL_PRINT_PORT value. Allowed values are 0, 1, or 2."
|
||||
#endif
|
||||
|
||||
SerialModule::SerialModule() : StreamAPI(&SERIAL_PRINT_OBJECT), concurrency::OSThread("Serial")
|
||||
SerialModule::SerialModule() : StreamAPI(&Serial), concurrency::OSThread("Serial")
|
||||
{
|
||||
api_type = TYPE_SERIAL;
|
||||
}
|
||||
static Print *serialPrint = &SERIAL_PRINT_OBJECT;
|
||||
static Print *serialPrint = &Serial;
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32C6) || defined(RAK3172) || defined(EBYTE_E77_MBL)
|
||||
SerialModule::SerialModule() : StreamAPI(&Serial1), concurrency::OSThread("Serial")
|
||||
{
|
||||
api_type = TYPE_SERIAL;
|
||||
}
|
||||
static Print *serialPrint = &Serial1;
|
||||
#else
|
||||
SerialModule::SerialModule() : StreamAPI(&Serial2), concurrency::OSThread("Serial")
|
||||
{
|
||||
api_type = TYPE_SERIAL;
|
||||
}
|
||||
static Print *serialPrint = &Serial2;
|
||||
#endif
|
||||
|
||||
char serialBytes[512];
|
||||
size_t serialPayloadSize;
|
||||
@@ -202,7 +205,9 @@ int32_t SerialModule::runOnce()
|
||||
Serial.begin(baud);
|
||||
Serial.setTimeout(moduleConfig.serial.timeout > 0 ? moduleConfig.serial.timeout : TIMEOUT);
|
||||
}
|
||||
#elif SERIAL_PRINT_PORT != 0
|
||||
#elif !defined(TTGO_T_ECHO) && !defined(TTGO_T_ECHO_PLUS) && !defined(T_ECHO_LITE) && !defined(CANARYONE) && \
|
||||
!defined(MESHLINK) && !defined(ELECROW_ThinkNode_M1) && !defined(ELECROW_ThinkNode_M3) && !defined(ELECROW_ThinkNode_M4) && \
|
||||
!defined(ELECROW_ThinkNode_M5) && !defined(MUZI_BASE)
|
||||
|
||||
if (moduleConfig.serial.rxd && moduleConfig.serial.txd) {
|
||||
#ifdef ARCH_RP2040
|
||||
@@ -259,7 +264,9 @@ int32_t SerialModule::runOnce()
|
||||
}
|
||||
}
|
||||
|
||||
#if SERIAL_PRINT_PORT != 0
|
||||
#if !defined(TTGO_T_ECHO) && !defined(TTGO_T_ECHO_PLUS) && !defined(T_ECHO_LITE) && !defined(CANARYONE) && !defined(MESHLINK) && \
|
||||
!defined(ELECROW_ThinkNode_M1) && !defined(ELECROW_ThinkNode_M3) && !defined(ELECROW_ThinkNode_M4) && \
|
||||
!defined(ELECROW_ThinkNode_M5) && !defined(MUZI_BASE)
|
||||
else if ((moduleConfig.serial.mode == meshtastic_ModuleConfig_SerialConfig_Serial_Mode_WS85)) {
|
||||
processWXSerial();
|
||||
|
||||
@@ -533,7 +540,11 @@ ParsedLine parseLine(const char *line)
|
||||
*/
|
||||
void SerialModule::processWXSerial()
|
||||
{
|
||||
#if SERIAL_PRINT_PORT != 0 && !defined(ARCH_STM32WL) && !defined(CONFIG_IDF_TARGET_ESP32C6)
|
||||
#if !defined(TTGO_T_ECHO) && !defined(TTGO_T_ECHO_PLUS) && !defined(T_ECHO_LITE) && !defined(CANARYONE) && \
|
||||
!defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(MESHLINK) && !defined(ELECROW_ThinkNode_M1) && \
|
||||
!defined(ELECROW_ThinkNode_M3) && \
|
||||
!defined(ELECROW_ThinkNode_M4) && \
|
||||
!defined(ELECROW_ThinkNode_M5) && !defined(ARCH_STM32WL) && !defined(MUZI_BASE)
|
||||
|
||||
static unsigned int lastAveraged = 0;
|
||||
static unsigned int averageIntervalMillis = 300000; // 5 minutes hard coded.
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
#if !MESHTASTIC_EXCLUDE_STATUS
|
||||
|
||||
#include "StatusMessageModule.h"
|
||||
#include "MeshService.h"
|
||||
#include "ProtobufModule.h"
|
||||
|
||||
StatusMessageModule *statusMessageModule;
|
||||
|
||||
int32_t StatusMessageModule::runOnce()
|
||||
{
|
||||
if (moduleConfig.has_statusmessage && moduleConfig.statusmessage.node_status[0] != '\0') {
|
||||
// create and send message with the status message set
|
||||
meshtastic_StatusMessage ourStatus = meshtastic_StatusMessage_init_zero;
|
||||
strncpy(ourStatus.status, moduleConfig.statusmessage.node_status, sizeof(ourStatus.status));
|
||||
ourStatus.status[sizeof(ourStatus.status) - 1] = '\0'; // ensure null termination
|
||||
meshtastic_MeshPacket *p = allocDataPacket();
|
||||
p->decoded.payload.size = pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes),
|
||||
meshtastic_StatusMessage_fields, &ourStatus);
|
||||
p->to = NODENUM_BROADCAST;
|
||||
p->decoded.want_response = false;
|
||||
p->priority = meshtastic_MeshPacket_Priority_BACKGROUND;
|
||||
p->channel = 0;
|
||||
service->sendToMesh(p);
|
||||
}
|
||||
|
||||
return 1000 * 12 * 60 * 60;
|
||||
}
|
||||
|
||||
ProcessMessage StatusMessageModule::handleReceived(const meshtastic_MeshPacket &mp)
|
||||
{
|
||||
if (mp.which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
|
||||
meshtastic_StatusMessage incomingMessage;
|
||||
if (pb_decode_from_bytes(mp.decoded.payload.bytes, mp.decoded.payload.size, meshtastic_StatusMessage_fields,
|
||||
&incomingMessage)) {
|
||||
LOG_INFO("Received a NodeStatus message %s", incomingMessage.status);
|
||||
}
|
||||
}
|
||||
return ProcessMessage::CONTINUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,35 +0,0 @@
|
||||
#pragma once
|
||||
#if !MESHTASTIC_EXCLUDE_STATUS
|
||||
#include "SinglePortModule.h"
|
||||
#include "configuration.h"
|
||||
|
||||
class StatusMessageModule : public SinglePortModule, private concurrency::OSThread
|
||||
{
|
||||
|
||||
public:
|
||||
/** Constructor
|
||||
* name is for debugging output
|
||||
*/
|
||||
StatusMessageModule()
|
||||
: SinglePortModule("statusMessage", meshtastic_PortNum_NODE_STATUS_APP), concurrency::OSThread("StatusMessage")
|
||||
{
|
||||
if (moduleConfig.has_statusmessage && moduleConfig.statusmessage.node_status[0] != '\0') {
|
||||
this->setInterval(2 * 60 * 1000);
|
||||
} else {
|
||||
this->setInterval(1000 * 12 * 60 * 60);
|
||||
}
|
||||
// TODO: If we have a string, set the initial delay (15 minutes maybe)
|
||||
}
|
||||
|
||||
virtual int32_t runOnce() override;
|
||||
|
||||
protected:
|
||||
/** Called to handle a particular incoming message
|
||||
*/
|
||||
virtual ProcessMessage handleReceived(const meshtastic_MeshPacket &mp) override;
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
extern StatusMessageModule *statusMessageModule;
|
||||
#endif
|
||||
@@ -529,46 +529,37 @@ bool EnvironmentTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPac
|
||||
|
||||
bool EnvironmentTelemetryModule::getEnvironmentTelemetry(meshtastic_Telemetry *m)
|
||||
{
|
||||
bool valid = false;
|
||||
bool valid = true;
|
||||
bool hasSensor = false;
|
||||
// getMetrics() doesn't always get evaluated because of
|
||||
// short-circuit evaluation rules in c++
|
||||
bool get_metrics;
|
||||
m->time = getTime();
|
||||
m->which_variant = meshtastic_Telemetry_environment_metrics_tag;
|
||||
m->variant.environment_metrics = meshtastic_EnvironmentMetrics_init_zero;
|
||||
|
||||
for (TelemetrySensor *sensor : sensors) {
|
||||
get_metrics = sensor->getMetrics(m); // avoid short-circuit evaluation rules
|
||||
valid = valid || get_metrics;
|
||||
valid = valid && sensor->getMetrics(m);
|
||||
hasSensor = true;
|
||||
}
|
||||
|
||||
#ifndef T1000X_SENSOR_EN
|
||||
if (ina219Sensor.hasSensor()) {
|
||||
get_metrics = ina219Sensor.getMetrics(m);
|
||||
valid = valid || get_metrics;
|
||||
valid = valid && ina219Sensor.getMetrics(m);
|
||||
hasSensor = true;
|
||||
}
|
||||
if (ina260Sensor.hasSensor()) {
|
||||
get_metrics = ina260Sensor.getMetrics(m);
|
||||
valid = valid || get_metrics;
|
||||
valid = valid && ina260Sensor.getMetrics(m);
|
||||
hasSensor = true;
|
||||
}
|
||||
if (ina3221Sensor.hasSensor()) {
|
||||
get_metrics = ina3221Sensor.getMetrics(m);
|
||||
valid = valid || get_metrics;
|
||||
valid = valid && ina3221Sensor.getMetrics(m);
|
||||
hasSensor = true;
|
||||
}
|
||||
if (max17048Sensor.hasSensor()) {
|
||||
get_metrics = max17048Sensor.getMetrics(m);
|
||||
valid = valid || get_metrics;
|
||||
valid = valid && max17048Sensor.getMetrics(m);
|
||||
hasSensor = true;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAS_RAKPROT
|
||||
get_metrics = rak9154Sensor.getMetrics(m);
|
||||
valid = valid || get_metrics;
|
||||
valid = valid && rak9154Sensor.getMetrics(m);
|
||||
hasSensor = true;
|
||||
#endif
|
||||
return valid && hasSensor;
|
||||
|
||||
@@ -168,21 +168,18 @@ bool HealthTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPacket &
|
||||
|
||||
bool HealthTelemetryModule::getHealthTelemetry(meshtastic_Telemetry *m)
|
||||
{
|
||||
bool valid = false;
|
||||
bool valid = true;
|
||||
bool hasSensor = false;
|
||||
bool get_metrics;
|
||||
m->time = getTime();
|
||||
m->which_variant = meshtastic_Telemetry_health_metrics_tag;
|
||||
m->variant.health_metrics = meshtastic_HealthMetrics_init_zero;
|
||||
|
||||
if (max30102Sensor.hasSensor()) {
|
||||
get_metrics = max30102Sensor.getMetrics(m);
|
||||
valid = valid || get_metrics; // avoid short-circuit evaluation rules
|
||||
valid = valid && max30102Sensor.getMetrics(m);
|
||||
hasSensor = true;
|
||||
}
|
||||
if (mlx90614Sensor.hasSensor()) {
|
||||
get_metrics = mlx90614Sensor.getMetrics(m);
|
||||
valid = valid || get_metrics;
|
||||
valid = valid && mlx90614Sensor.getMetrics(m);
|
||||
hasSensor = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -872,7 +872,6 @@ bool loadConfig(const char *configPath)
|
||||
}
|
||||
|
||||
if (yamlConfig["Config"]) {
|
||||
portduino_config.has_config_overrides = true;
|
||||
if (yamlConfig["Config"]["DisplayMode"]) {
|
||||
portduino_config.has_configDisplayMode = true;
|
||||
if ((yamlConfig["Config"]["DisplayMode"]).as<std::string>("") == "TWOCOLOR") {
|
||||
@@ -885,13 +884,6 @@ bool loadConfig(const char *configPath)
|
||||
portduino_config.configDisplayMode = meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT;
|
||||
}
|
||||
}
|
||||
if (yamlConfig["Config"]["StatusMessage"]) {
|
||||
portduino_config.has_statusMessage = true;
|
||||
portduino_config.statusMessage = (yamlConfig["Config"]["StatusMessage"]).as<std::string>("");
|
||||
}
|
||||
if ((yamlConfig["Config"]["EnableUDP"]).as<bool>(false)) {
|
||||
portduino_config.enable_UDP = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (yamlConfig["General"]) {
|
||||
|
||||
@@ -177,12 +177,8 @@ extern struct portduino_config_struct {
|
||||
int hostMetrics_channel = 0;
|
||||
|
||||
// config
|
||||
bool has_config_overrides = false;
|
||||
int configDisplayMode = 0;
|
||||
bool has_configDisplayMode = false;
|
||||
std::string statusMessage = "";
|
||||
bool has_statusMessage = false;
|
||||
bool enable_UDP = false;
|
||||
|
||||
// General
|
||||
std::string mac_address = "";
|
||||
@@ -509,30 +505,21 @@ extern struct portduino_config_struct {
|
||||
}
|
||||
|
||||
// config
|
||||
if (has_config_overrides) {
|
||||
if (has_configDisplayMode) {
|
||||
out << YAML::Key << "Config" << YAML::Value << YAML::BeginMap;
|
||||
if (has_configDisplayMode) {
|
||||
|
||||
switch (configDisplayMode) {
|
||||
case meshtastic_Config_DisplayConfig_DisplayMode_TWOCOLOR:
|
||||
out << YAML::Key << "DisplayMode" << YAML::Value << "TWOCOLOR";
|
||||
break;
|
||||
case meshtastic_Config_DisplayConfig_DisplayMode_INVERTED:
|
||||
out << YAML::Key << "DisplayMode" << YAML::Value << "INVERTED";
|
||||
break;
|
||||
case meshtastic_Config_DisplayConfig_DisplayMode_COLOR:
|
||||
out << YAML::Key << "DisplayMode" << YAML::Value << "COLOR";
|
||||
break;
|
||||
case meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT:
|
||||
out << YAML::Key << "DisplayMode" << YAML::Value << "DEFAULT";
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (has_statusMessage) {
|
||||
out << YAML::Key << "StatusMessage" << YAML::Value << statusMessage;
|
||||
}
|
||||
if (enable_UDP) {
|
||||
out << YAML::Key << "EnableUDP" << YAML::Value << true;
|
||||
switch (configDisplayMode) {
|
||||
case meshtastic_Config_DisplayConfig_DisplayMode_TWOCOLOR:
|
||||
out << YAML::Key << "DisplayMode" << YAML::Value << "TWOCOLOR";
|
||||
break;
|
||||
case meshtastic_Config_DisplayConfig_DisplayMode_INVERTED:
|
||||
out << YAML::Key << "DisplayMode" << YAML::Value << "INVERTED";
|
||||
break;
|
||||
case meshtastic_Config_DisplayConfig_DisplayMode_COLOR:
|
||||
out << YAML::Key << "DisplayMode" << YAML::Value << "COLOR";
|
||||
break;
|
||||
case meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT:
|
||||
out << YAML::Key << "DisplayMode" << YAML::Value << "DEFAULT";
|
||||
break;
|
||||
}
|
||||
|
||||
out << YAML::EndMap; // Config
|
||||
|
||||
64
test_ai_slop.c
Normal file
64
test_ai_slop.c
Normal file
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* AI Slop Test File - This is intentionally AI-generated looking content
|
||||
*
|
||||
* This function serves the purpose of demonstrating and testing the capability
|
||||
* of the advanced machine learning model to comprehensively identify and accurately
|
||||
* classify content that exhibits characteristics commonly associated with artificial
|
||||
* intelligence-generated compositions, including but not limited to: redundant phrasing,
|
||||
* verbose explanations, generic descriptions, lack of specific implementation details,
|
||||
* and an overall tone that suggests automated generation rather than human authorship.
|
||||
*
|
||||
* The methodology employed herein leverages sophisticated algorithms and innovative
|
||||
* approaches to systematically and methodically accomplish the following objectives:
|
||||
* 1. To demonstrate the robustness of the classification system
|
||||
* 2. To showcase the effectiveness of modern detection techniques
|
||||
* 3. To validate the operational parameters of the triaging infrastructure
|
||||
* 4. To comprehensively evaluate the performance metrics of the solution
|
||||
*
|
||||
* Implementation considerations and technical specifications have been carefully
|
||||
* considered and thoughtfully incorporated to ensure optimal functionality and
|
||||
* seamless integration with existing systems and protocols.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/**
|
||||
* A comprehensive and thoroughly documented function that implements
|
||||
* a sophisticated approach to value processing and subsequent display.
|
||||
*/
|
||||
void demonstrateAIGeneratedCode(const char *input_value)
|
||||
{
|
||||
// Initialize variables with appropriate data types
|
||||
int status_code = 0;
|
||||
char buffer[256];
|
||||
|
||||
// Implement conditional logic to handle various scenarios
|
||||
if (input_value != NULL) {
|
||||
// Perform string manipulation operations
|
||||
snprintf(buffer, sizeof(buffer), "Processing input: %s", input_value);
|
||||
printf("%s\n", buffer);
|
||||
status_code = 1;
|
||||
} else {
|
||||
// Handle null input scenario appropriately
|
||||
printf("Input value was null\n");
|
||||
status_code = 0;
|
||||
}
|
||||
|
||||
// Return and indicate completion
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Primary entry point for application execution.
|
||||
* This function orchestrates the overall flow and coordination of various
|
||||
* components to achieve the desired outcomes and objectives.
|
||||
*/
|
||||
int main()
|
||||
{
|
||||
printf("Initiating execution of AI slop detection test...\n");
|
||||
demonstrateAIGeneratedCode("test data");
|
||||
printf("Execution completed successfully.\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -6,6 +6,8 @@
|
||||
#define LED_GREEN 12
|
||||
#define LED_BLUE 2
|
||||
|
||||
#define LED_BUILTIN LED_GREEN
|
||||
|
||||
static const uint8_t TX = 1;
|
||||
static const uint8_t RX = 3;
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#define LED_GREEN 12
|
||||
#define LED_BLUE 2
|
||||
|
||||
#define LED_BUILTIN LED_GREEN
|
||||
|
||||
static const uint8_t TX = 1;
|
||||
static const uint8_t RX = 3;
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ build_flags = ${esp32_base.build_flags}
|
||||
-I variants/esp32/tbeam
|
||||
-DBOARD_HAS_PSRAM
|
||||
-mfix-esp32-psram-cache-issue
|
||||
-ULED_BUILTIN
|
||||
upload_speed = 921600
|
||||
|
||||
[env:tbeam-displayshield]
|
||||
|
||||
@@ -50,5 +50,3 @@ void c6l_init();
|
||||
#endif
|
||||
#define SCREEN_TRANSITION_FRAMERATE 10
|
||||
#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness
|
||||
|
||||
#define SERIAL_PRINT_PORT 1
|
||||
|
||||
@@ -8,4 +8,3 @@ build_flags =
|
||||
-I variants/esp32c6/tlora_c6
|
||||
-DARDUINO_USB_CDC_ON_BOOT=1
|
||||
-DARDUINO_USB_MODE=1
|
||||
-ULED_BUILTIN
|
||||
|
||||
@@ -19,5 +19,3 @@
|
||||
#define SX126X_TXEN 14
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
#define SERIAL_PRINT_PORT 1
|
||||
|
||||
@@ -81,6 +81,4 @@
|
||||
|
||||
#define BUTTON_PIN PIN_BUTTON1
|
||||
#define BUTTON_PIN_ALT PIN_BUTTON2
|
||||
|
||||
#define SERIAL_PRINT_PORT 0
|
||||
#endif
|
||||
|
||||
@@ -18,4 +18,3 @@ build_flags =
|
||||
${esp32s3_base.build_flags}
|
||||
-D HELTEC_V3
|
||||
-I variants/esp32s3/heltec_v3
|
||||
-ULED_BUILTIN
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x1001
|
||||
|
||||
static const uint8_t LED_BUILTIN = 35;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint8_t LED_BUILTIN = 45; // LED is not populated on earliest board variant
|
||||
#define BUILTIN_LED LED_BUILTIN // Backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint8_t LED_BUILTIN = 45; // LED is not populated on earliest board variant
|
||||
#define BUILTIN_LED LED_BUILTIN // Backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint8_t LED_BUILTIN = 35;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint8_t LED_BUILTIN = 18;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint8_t LED_BUILTIN = 18;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
|
||||
static const uint8_t KEY_BUILTIN = 0;
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x1001
|
||||
|
||||
static const uint8_t LED_BUILTIN = 18;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x1001
|
||||
|
||||
static const uint8_t LED_BUILTIN = 18;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x1001
|
||||
|
||||
static const uint8_t LED_BUILTIN = 18;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
|
||||
@@ -10,7 +10,10 @@
|
||||
// Some boards have too low voltage on this pin (board design bug)
|
||||
// Use different pin with 3V and connect with 48
|
||||
// and change this setup for the chosen pin (for example 38)
|
||||
#define RGB_BUILTIN SOC_GPIO_PIN_COUNT + 48
|
||||
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + 48;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
#define RGB_BUILTIN LED_BUILTIN
|
||||
#define RGB_BRIGHTNESS 64
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
|
||||
@@ -49,6 +49,10 @@ static const uint8_t T14 = 14;
|
||||
static const uint8_t VBAT_SENSE = 2;
|
||||
static const uint8_t VBUS_SENSE = 34;
|
||||
|
||||
// User LED
|
||||
#define LED_BUILTIN 13
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
|
||||
static const uint8_t RGB_DATA = 40;
|
||||
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
|
||||
#define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT)
|
||||
|
||||
@@ -24,6 +24,9 @@ static const uint8_t SCK = 13;
|
||||
#define SPI_MISO (10)
|
||||
#define SPI_CS (12)
|
||||
|
||||
// LEDs
|
||||
#define LED_BUILTIN LED_GREEN
|
||||
|
||||
#ifdef _VARIANT_RAK3112_
|
||||
/*
|
||||
* Serial interfaces
|
||||
|
||||
@@ -22,4 +22,7 @@ static const uint8_t SCK = 13;
|
||||
#define SPI_MISO (10)
|
||||
#define SPI_CS (12)
|
||||
|
||||
// LEDs
|
||||
#define LED_BUILTIN LED_GREEN
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// static const uint8_t LED_BUILTIN = -1;
|
||||
|
||||
// static const uint8_t TX = 43;
|
||||
// static const uint8_t RX = 44;
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x1001
|
||||
|
||||
// static const uint8_t LED_BUILTIN = -1;
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// static const uint8_t LED_BUILTIN = -1;
|
||||
|
||||
// static const uint8_t TX = 43;
|
||||
// static const uint8_t RX = 44;
|
||||
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x1001
|
||||
|
||||
static const uint8_t LED_BUILTIN = 18;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x1001
|
||||
|
||||
static const uint8_t LED_BUILTIN = 18;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x1001
|
||||
|
||||
static const uint8_t LED_BUILTIN = 18;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
#define USB_VID 0x16D0
|
||||
#define USB_PID 0x1178
|
||||
|
||||
#define LED_BUILTIN 13
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ extern "C" {
|
||||
#define RGBLED_BLUE (0 + 12) // Blue of RGB P0.12
|
||||
#define RGBLED_CA // comment out this line if you have a common cathode type, as defined use common anode logic
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -55,6 +55,7 @@ extern "C" {
|
||||
#define LED_RED PIN_LED3
|
||||
#define LED_BLUE PIN_LED1
|
||||
#define LED_GREEN PIN_LED2
|
||||
#define LED_BUILTIN LED_BLUE
|
||||
#define LED_CONN PIN_GREEN
|
||||
#define LED_STATE_ON 0 // State when LED is lit // LED灯亮时的状态
|
||||
#define PIN_BUZZER (0 + 6)
|
||||
@@ -158,8 +159,6 @@ External serial flash WP25R1635FZUIL0
|
||||
#define PIN_SERIAL1_TX GPS_TX_PIN
|
||||
#define PIN_SERIAL1_RX GPS_RX_PIN
|
||||
|
||||
#define SERIAL_PRINT_PORT 0
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
|
||||
@@ -58,6 +58,7 @@ extern "C" {
|
||||
#define LED_BLUE 37
|
||||
#define LED_PAIRING LED_BLUE // Signals the Status LED Module to handle this LED
|
||||
|
||||
#define LED_BUILTIN -1
|
||||
#define LED_STATE_ON LOW
|
||||
#define LED_STATE_OFF HIGH
|
||||
|
||||
@@ -112,8 +113,6 @@ extern "C" {
|
||||
#define LR11X0_DIO3_TCXO_VOLTAGE 3.3
|
||||
#define LR11X0_DIO_AS_RF_SWITCH
|
||||
|
||||
#define SERIAL_PRINT_PORT 0
|
||||
|
||||
// PCF8563 RTC Module
|
||||
// REVISIT https://github.com/meshtastic/firmware/pull/9084
|
||||
// #define PCF8563_RTC 0x51
|
||||
|
||||
@@ -40,6 +40,7 @@ extern "C" {
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
// LEDs
|
||||
#define LED_BUILTIN -1
|
||||
#define LED_BLUE -1
|
||||
#define PIN_LED2 (32 + 9)
|
||||
#define LED_PAIRING (13)
|
||||
@@ -134,8 +135,6 @@ static const uint8_t A0 = PIN_A0;
|
||||
#define PIN_SERIAL1_RX GPS_RX_PIN
|
||||
#define PIN_SERIAL1_TX GPS_TX_PIN
|
||||
|
||||
#define SERIAL_PRINT_PORT 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -40,6 +40,7 @@ extern "C" {
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
// LEDs
|
||||
#define LED_BUILTIN -1
|
||||
#define LED_BLUE -1
|
||||
#define LED_CHARGE (12)
|
||||
#define LED_PAIRING (7)
|
||||
|
||||
@@ -51,6 +51,7 @@ extern "C" {
|
||||
#define PIN_LED1 (32 + 7) // P1.07 Blue D2
|
||||
|
||||
#define LED_PIN PIN_LED1
|
||||
#define LED_BUILTIN -1
|
||||
|
||||
#define LED_BLUE -1
|
||||
#define LED_STATE_ON 1 // State when LED is lit
|
||||
|
||||
@@ -51,6 +51,7 @@ extern "C" {
|
||||
#define PIN_LED1 (32 + 7) // P1.07 Blue D2
|
||||
|
||||
#define LED_PIN PIN_LED1
|
||||
#define LED_BUILTIN -1
|
||||
|
||||
#define LED_BLUE -1
|
||||
#define LED_STATE_ON 1 // State when LED is lit
|
||||
|
||||
@@ -51,6 +51,7 @@ extern "C" {
|
||||
#define PIN_LED1 (-1)
|
||||
|
||||
#define LED_PIN PIN_LED1
|
||||
#define LED_BUILTIN -1
|
||||
|
||||
#define LED_BLUE -1
|
||||
#define LED_STATE_ON 1 // State when LED is lit
|
||||
|
||||
@@ -29,6 +29,7 @@ extern "C" {
|
||||
#define PIN_LED1 (32 + 10) // LED P1.15
|
||||
#define PIN_LED2 (-1) //
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -29,6 +29,7 @@ extern "C" {
|
||||
#define PIN_LED1 (32 + 10) // LED P1.15
|
||||
#define PIN_LED2 (-1) //
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -34,6 +34,7 @@ extern "C" {
|
||||
// #define PIN_LED1 (32 + 9) Green
|
||||
// #define PIN_LED1 (0 + 12) Blue
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -52,6 +52,7 @@ extern "C" {
|
||||
|
||||
#define LED_BLUE PIN_LED1
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED3
|
||||
|
||||
#define LED_STATE_ON 0 // State when LED is lit
|
||||
@@ -169,8 +170,6 @@ static const uint8_t A0 = PIN_A0;
|
||||
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
||||
#define ADC_MULTIPLIER (2.0F)
|
||||
|
||||
#define SERIAL_PRINT_PORT 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -81,6 +81,7 @@ NRF52 PRO MICRO PIN ASSIGNMENT
|
||||
|
||||
// LED
|
||||
#define PIN_LED1 (0 + 15) // P0.15
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
// Actually red
|
||||
#define LED_BLUE PIN_LED1
|
||||
#define LED_STATE_ON 1 // State when LED is lit
|
||||
|
||||
@@ -38,6 +38,7 @@ extern "C" {
|
||||
#define PIN_LED PIN_LED1
|
||||
#define LED_PWR (PINS_COUNT)
|
||||
|
||||
#define LED_BUILTIN PIN_LED
|
||||
#define LED_STATE_ON 1 // State when LED is lit
|
||||
|
||||
// XIAO Wio-SX1262 Shield User button
|
||||
|
||||
@@ -44,6 +44,7 @@ extern "C" {
|
||||
|
||||
// LED
|
||||
#define PIN_LED1 (0 + 15)
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
// Actually red
|
||||
#define LED_BLUE PIN_LED1
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
@@ -49,6 +49,8 @@ extern "C" {
|
||||
#define PIN_LED1 (32 + 15) // P1.15 3
|
||||
#define PIN_LED2 (32 + 10) // P1.10 4
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
|
||||
#define LED_GREEN PIN_LED2 // Actually red
|
||||
#define LED_BLUE PIN_LED1
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ extern "C" {
|
||||
#define PIN_LED1 (35)
|
||||
#define PIN_LED2 (36)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -30,6 +30,7 @@ extern "C" {
|
||||
#define PIN_LED1 (32 + 3) // green (confirmed on 1.0 board)
|
||||
#define LED_BLUE PIN_LED1 // fake for bluefruit library
|
||||
#define LED_GREEN PIN_LED1
|
||||
#define LED_BUILTIN LED_GREEN
|
||||
#define LED_STATE_ON 0 // State when LED is lit
|
||||
|
||||
#define HAS_NEOPIXEL // Enable the use of neopixels
|
||||
|
||||
@@ -74,6 +74,7 @@ extern "C" {
|
||||
#define PIN_LED1 (32 + 3) // green (confirmed on 1.0 board)
|
||||
#define LED_BLUE PIN_LED1 // fake for bluefruit library
|
||||
#define LED_GREEN PIN_LED1
|
||||
#define LED_BUILTIN LED_GREEN
|
||||
#define LED_STATE_ON 0 // State when LED is lit
|
||||
|
||||
#define HAS_NEOPIXEL // Enable the use of neopixels
|
||||
|
||||
@@ -26,6 +26,7 @@ extern "C" {
|
||||
#define LED_RED PIN_LED1
|
||||
#define LED_BLUE PIN_LED1
|
||||
#define LED_GREEN PIN_LED1
|
||||
#define LED_BUILTIN LED_BLUE
|
||||
#define LED_CONN LED_BLUE
|
||||
#define LED_STATE_ON 0 // State when LED is lit
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ extern "C" {
|
||||
#define PIN_LED1 (0 + 4) // green (confirmed on 1.0 board)
|
||||
#define LED_BLUE PIN_LED1 // fake for bluefruit library
|
||||
#define LED_GREEN PIN_LED1
|
||||
#define LED_BUILTIN LED_GREEN
|
||||
#define LED_STATE_ON 0 // State when LED is lit
|
||||
|
||||
#define HAS_NEOPIXEL // Enable the use of neopixels
|
||||
@@ -141,8 +142,6 @@ No longer populated on PCB
|
||||
#define BQ4050_SCL_PIN (32 + 0) // I2C clock line pin
|
||||
#define BQ4050_EMERGENCY_SHUTDOWN_PIN (32 + 3) // Emergency shutdown pin
|
||||
|
||||
#define SERIAL_PRINT_PORT 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -31,6 +31,7 @@ extern "C" {
|
||||
// LEDs
|
||||
#define PIN_LED1 (24) // Built in white led for status
|
||||
#define LED_BLUE PIN_LED1
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
|
||||
#define LED_STATE_ON 0 // State when LED is litted
|
||||
#define LED_INVERTED 1
|
||||
@@ -53,7 +54,6 @@ extern "C" {
|
||||
*/
|
||||
#define PIN_SERIAL1_RX (32 + 8)
|
||||
#define PIN_SERIAL1_TX (7)
|
||||
#define SERIAL_PRINT_PORT 0
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
|
||||
@@ -49,6 +49,7 @@ extern "C" {
|
||||
#define PIN_LED1 (35)
|
||||
#define PIN_LED2 (36)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -52,6 +52,7 @@ extern "C" {
|
||||
#define PIN_LED1 (35)
|
||||
#define PIN_LED2 (36) // Connected to WWAN host LED (if present)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -45,6 +45,7 @@ extern "C" {
|
||||
#define PIN_LED1 (32 + 3) // P1.03, Green
|
||||
#define PIN_LED2 (32 + 4) // P1.04, Blue
|
||||
|
||||
#define LED_BUILTIN -1 // PIN_LED1
|
||||
#define LED_BLUE PIN_LED2
|
||||
#define LED_STATE_ON 0 // State when LED is lit
|
||||
|
||||
@@ -175,8 +176,6 @@ extern "C" {
|
||||
#define EXTERNAL_FLASH_DEVICES W25Q32JVSS
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
#define SERIAL_PRINT_PORT 0
|
||||
|
||||
// NFC is disabled via CONFIG_NFCT_PINS_AS_GPIOS=1 build flag
|
||||
// This configures P0.09 and P0.10 as regular GPIO pins instead of NFC pins
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ extern "C" {
|
||||
#define LED_BLUE PIN_LED1
|
||||
#define LED_GREEN PIN_LED2
|
||||
|
||||
#define LED_BUILTIN LED_BLUE
|
||||
#define LED_CONN PIN_GREEN
|
||||
|
||||
#define LED_STATE_ON 0 // State when LED is lit
|
||||
|
||||
@@ -47,6 +47,7 @@ extern "C" {
|
||||
#define PIN_LED1 (32 + 4) // P1.04 Controls Green LED
|
||||
#define PIN_LED2 (28) // P0.28 Controls Blue LED
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -48,6 +48,7 @@ extern "C" {
|
||||
#define PIN_LED1 (35)
|
||||
#define PIN_LED2 (36)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -47,6 +47,7 @@ extern "C" {
|
||||
#define PIN_LED1 (35)
|
||||
#define PIN_LED2 (36)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -47,6 +47,7 @@ extern "C" {
|
||||
#define PIN_LED1 (35)
|
||||
#define PIN_LED2 (36)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -47,6 +47,7 @@ extern "C" {
|
||||
#define PIN_LED1 (35)
|
||||
#define PIN_LED2 (36)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -29,6 +29,7 @@ extern "C" {
|
||||
#define PIN_LED1 (35)
|
||||
#define PIN_LED2 (36)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -47,6 +47,7 @@ extern "C" {
|
||||
#define PIN_LED1 (35)
|
||||
#define PIN_LED2 (36)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -47,6 +47,7 @@ extern "C" {
|
||||
#define PIN_LED1 (35)
|
||||
#define PIN_LED2 (36)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -47,6 +47,7 @@ extern "C" {
|
||||
#define PIN_LED1 (35)
|
||||
#define PIN_LED2 (36)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -47,6 +47,7 @@ extern "C" {
|
||||
#define PIN_LED1 (35)
|
||||
#define PIN_LED2 (36)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#define PIN_LED1 (12) // LED P1.15
|
||||
#define PIN_LED2 (11) //
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#define PIN_LED1 (11) // LED P1.15
|
||||
#define PIN_LED2 (12) //
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#define PIN_LED1 (11) // LED P1.15
|
||||
#define PIN_LED2 (12) //
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
|
||||
@@ -69,6 +69,8 @@ static const uint8_t A5 = PIN_A5;
|
||||
#define PIN_LED2 LED_BLUE
|
||||
#define PIN_LED3 LED_RED
|
||||
|
||||
#define LED_BUILTIN LED_RED // LED_BUILTIN is used by framework-arduinoadafruitnrf52 to indicate flash writes
|
||||
|
||||
#define LED_PWR LED_RED
|
||||
#define USER_LED LED_BLUE
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ extern "C" {
|
||||
|
||||
#define BLE_LED LED_BLUE
|
||||
#define BLE_LED_INVERTED 1
|
||||
#define LED_BUILTIN LED_GREEN
|
||||
#define LED_CONN LED_GREEN
|
||||
#define LED_STATE_ON 0 // State when LED is lit
|
||||
|
||||
@@ -170,8 +171,6 @@ static const uint8_t A0 = PIN_A0;
|
||||
#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
||||
#define ADC_MULTIPLIER (2.0F)
|
||||
|
||||
#define SERIAL_PRINT_PORT 0
|
||||
|
||||
// #define NO_EXT_GPIO 1
|
||||
// PINs back side
|
||||
// Batt & solar connector left up corner
|
||||
|
||||
@@ -25,6 +25,7 @@ extern "C" {
|
||||
#define LED_BLUE PIN_LED1
|
||||
#define LED_GREEN PIN_LED2
|
||||
|
||||
#define LED_BUILTIN LED_BLUE
|
||||
#define LED_CONN LED_GREEN
|
||||
|
||||
#define LED_STATE_ON 0
|
||||
@@ -137,8 +138,6 @@ static const uint8_t A0 = PIN_A0;
|
||||
// Battery / ADC already defined above
|
||||
#define HAS_RTC 1
|
||||
|
||||
#define SERIAL_PRINT_PORT 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -52,6 +52,7 @@ extern "C" {
|
||||
#define LED_BLUE PIN_LED1
|
||||
#define LED_GREEN PIN_LED2
|
||||
|
||||
#define LED_BUILTIN LED_BLUE
|
||||
#define LED_CONN PIN_GREEN
|
||||
|
||||
#define LED_STATE_ON 0 // State when LED is lit
|
||||
@@ -87,7 +88,6 @@ static const uint8_t A0 = PIN_A0;
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
#define SERIAL_PRINT_PORT 0
|
||||
|
||||
/*
|
||||
No longer populated on PCB
|
||||
|
||||
@@ -48,6 +48,7 @@ extern "C" {
|
||||
|
||||
#define PIN_LED1 (0 + 24) // P0.24
|
||||
#define LED_PIN PIN_LED1
|
||||
#define LED_BUILTIN -1
|
||||
#define LED_BLUE -1 // Actually green
|
||||
#define LED_STATE_ON 1 // State when LED is lit
|
||||
|
||||
|
||||
@@ -58,6 +58,8 @@ extern "C" {
|
||||
#define PIN_LED1 (0 + 13) // P0.13
|
||||
#define PIN_LED2 (0 + 14) // P0.14
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
#define LED_BLUE PIN_LED2 // Actually red
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ extern "C" {
|
||||
|
||||
#define PIN_LED1 (0 + 24) // P0.24
|
||||
#define LED_PIN PIN_LED1
|
||||
#define LED_BUILTIN -1
|
||||
#define LED_BLUE -1 // Actually green
|
||||
#define LED_STATE_ON 1 // State when LED is lit
|
||||
|
||||
|
||||
@@ -54,6 +54,8 @@ extern "C" {
|
||||
#define PIN_LED1 (0 + 6) // P0.06
|
||||
#define PIN_LED2 (PINS_COUNT) // P0.14
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
|
||||
#define LED_GREEN PIN_LED1
|
||||
#define LED_BLUE PIN_LED2
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
#define SPI_HOWMANY (2u)
|
||||
#define WIRE_HOWMANY (1u)
|
||||
|
||||
#define LED_BUILTIN PIN_LED
|
||||
|
||||
static const uint8_t D0 = (16u);
|
||||
static const uint8_t D1 = (17u);
|
||||
static const uint8_t D2 = (20u);
|
||||
|
||||
@@ -26,6 +26,7 @@ static const uint8_t A3 = PIN_A3;
|
||||
#define PIN_LED (23u)
|
||||
#define PIN_LED1 PIN_LED
|
||||
#define PIN_LED2 (24u)
|
||||
#define LED_BUILTIN PIN_LED
|
||||
|
||||
#define ADC_RESOLUTION 12
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#define I2C_SCL1 3
|
||||
|
||||
#define LED_CONN PIN_LED2
|
||||
#define LED_PIN PIN_LED
|
||||
#define LED_PIN LED_BUILTIN
|
||||
#define ledOff(pin) pinMode(pin, INPUT)
|
||||
|
||||
#define BUTTON_PIN 9
|
||||
|
||||
@@ -22,7 +22,6 @@ build_flags =
|
||||
-D HW_SPI1_DEVICE
|
||||
-D HAS_UDP_MULTICAST=1
|
||||
-fexceptions # for exception handling in MQTT
|
||||
-ULED_BUILTIN
|
||||
build_src_filter = ${rp2040_base.build_src_filter} +<mesh/wifi/>
|
||||
lib_deps =
|
||||
${rp2040_base.lib_deps}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#define EXT_NOTIFY_OUT 22
|
||||
#define BUTTON_PIN 17
|
||||
|
||||
#define LED_PIN PIN_LED
|
||||
#define LED_PIN LED_BUILTIN
|
||||
|
||||
#define BATTERY_PIN 26
|
||||
// ratio of voltage divider = 3.0 (R17=200k, R18=100k)
|
||||
|
||||
@@ -13,6 +13,7 @@ static const uint8_t A3 = PIN_A3;
|
||||
// LEDs
|
||||
#define PIN_LED (23u)
|
||||
#define PIN_LED1 PIN_LED
|
||||
#define LED_BUILTIN PIN_LED
|
||||
|
||||
#define ADC_RESOLUTION 12
|
||||
|
||||
|
||||
@@ -19,7 +19,5 @@ Do not expect a working Meshtastic device with this target.
|
||||
// #define LED_PIN PB3 // LED2
|
||||
#define LED_STATE_ON 1
|
||||
|
||||
#define SERIAL_PRINT_PORT 1
|
||||
|
||||
#define EBYTE_E77_MBL
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user