mirror of
https://github.com/meshtastic/firmware.git
synced 2026-02-09 02:22:13 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73adeee385 | ||
|
|
4ce554e09d | ||
|
|
eb145f8adc | ||
|
|
a60e7cfe62 | ||
|
|
39139cc2ea | ||
|
|
4a4b1f4a87 | ||
|
|
779e446d14 | ||
|
|
2361776992 | ||
|
|
94b7149958 | ||
|
|
ac611c4b62 |
@@ -59,8 +59,14 @@ BuildRequires: pkgconfig(libbsd-overlay)
|
|||||||
|
|
||||||
Requires: systemd-udev
|
Requires: systemd-udev
|
||||||
|
|
||||||
|
# Declare that this package provides the user/group it creates in %pre
|
||||||
|
# Required for Fedora 43+ which tracks users/groups as RPM dependencies
|
||||||
|
Provides: user(%{meshtasticd_user})
|
||||||
|
Provides: group(%{meshtasticd_user})
|
||||||
|
Provides: group(spi)
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Meshtastic daemon for controlling Meshtastic devices. Meshtastic is an off-grid
|
Meshtastic daemon. Meshtastic is an off-grid
|
||||||
text communication platform that uses inexpensive LoRa radios.
|
text communication platform that uses inexpensive LoRa radios.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
@@ -151,6 +157,7 @@ fi
|
|||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%{_bindir}/meshtasticd
|
%{_bindir}/meshtasticd
|
||||||
|
%{_bindir}/meshtasticd-start.sh
|
||||||
%dir %{_localstatedir}/lib/meshtasticd
|
%dir %{_localstatedir}/lib/meshtasticd
|
||||||
%{_udevrulesdir}/99-meshtasticd-udev.rules
|
%{_udevrulesdir}/99-meshtasticd-udev.rules
|
||||||
%dir %{_sysconfdir}/meshtasticd
|
%dir %{_sysconfdir}/meshtasticd
|
||||||
|
|||||||
66
src/Led.cpp
66
src/Led.cpp
@@ -1,66 +0,0 @@
|
|||||||
#include "Led.h"
|
|
||||||
#include "PowerMon.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "power.h"
|
|
||||||
|
|
||||||
GpioVirtPin ledForceOn, ledBlink;
|
|
||||||
|
|
||||||
#if defined(LED_PIN)
|
|
||||||
// Most boards have a GPIO for LED control
|
|
||||||
static GpioHwPin ledRawHwPin(LED_PIN);
|
|
||||||
#else
|
|
||||||
static GpioVirtPin ledRawHwPin; // Dummy pin for no hardware
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LED_STATE_ON == 0
|
|
||||||
static GpioVirtPin ledHwPin;
|
|
||||||
static GpioNotTransformer ledInverter(&ledHwPin, &ledRawHwPin);
|
|
||||||
#else
|
|
||||||
static GpioPin &ledHwPin = ledRawHwPin;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(HAS_PMU)
|
|
||||||
/**
|
|
||||||
* A GPIO controlled by the PMU
|
|
||||||
*/
|
|
||||||
class GpioPmuPin : public GpioPin
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void set(bool value)
|
|
||||||
{
|
|
||||||
if (pmu_found && PMU) {
|
|
||||||
// blink the axp led
|
|
||||||
PMU->setChargingLedMode(value ? XPOWERS_CHG_LED_ON : XPOWERS_CHG_LED_OFF);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} ledPmuHwPin;
|
|
||||||
|
|
||||||
// In some cases we need to drive a PMU LED and a normal LED
|
|
||||||
static GpioSplitter ledFinalPin(&ledHwPin, &ledPmuHwPin);
|
|
||||||
#else
|
|
||||||
static GpioPin &ledFinalPin = ledHwPin;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_POWERMON
|
|
||||||
/**
|
|
||||||
* We monitor changes to the LED drive output because we use that as a sanity test in our power monitor stuff.
|
|
||||||
*/
|
|
||||||
class MonitoredLedPin : public GpioPin
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void set(bool value)
|
|
||||||
{
|
|
||||||
if (powerMon) {
|
|
||||||
if (value)
|
|
||||||
powerMon->setState(meshtastic_PowerMon_State_LED_On);
|
|
||||||
else
|
|
||||||
powerMon->clearState(meshtastic_PowerMon_State_LED_On);
|
|
||||||
}
|
|
||||||
ledFinalPin.set(value);
|
|
||||||
}
|
|
||||||
} monitoredLedPin;
|
|
||||||
#else
|
|
||||||
static GpioPin &monitoredLedPin = ledFinalPin;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static GpioBinaryTransformer ledForcer(&ledForceOn, &ledBlink, &monitoredLedPin, GpioBinaryTransformer::Or);
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#include "GpioLogic.h"
|
|
||||||
#include "configuration.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ledForceOn and ledForceOff both override the normal ledBlinker behavior (which is controlled by main)
|
|
||||||
*/
|
|
||||||
extern GpioVirtPin ledForceOn, ledBlink;
|
|
||||||
@@ -692,7 +692,9 @@ bool Power::setup()
|
|||||||
bool found = false;
|
bool found = false;
|
||||||
if (axpChipInit()) {
|
if (axpChipInit()) {
|
||||||
found = true;
|
found = true;
|
||||||
} else if (lipoInit()) {
|
} else if (cw2015Init()) {
|
||||||
|
found = true;
|
||||||
|
} else if (max17048Init()) {
|
||||||
found = true;
|
found = true;
|
||||||
} else if (lipoChargerInit()) {
|
} else if (lipoChargerInit()) {
|
||||||
found = true;
|
found = true;
|
||||||
@@ -1321,7 +1323,7 @@ bool Power::axpChipInit()
|
|||||||
/**
|
/**
|
||||||
* Wrapper class for an I2C MAX17048 Lipo battery sensor.
|
* Wrapper class for an I2C MAX17048 Lipo battery sensor.
|
||||||
*/
|
*/
|
||||||
class LipoBatteryLevel : public HasBatteryLevel
|
class MAX17048BatteryLevel : public HasBatteryLevel
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
MAX17048Singleton *max17048 = nullptr;
|
MAX17048Singleton *max17048 = nullptr;
|
||||||
@@ -1369,18 +1371,18 @@ class LipoBatteryLevel : public HasBatteryLevel
|
|||||||
virtual bool isCharging() override { return max17048->isBatteryCharging(); }
|
virtual bool isCharging() override { return max17048->isBatteryCharging(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
LipoBatteryLevel lipoLevel;
|
MAX17048BatteryLevel max17048Level;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init the Lipo battery level sensor
|
* Init the Lipo battery level sensor
|
||||||
*/
|
*/
|
||||||
bool Power::lipoInit()
|
bool Power::max17048Init()
|
||||||
{
|
{
|
||||||
bool result = lipoLevel.runOnce();
|
bool result = max17048Level.runOnce();
|
||||||
LOG_DEBUG("Power::lipoInit lipo sensor is %s", result ? "ready" : "not ready yet");
|
LOG_DEBUG("Power::max17048Init lipo sensor is %s", result ? "ready" : "not ready yet");
|
||||||
if (!result)
|
if (!result)
|
||||||
return false;
|
return false;
|
||||||
batteryLevel = &lipoLevel;
|
batteryLevel = &max17048Level;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1388,7 +1390,88 @@ bool Power::lipoInit()
|
|||||||
/**
|
/**
|
||||||
* The Lipo battery level sensor is unavailable - default to AnalogBatteryLevel
|
* The Lipo battery level sensor is unavailable - default to AnalogBatteryLevel
|
||||||
*/
|
*/
|
||||||
bool Power::lipoInit()
|
bool Power::max17048Init()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !MESHTASTIC_EXCLUDE_I2C && HAS_CW2015
|
||||||
|
|
||||||
|
class CW2015BatteryLevel : public AnalogBatteryLevel
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Battery state of charge, from 0 to 100 or -1 for unknown
|
||||||
|
*/
|
||||||
|
virtual int getBatteryPercent() override
|
||||||
|
{
|
||||||
|
int data = -1;
|
||||||
|
Wire.beginTransmission(CW2015_ADDR);
|
||||||
|
Wire.write(0x04);
|
||||||
|
if (Wire.endTransmission() == 0) {
|
||||||
|
if (Wire.requestFrom(CW2015_ADDR, (uint8_t)1)) {
|
||||||
|
data = Wire.read();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The raw voltage of the battery in millivolts, or NAN if unknown
|
||||||
|
*/
|
||||||
|
virtual uint16_t getBattVoltage() override
|
||||||
|
{
|
||||||
|
uint16_t mv = 0;
|
||||||
|
Wire.beginTransmission(CW2015_ADDR);
|
||||||
|
Wire.write(0x02);
|
||||||
|
if (Wire.endTransmission() == 0) {
|
||||||
|
if (Wire.requestFrom(CW2015_ADDR, (uint8_t)2)) {
|
||||||
|
mv = Wire.read();
|
||||||
|
mv <<= 8;
|
||||||
|
mv |= Wire.read();
|
||||||
|
// Voltage is read in 305uV units, convert to mV
|
||||||
|
mv = mv * 305 / 1000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mv;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
CW2015BatteryLevel cw2015Level;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Init the CW2015 battery level sensor
|
||||||
|
*/
|
||||||
|
bool Power::cw2015Init()
|
||||||
|
{
|
||||||
|
|
||||||
|
Wire.beginTransmission(CW2015_ADDR);
|
||||||
|
uint8_t getInfo[] = {0x0a, 0x00};
|
||||||
|
Wire.write(getInfo, 2);
|
||||||
|
Wire.endTransmission();
|
||||||
|
delay(10);
|
||||||
|
Wire.beginTransmission(CW2015_ADDR);
|
||||||
|
Wire.write(0x00);
|
||||||
|
bool result = false;
|
||||||
|
if (Wire.endTransmission() == 0) {
|
||||||
|
if (Wire.requestFrom(CW2015_ADDR, (uint8_t)1)) {
|
||||||
|
uint8_t data = Wire.read();
|
||||||
|
LOG_DEBUG("CW2015 init read data: 0x%x", data);
|
||||||
|
if (data == 0x73) {
|
||||||
|
result = true;
|
||||||
|
batteryLevel = &cw2015Level;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
/**
|
||||||
|
* The CW2015 battery level sensor is unavailable - default to AnalogBatteryLevel
|
||||||
|
*/
|
||||||
|
bool Power::cw2015Init()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,13 +9,13 @@
|
|||||||
*/
|
*/
|
||||||
#include "PowerFSM.h"
|
#include "PowerFSM.h"
|
||||||
#include "Default.h"
|
#include "Default.h"
|
||||||
#include "Led.h"
|
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "PowerMon.h"
|
#include "PowerMon.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "graphics/Screen.h"
|
#include "graphics/Screen.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "modules/StatusLEDModule.h"
|
||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
#include "target_specific.h"
|
#include "target_specific.h"
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ static void lsIdle()
|
|||||||
uint32_t sleepTime = SLEEP_TIME;
|
uint32_t sleepTime = SLEEP_TIME;
|
||||||
|
|
||||||
powerMon->setState(meshtastic_PowerMon_State_CPU_LightSleep);
|
powerMon->setState(meshtastic_PowerMon_State_CPU_LightSleep);
|
||||||
ledBlink.set(false); // Never leave led on while in light sleep
|
statusLEDModule->setPowerLED(false);
|
||||||
esp_sleep_source_t wakeCause2 = doLightSleep(sleepTime * 1000LL);
|
esp_sleep_source_t wakeCause2 = doLightSleep(sleepTime * 1000LL);
|
||||||
powerMon->clearState(meshtastic_PowerMon_State_CPU_LightSleep);
|
powerMon->clearState(meshtastic_PowerMon_State_CPU_LightSleep);
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ static void lsIdle()
|
|||||||
case ESP_SLEEP_WAKEUP_TIMER:
|
case ESP_SLEEP_WAKEUP_TIMER:
|
||||||
// Normal case: timer expired, we should just go back to sleep ASAP
|
// Normal case: timer expired, we should just go back to sleep ASAP
|
||||||
|
|
||||||
ledBlink.set(true); // briefly turn on led
|
statusLEDModule->setPowerLED(true);
|
||||||
wakeCause2 = doLightSleep(100); // leave led on for 1ms
|
wakeCause2 = doLightSleep(100); // leave led on for 1ms
|
||||||
|
|
||||||
secsSlept += sleepTime;
|
secsSlept += sleepTime;
|
||||||
@@ -146,7 +146,7 @@ static void lsIdle()
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Time to stop sleeping!
|
// Time to stop sleeping!
|
||||||
ledBlink.set(false);
|
statusLEDModule->setPowerLED(false);
|
||||||
LOG_INFO("Reached ls_secs, service loop()");
|
LOG_INFO("Reached ls_secs, service loop()");
|
||||||
powerFSM.trigger(EVENT_WAKE_TIMER);
|
powerFSM.trigger(EVENT_WAKE_TIMER);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -233,6 +233,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define NAU7802_ADDR 0x2A
|
#define NAU7802_ADDR 0x2A
|
||||||
#define MAX30102_ADDR 0x57
|
#define MAX30102_ADDR 0x57
|
||||||
#define SCD4X_ADDR 0x62
|
#define SCD4X_ADDR 0x62
|
||||||
|
#define CW2015_ADDR 0x62
|
||||||
#define MLX90614_ADDR_DEF 0x5A
|
#define MLX90614_ADDR_DEF 0x5A
|
||||||
#define CGRADSENS_ADDR 0x66
|
#define CGRADSENS_ADDR 0x66
|
||||||
#define LTR390UV_ADDR 0x53
|
#define LTR390UV_ADDR 0x53
|
||||||
|
|||||||
@@ -88,7 +88,8 @@ class ScanI2C
|
|||||||
BH1750,
|
BH1750,
|
||||||
DA217,
|
DA217,
|
||||||
CHSC6X,
|
CHSC6X,
|
||||||
CST226SE
|
CST226SE,
|
||||||
|
CW2015
|
||||||
} DeviceType;
|
} DeviceType;
|
||||||
|
|
||||||
// typedef uint8_t DeviceAddress;
|
// typedef uint8_t DeviceAddress;
|
||||||
|
|||||||
@@ -541,7 +541,17 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
SCAN_SIMPLE_CASE(BHI260AP_ADDR, BHI260AP, "BHI260AP", (uint8_t)addr.address);
|
SCAN_SIMPLE_CASE(BHI260AP_ADDR, BHI260AP, "BHI260AP", (uint8_t)addr.address);
|
||||||
SCAN_SIMPLE_CASE(SCD4X_ADDR, SCD4X, "SCD4X", (uint8_t)addr.address);
|
case SCD4X_ADDR: {
|
||||||
|
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x8), 1);
|
||||||
|
if (registerValue == 0x18) {
|
||||||
|
logFoundDevice("CW2015", (uint8_t)addr.address);
|
||||||
|
type = CW2015;
|
||||||
|
} else {
|
||||||
|
logFoundDevice("SCD4X", (uint8_t)addr.address);
|
||||||
|
type = SCD4X;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
SCAN_SIMPLE_CASE(BMM150_ADDR, BMM150, "BMM150", (uint8_t)addr.address);
|
SCAN_SIMPLE_CASE(BMM150_ADDR, BMM150, "BMM150", (uint8_t)addr.address);
|
||||||
#ifdef HAS_TPS65233
|
#ifdef HAS_TPS65233
|
||||||
SCAN_SIMPLE_CASE(TPS65233_ADDR, TPS65233, "TPS65233", (uint8_t)addr.address);
|
SCAN_SIMPLE_CASE(TPS65233_ADDR, TPS65233, "TPS65233", (uint8_t)addr.address);
|
||||||
|
|||||||
@@ -221,7 +221,6 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti
|
|||||||
|
|
||||||
if (rtc_sec > 0) {
|
if (rtc_sec > 0) {
|
||||||
// === Build Time String ===
|
// === Build Time String ===
|
||||||
long hms = (rtc_sec % SEC_PER_DAY + SEC_PER_DAY) % SEC_PER_DAY;
|
|
||||||
int hour, minute, second;
|
int hour, minute, second;
|
||||||
graphics::decomposeTime(rtc_sec, hour, minute, second);
|
graphics::decomposeTime(rtc_sec, hour, minute, second);
|
||||||
snprintf(timeStr, sizeof(timeStr), "%d:%02d", hour, minute);
|
snprintf(timeStr, sizeof(timeStr), "%d:%02d", hour, minute);
|
||||||
|
|||||||
@@ -429,6 +429,10 @@ void VirtualKeyboard::drawKey(OLEDDisplay *display, const VirtualKey &key, bool
|
|||||||
c = c - 'a' + 'A';
|
c = c - 'a' + 'A';
|
||||||
}
|
}
|
||||||
keyText = (key.character == ' ' || key.character == '_') ? "_" : std::string(1, c);
|
keyText = (key.character == ' ' || key.character == '_') ? "_" : std::string(1, c);
|
||||||
|
// Show the common "/" pairing next to "?" like on a real keyboard
|
||||||
|
if (key.type == VK_CHAR && key.character == '?') {
|
||||||
|
keyText = "?/";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int textWidth = display->getStringWidth(keyText.c_str());
|
int textWidth = display->getStringWidth(keyText.c_str());
|
||||||
@@ -518,9 +522,13 @@ char VirtualKeyboard::getCharForKey(const VirtualKey &key, bool isLongPress)
|
|||||||
|
|
||||||
char c = key.character;
|
char c = key.character;
|
||||||
|
|
||||||
// Long-press: only keep letter lowercase->uppercase conversion; remove other symbol mappings
|
// Long-press: letters become uppercase; for "?" provide "/" like a typical keyboard
|
||||||
if (isLongPress && c >= 'a' && c <= 'z') {
|
if (isLongPress) {
|
||||||
c = (char)(c - 'a' + 'A');
|
if (c >= 'a' && c <= 'z') {
|
||||||
|
c = (char)(c - 'a' + 'A');
|
||||||
|
} else if (c == '?') {
|
||||||
|
c = '/';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
|
|||||||
72
src/main.cpp
72
src/main.cpp
@@ -7,13 +7,13 @@
|
|||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "PowerFSM.h"
|
#include "PowerFSM.h"
|
||||||
#include "PowerMon.h"
|
#include "PowerMon.h"
|
||||||
|
#include "RadioLibInterface.h"
|
||||||
#include "ReliableRouter.h"
|
#include "ReliableRouter.h"
|
||||||
#include "airtime.h"
|
#include "airtime.h"
|
||||||
#include "buzz.h"
|
#include "buzz.h"
|
||||||
#include "power/PowerHAL.h"
|
#include "power/PowerHAL.h"
|
||||||
|
|
||||||
#include "FSCommon.h"
|
#include "FSCommon.h"
|
||||||
#include "Led.h"
|
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "SPILock.h"
|
#include "SPILock.h"
|
||||||
#include "Throttle.h"
|
#include "Throttle.h"
|
||||||
@@ -193,6 +193,8 @@ bool kb_found = false;
|
|||||||
// global bool to record that on-screen keyboard (OSK) is present
|
// global bool to record that on-screen keyboard (OSK) is present
|
||||||
bool osk_found = false;
|
bool osk_found = false;
|
||||||
|
|
||||||
|
unsigned long last_listen = 0;
|
||||||
|
|
||||||
// The I2C address of the RTC Module (if found)
|
// The I2C address of the RTC Module (if found)
|
||||||
ScanI2C::DeviceAddress rtc_found = ScanI2C::ADDRESS_NONE;
|
ScanI2C::DeviceAddress rtc_found = ScanI2C::ADDRESS_NONE;
|
||||||
// The I2C address of the Accelerometer (if found)
|
// The I2C address of the Accelerometer (if found)
|
||||||
@@ -242,26 +244,8 @@ const char *getDeviceName()
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO remove from main.cpp
|
|
||||||
static int32_t ledBlinker()
|
|
||||||
{
|
|
||||||
// Still set up the blinking (heartbeat) interval but skip code path below, so LED will blink if
|
|
||||||
// config.device.led_heartbeat_disabled is changed
|
|
||||||
if (config.device.led_heartbeat_disabled)
|
|
||||||
return 1000;
|
|
||||||
|
|
||||||
static bool ledOn;
|
|
||||||
ledOn ^= 1;
|
|
||||||
|
|
||||||
ledBlink.set(ledOn);
|
|
||||||
|
|
||||||
// have a very sparse duty cycle of LED being on, unless charging, then blink 0.5Hz square wave rate to indicate that
|
|
||||||
return powerStatus->getIsCharging() ? 1000 : (ledOn ? 1 : 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t timeLastPowered = 0;
|
uint32_t timeLastPowered = 0;
|
||||||
|
|
||||||
static Periodic *ledPeriodic;
|
|
||||||
static OSThread *powerFSMthread;
|
static OSThread *powerFSMthread;
|
||||||
static OSThread *ambientLightingThread;
|
static OSThread *ambientLightingThread;
|
||||||
|
|
||||||
@@ -299,21 +283,16 @@ void earlyInitVariant() {}
|
|||||||
// blink user led in 3 flashes sequence to indicate what is happening
|
// blink user led in 3 flashes sequence to indicate what is happening
|
||||||
void waitUntilPowerLevelSafe()
|
void waitUntilPowerLevelSafe()
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef LED_PIN
|
|
||||||
pinMode(LED_PIN, OUTPUT);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (powerHAL_isPowerLevelSafe() == false) {
|
while (powerHAL_isPowerLevelSafe() == false) {
|
||||||
|
|
||||||
#ifdef LED_PIN
|
#ifdef LED_POWER
|
||||||
|
|
||||||
// 3x: blink for 300 ms, pause for 300 ms
|
// 3x: blink for 300 ms, pause for 300 ms
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
digitalWrite(LED_PIN, LED_STATE_ON);
|
digitalWrite(LED_POWER, LED_STATE_ON);
|
||||||
delay(300);
|
delay(300);
|
||||||
digitalWrite(LED_PIN, LED_STATE_OFF);
|
digitalWrite(LED_POWER, LED_STATE_OFF);
|
||||||
delay(300);
|
delay(300);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -337,6 +316,11 @@ void setup()
|
|||||||
// initialize power HAL layer as early as possible
|
// initialize power HAL layer as early as possible
|
||||||
powerHAL_init();
|
powerHAL_init();
|
||||||
|
|
||||||
|
#ifdef LED_POWER
|
||||||
|
pinMode(LED_POWER, OUTPUT);
|
||||||
|
digitalWrite(LED_POWER, LED_STATE_ON);
|
||||||
|
#endif
|
||||||
|
|
||||||
// prevent booting if device is in power failure mode
|
// prevent booting if device is in power failure mode
|
||||||
// boot sequence will follow when battery level raises to safe mode
|
// boot sequence will follow when battery level raises to safe mode
|
||||||
waitUntilPowerLevelSafe();
|
waitUntilPowerLevelSafe();
|
||||||
@@ -349,11 +333,6 @@ void setup()
|
|||||||
digitalWrite(PIN_POWER_EN, HIGH);
|
digitalWrite(PIN_POWER_EN, HIGH);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LED_POWER
|
|
||||||
pinMode(LED_POWER, OUTPUT);
|
|
||||||
digitalWrite(LED_POWER, LED_STATE_ON);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef LED_NOTIFICATION
|
#ifdef LED_NOTIFICATION
|
||||||
pinMode(LED_NOTIFICATION, OUTPUT);
|
pinMode(LED_NOTIFICATION, OUTPUT);
|
||||||
digitalWrite(LED_NOTIFICATION, HIGH ^ LED_STATE_ON);
|
digitalWrite(LED_NOTIFICATION, HIGH ^ LED_STATE_ON);
|
||||||
@@ -484,16 +463,6 @@ void setup()
|
|||||||
|
|
||||||
OSThread::setup();
|
OSThread::setup();
|
||||||
|
|
||||||
// TODO make this ifdef based on defined pins and move from main.cpp
|
|
||||||
#if defined(ELECROW_ThinkNode_M1) || defined(ELECROW_ThinkNode_M2)
|
|
||||||
// The ThinkNodes have their own blink logic
|
|
||||||
// ledPeriodic = new Periodic("Blink", elecrowLedBlinker);
|
|
||||||
#else
|
|
||||||
|
|
||||||
ledPeriodic = new Periodic("Blink", ledBlinker);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
fsInit();
|
fsInit();
|
||||||
|
|
||||||
#if !MESHTASTIC_EXCLUDE_I2C
|
#if !MESHTASTIC_EXCLUDE_I2C
|
||||||
@@ -718,13 +687,6 @@ void setup()
|
|||||||
setupSDCard();
|
setupSDCard();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// LED init
|
|
||||||
|
|
||||||
#ifdef LED_PIN
|
|
||||||
pinMode(LED_PIN, OUTPUT);
|
|
||||||
digitalWrite(LED_PIN, LED_STATE_ON); // turn on for now
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Hello
|
// Hello
|
||||||
printInfo();
|
printInfo();
|
||||||
#ifdef BUILD_EPOCH
|
#ifdef BUILD_EPOCH
|
||||||
@@ -958,12 +920,6 @@ void setup()
|
|||||||
setupNicheGraphics();
|
setupNicheGraphics();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LED_PIN
|
|
||||||
// Turn LED off after boot, if heartbeat by config
|
|
||||||
if (config.device.led_heartbeat_disabled)
|
|
||||||
digitalWrite(LED_PIN, HIGH ^ LED_STATE_ON);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Do this after service.init (because that clears error_code)
|
// Do this after service.init (because that clears error_code)
|
||||||
#ifdef HAS_PMU
|
#ifdef HAS_PMU
|
||||||
if (!pmu_found)
|
if (!pmu_found)
|
||||||
@@ -1166,6 +1122,12 @@ void loop()
|
|||||||
#endif
|
#endif
|
||||||
power->powerCommandsCheck();
|
power->powerCommandsCheck();
|
||||||
|
|
||||||
|
if (RadioLibInterface::instance != nullptr && !Throttle::isWithinTimespanMs(last_listen, 1000 * 60) &&
|
||||||
|
!(RadioLibInterface::instance->isSending() || RadioLibInterface::instance->isActivelyReceiving())) {
|
||||||
|
RadioLibInterface::instance->startReceive();
|
||||||
|
LOG_DEBUG("attempting AGC reset");
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_STACK
|
#ifdef DEBUG_STACK
|
||||||
static uint32_t lastPrint = 0;
|
static uint32_t lastPrint = 0;
|
||||||
if (!Throttle::isWithinTimespanMs(lastPrint, 10 * 1000L)) {
|
if (!Throttle::isWithinTimespanMs(lastPrint, 10 * 1000L)) {
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ extern ScanI2C::DeviceAddress cardkb_found;
|
|||||||
extern uint8_t kb_model;
|
extern uint8_t kb_model;
|
||||||
extern bool kb_found;
|
extern bool kb_found;
|
||||||
extern bool osk_found;
|
extern bool osk_found;
|
||||||
|
extern unsigned long last_listen;
|
||||||
extern ScanI2C::DeviceAddress rtc_found;
|
extern ScanI2C::DeviceAddress rtc_found;
|
||||||
extern ScanI2C::DeviceAddress accelerometer_found;
|
extern ScanI2C::DeviceAddress accelerometer_found;
|
||||||
extern ScanI2C::FoundDevice rgb_found;
|
extern ScanI2C::FoundDevice rgb_found;
|
||||||
|
|||||||
@@ -90,9 +90,9 @@ bool PacketHistory::wasSeenRecently(const meshtastic_MeshPacket *p, bool withUpd
|
|||||||
bool seenRecently = (found != NULL); // If found -> the packet was seen recently
|
bool seenRecently = (found != NULL); // If found -> the packet was seen recently
|
||||||
|
|
||||||
// Check for hop_limit upgrade scenario
|
// Check for hop_limit upgrade scenario
|
||||||
if (seenRecently && wasUpgraded && found->hop_limit < p->hop_limit) {
|
if (seenRecently && wasUpgraded && getHighestHopLimit(*found) < p->hop_limit) {
|
||||||
LOG_DEBUG("Packet History - Hop limit upgrade: packet 0x%08x from hop_limit=%d to hop_limit=%d", p->id, found->hop_limit,
|
LOG_DEBUG("Packet History - Hop limit upgrade: packet 0x%08x from hop_limit=%d to hop_limit=%d", p->id,
|
||||||
p->hop_limit);
|
getHighestHopLimit(*found), p->hop_limit);
|
||||||
*wasUpgraded = true;
|
*wasUpgraded = true;
|
||||||
} else if (wasUpgraded) {
|
} else if (wasUpgraded) {
|
||||||
*wasUpgraded = false; // Initialize to false if not an upgrade
|
*wasUpgraded = false; // Initialize to false if not an upgrade
|
||||||
|
|||||||
@@ -514,6 +514,8 @@ void RadioLibInterface::handleReceiveInterrupt()
|
|||||||
|
|
||||||
void RadioLibInterface::startReceive()
|
void RadioLibInterface::startReceive()
|
||||||
{
|
{
|
||||||
|
// Note the updated timestamp, to avoid unneeded AGC resets
|
||||||
|
last_listen = millis();
|
||||||
isReceiving = true;
|
isReceiving = true;
|
||||||
powerMon->setState(meshtastic_PowerMon_State_Lora_RXOn);
|
powerMon->setState(meshtastic_PowerMon_State_Lora_RXOn);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
#if HAS_WIFI
|
#if HAS_WIFI
|
||||||
#include "mesh/wifi/WiFiAPClient.h"
|
#include "mesh/wifi/WiFiAPClient.h"
|
||||||
#endif
|
#endif
|
||||||
#include "Led.h"
|
|
||||||
#include "SPILock.h"
|
#include "SPILock.h"
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
#include "serialization/JSON.h"
|
#include "serialization/JSON.h"
|
||||||
@@ -92,7 +91,6 @@ void registerHandlers(HTTPServer *insecureServer, HTTPSServer *secureServer)
|
|||||||
ResourceNode *nodeFormUpload = new ResourceNode("/upload", "POST", &handleFormUpload);
|
ResourceNode *nodeFormUpload = new ResourceNode("/upload", "POST", &handleFormUpload);
|
||||||
|
|
||||||
ResourceNode *nodeJsonScanNetworks = new ResourceNode("/json/scanNetworks", "GET", &handleScanNetworks);
|
ResourceNode *nodeJsonScanNetworks = new ResourceNode("/json/scanNetworks", "GET", &handleScanNetworks);
|
||||||
ResourceNode *nodeJsonBlinkLED = new ResourceNode("/json/blink", "POST", &handleBlinkLED);
|
|
||||||
ResourceNode *nodeJsonReport = new ResourceNode("/json/report", "GET", &handleReport);
|
ResourceNode *nodeJsonReport = new ResourceNode("/json/report", "GET", &handleReport);
|
||||||
ResourceNode *nodeJsonNodes = new ResourceNode("/json/nodes", "GET", &handleNodes);
|
ResourceNode *nodeJsonNodes = new ResourceNode("/json/nodes", "GET", &handleNodes);
|
||||||
ResourceNode *nodeJsonFsBrowseStatic = new ResourceNode("/json/fs/browse/static", "GET", &handleFsBrowseStatic);
|
ResourceNode *nodeJsonFsBrowseStatic = new ResourceNode("/json/fs/browse/static", "GET", &handleFsBrowseStatic);
|
||||||
@@ -110,7 +108,6 @@ void registerHandlers(HTTPServer *insecureServer, HTTPSServer *secureServer)
|
|||||||
secureServer->registerNode(nodeRestart);
|
secureServer->registerNode(nodeRestart);
|
||||||
secureServer->registerNode(nodeFormUpload);
|
secureServer->registerNode(nodeFormUpload);
|
||||||
secureServer->registerNode(nodeJsonScanNetworks);
|
secureServer->registerNode(nodeJsonScanNetworks);
|
||||||
secureServer->registerNode(nodeJsonBlinkLED);
|
|
||||||
secureServer->registerNode(nodeJsonFsBrowseStatic);
|
secureServer->registerNode(nodeJsonFsBrowseStatic);
|
||||||
secureServer->registerNode(nodeJsonDelete);
|
secureServer->registerNode(nodeJsonDelete);
|
||||||
secureServer->registerNode(nodeJsonReport);
|
secureServer->registerNode(nodeJsonReport);
|
||||||
@@ -133,7 +130,6 @@ void registerHandlers(HTTPServer *insecureServer, HTTPSServer *secureServer)
|
|||||||
insecureServer->registerNode(nodeRestart);
|
insecureServer->registerNode(nodeRestart);
|
||||||
insecureServer->registerNode(nodeFormUpload);
|
insecureServer->registerNode(nodeFormUpload);
|
||||||
insecureServer->registerNode(nodeJsonScanNetworks);
|
insecureServer->registerNode(nodeJsonScanNetworks);
|
||||||
insecureServer->registerNode(nodeJsonBlinkLED);
|
|
||||||
insecureServer->registerNode(nodeJsonFsBrowseStatic);
|
insecureServer->registerNode(nodeJsonFsBrowseStatic);
|
||||||
insecureServer->registerNode(nodeJsonDelete);
|
insecureServer->registerNode(nodeJsonDelete);
|
||||||
insecureServer->registerNode(nodeJsonReport);
|
insecureServer->registerNode(nodeJsonReport);
|
||||||
@@ -904,45 +900,6 @@ void handleRestart(HTTPRequest *req, HTTPResponse *res)
|
|||||||
webServerThread->requestRestart = (millis() / 1000) + 5;
|
webServerThread->requestRestart = (millis() / 1000) + 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleBlinkLED(HTTPRequest *req, HTTPResponse *res)
|
|
||||||
{
|
|
||||||
res->setHeader("Content-Type", "application/json");
|
|
||||||
res->setHeader("Access-Control-Allow-Origin", "*");
|
|
||||||
res->setHeader("Access-Control-Allow-Methods", "POST");
|
|
||||||
|
|
||||||
ResourceParameters *params = req->getParams();
|
|
||||||
std::string blink_target;
|
|
||||||
|
|
||||||
if (!params->getQueryParameter("blink_target", blink_target)) {
|
|
||||||
// if no blink_target was supplied in the URL parameters of the
|
|
||||||
// POST request, then assume we should blink the LED
|
|
||||||
blink_target = "LED";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (blink_target == "LED") {
|
|
||||||
uint8_t count = 10;
|
|
||||||
while (count > 0) {
|
|
||||||
ledBlink.set(true);
|
|
||||||
delay(50);
|
|
||||||
ledBlink.set(false);
|
|
||||||
delay(50);
|
|
||||||
count = count - 1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
#if HAS_SCREEN
|
|
||||||
if (screen)
|
|
||||||
screen->blink();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
JSONObject jsonObjOuter;
|
|
||||||
jsonObjOuter["status"] = new JSONValue("ok");
|
|
||||||
JSONValue *value = new JSONValue(jsonObjOuter);
|
|
||||||
std::string jsonString = value->Stringify();
|
|
||||||
res->print(jsonString.c_str());
|
|
||||||
delete value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void handleScanNetworks(HTTPRequest *req, HTTPResponse *res)
|
void handleScanNetworks(HTTPRequest *req, HTTPResponse *res)
|
||||||
{
|
{
|
||||||
res->setHeader("Content-Type", "application/json");
|
res->setHeader("Content-Type", "application/json");
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ void handleFormUpload(HTTPRequest *req, HTTPResponse *res);
|
|||||||
void handleScanNetworks(HTTPRequest *req, HTTPResponse *res);
|
void handleScanNetworks(HTTPRequest *req, HTTPResponse *res);
|
||||||
void handleFsBrowseStatic(HTTPRequest *req, HTTPResponse *res);
|
void handleFsBrowseStatic(HTTPRequest *req, HTTPResponse *res);
|
||||||
void handleFsDeleteStatic(HTTPRequest *req, HTTPResponse *res);
|
void handleFsDeleteStatic(HTTPRequest *req, HTTPResponse *res);
|
||||||
void handleBlinkLED(HTTPRequest *req, HTTPResponse *res);
|
|
||||||
void handleReport(HTTPRequest *req, HTTPResponse *res);
|
void handleReport(HTTPRequest *req, HTTPResponse *res);
|
||||||
void handleNodes(HTTPRequest *req, HTTPResponse *res);
|
void handleNodes(HTTPRequest *req, HTTPResponse *res);
|
||||||
void handleUpdateFs(HTTPRequest *req, HTTPResponse *res);
|
void handleUpdateFs(HTTPRequest *req, HTTPResponse *res);
|
||||||
|
|||||||
@@ -643,12 +643,6 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
|
|||||||
accelerometerThread->enabled = true;
|
accelerometerThread->enabled = true;
|
||||||
accelerometerThread->start();
|
accelerometerThread->start();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#ifdef LED_PIN
|
|
||||||
// Turn LED off if heartbeat by config
|
|
||||||
if (c.payload_variant.device.led_heartbeat_disabled) {
|
|
||||||
digitalWrite(LED_PIN, HIGH ^ LED_STATE_ON);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
if (config.device.button_gpio == c.payload_variant.device.button_gpio &&
|
if (config.device.button_gpio == c.payload_variant.device.button_gpio &&
|
||||||
config.device.buzzer_gpio == c.payload_variant.device.buzzer_gpio &&
|
config.device.buzzer_gpio == c.payload_variant.device.buzzer_gpio &&
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#if !MESHTASTIC_EXCLUDE_INPUTBROKER
|
#if !MESHTASTIC_EXCLUDE_INPUTBROKER
|
||||||
#include "buzz/BuzzerFeedbackThread.h"
|
#include "buzz/BuzzerFeedbackThread.h"
|
||||||
#include "modules/StatusLEDModule.h"
|
|
||||||
#include "modules/SystemCommandsModule.h"
|
#include "modules/SystemCommandsModule.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include "modules/StatusLEDModule.h"
|
||||||
#if !MESHTASTIC_EXCLUDE_REPLYBOT
|
#if !MESHTASTIC_EXCLUDE_REPLYBOT
|
||||||
#include "ReplyBotModule.h"
|
#include "ReplyBotModule.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -112,9 +112,7 @@ void setupModules()
|
|||||||
buzzerFeedbackThread = new BuzzerFeedbackThread();
|
buzzerFeedbackThread = new BuzzerFeedbackThread();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(LED_CHARGE) || defined(LED_PAIRING)
|
|
||||||
statusLEDModule = new StatusLEDModule();
|
statusLEDModule = new StatusLEDModule();
|
||||||
#endif
|
|
||||||
#if !MESHTASTIC_EXCLUDE_REPLYBOT
|
#if !MESHTASTIC_EXCLUDE_REPLYBOT
|
||||||
new ReplyBotModule();
|
new ReplyBotModule();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#include "PowerStressModule.h"
|
#include "PowerStressModule.h"
|
||||||
#include "Led.h"
|
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "PowerMon.h"
|
#include "PowerMon.h"
|
||||||
@@ -78,10 +77,12 @@ int32_t PowerStressModule::runOnce()
|
|||||||
|
|
||||||
switch (p.cmd) {
|
switch (p.cmd) {
|
||||||
case meshtastic_PowerStressMessage_Opcode_LED_ON:
|
case meshtastic_PowerStressMessage_Opcode_LED_ON:
|
||||||
ledForceOn.set(true);
|
// FIXME - implement
|
||||||
|
// ledForceOn.set(true);
|
||||||
break;
|
break;
|
||||||
case meshtastic_PowerStressMessage_Opcode_LED_OFF:
|
case meshtastic_PowerStressMessage_Opcode_LED_OFF:
|
||||||
ledForceOn.set(false);
|
// FIXME - implement
|
||||||
|
// ledForceOn.set(false);
|
||||||
break;
|
break;
|
||||||
case meshtastic_PowerStressMessage_Opcode_GPS_ON:
|
case meshtastic_PowerStressMessage_Opcode_GPS_ON:
|
||||||
// FIXME - implement
|
// FIXME - implement
|
||||||
|
|||||||
@@ -13,8 +13,10 @@ StatusLEDModule::StatusLEDModule() : concurrency::OSThread("StatusLEDModule")
|
|||||||
{
|
{
|
||||||
bluetoothStatusObserver.observe(&bluetoothStatus->onNewStatus);
|
bluetoothStatusObserver.observe(&bluetoothStatus->onNewStatus);
|
||||||
powerStatusObserver.observe(&powerStatus->onNewStatus);
|
powerStatusObserver.observe(&powerStatus->onNewStatus);
|
||||||
|
#if !MESHTASTIC_EXCLUDE_INPUTBROKER
|
||||||
if (inputBroker)
|
if (inputBroker)
|
||||||
inputObserver.observe(inputBroker);
|
inputObserver.observe(inputBroker);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int StatusLEDModule::handleStatusUpdate(const meshtastic::Status *arg)
|
int StatusLEDModule::handleStatusUpdate(const meshtastic::Status *arg)
|
||||||
@@ -62,19 +64,22 @@ int StatusLEDModule::handleStatusUpdate(const meshtastic::Status *arg)
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
#if !MESHTASTIC_EXCLUDE_INPUTBROKER
|
||||||
int StatusLEDModule::handleInputEvent(const InputEvent *event)
|
int StatusLEDModule::handleInputEvent(const InputEvent *event)
|
||||||
{
|
{
|
||||||
lastUserbuttonTime = millis();
|
lastUserbuttonTime = millis();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int32_t StatusLEDModule::runOnce()
|
int32_t StatusLEDModule::runOnce()
|
||||||
{
|
{
|
||||||
my_interval = 1000;
|
my_interval = 1000;
|
||||||
|
|
||||||
if (power_state == charging) {
|
if (power_state == charging) {
|
||||||
|
#ifndef POWER_LED_HARDWARE_BLINKS_WHILE_CHARGING
|
||||||
CHARGE_LED_state = !CHARGE_LED_state;
|
CHARGE_LED_state = !CHARGE_LED_state;
|
||||||
|
#endif
|
||||||
} else if (power_state == charged) {
|
} else if (power_state == charged) {
|
||||||
CHARGE_LED_state = LED_STATE_ON;
|
CHARGE_LED_state = LED_STATE_ON;
|
||||||
} else if (power_state == critical) {
|
} else if (power_state == critical) {
|
||||||
@@ -88,13 +93,19 @@ int32_t StatusLEDModule::runOnce()
|
|||||||
my_interval = 250;
|
my_interval = 250;
|
||||||
if (POWER_LED_starttime + 2000 < millis()) {
|
if (POWER_LED_starttime + 2000 < millis()) {
|
||||||
doing_fast_blink = false;
|
doing_fast_blink = false;
|
||||||
|
CHARGE_LED_state = LED_STATE_OFF;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
CHARGE_LED_state = LED_STATE_OFF;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
if (power_state != charging && power_state != charged && !doing_fast_blink) {
|
||||||
CHARGE_LED_state = LED_STATE_OFF;
|
if (CHARGE_LED_state == LED_STATE_ON) {
|
||||||
|
CHARGE_LED_state = LED_STATE_OFF;
|
||||||
|
my_interval = 999;
|
||||||
|
} else {
|
||||||
|
CHARGE_LED_state = LED_STATE_ON;
|
||||||
|
my_interval = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config.bluetooth.enabled || PAIRING_LED_starttime + 30 * 1000 < millis() || doing_fast_blink) {
|
if (!config.bluetooth.enabled || PAIRING_LED_starttime + 30 * 1000 < millis() || doing_fast_blink) {
|
||||||
@@ -112,6 +123,11 @@ int32_t StatusLEDModule::runOnce()
|
|||||||
PAIRING_LED_state = LED_STATE_ON;
|
PAIRING_LED_state = LED_STATE_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Override if disabled in config
|
||||||
|
if (config.device.led_heartbeat_disabled) {
|
||||||
|
CHARGE_LED_state = LED_STATE_OFF;
|
||||||
|
}
|
||||||
|
#ifdef Battery_LED_1
|
||||||
bool chargeIndicatorLED1 = LED_STATE_OFF;
|
bool chargeIndicatorLED1 = LED_STATE_OFF;
|
||||||
bool chargeIndicatorLED2 = LED_STATE_OFF;
|
bool chargeIndicatorLED2 = LED_STATE_OFF;
|
||||||
bool chargeIndicatorLED3 = LED_STATE_OFF;
|
bool chargeIndicatorLED3 = LED_STATE_OFF;
|
||||||
@@ -126,9 +142,23 @@ int32_t StatusLEDModule::runOnce()
|
|||||||
if (powerStatus && powerStatus->getBatteryChargePercent() >= 75)
|
if (powerStatus && powerStatus->getBatteryChargePercent() >= 75)
|
||||||
chargeIndicatorLED4 = LED_STATE_ON;
|
chargeIndicatorLED4 = LED_STATE_ON;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef LED_CHARGE
|
#if defined(HAS_PMU)
|
||||||
digitalWrite(LED_CHARGE, CHARGE_LED_state);
|
if (pmu_found && PMU) {
|
||||||
|
// blink the axp led
|
||||||
|
PMU->setChargingLedMode(CHARGE_LED_state ? XPOWERS_CHG_LED_ON : XPOWERS_CHG_LED_OFF);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PCA_LED_POWER
|
||||||
|
io.digitalWrite(PCA_LED_POWER, CHARGE_LED_state);
|
||||||
|
#endif
|
||||||
|
#ifdef PCA_LED_ENABLE
|
||||||
|
io.digitalWrite(PCA_LED_ENABLE, CHARGE_LED_state);
|
||||||
|
#endif
|
||||||
|
#ifdef LED_POWER
|
||||||
|
digitalWrite(LED_POWER, CHARGE_LED_state);
|
||||||
#endif
|
#endif
|
||||||
#ifdef LED_PAIRING
|
#ifdef LED_PAIRING
|
||||||
digitalWrite(LED_PAIRING, PAIRING_LED_state);
|
digitalWrite(LED_PAIRING, PAIRING_LED_state);
|
||||||
@@ -149,3 +179,43 @@ int32_t StatusLEDModule::runOnce()
|
|||||||
|
|
||||||
return (my_interval);
|
return (my_interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StatusLEDModule::setPowerLED(bool LEDon)
|
||||||
|
{
|
||||||
|
|
||||||
|
#if defined(HAS_PMU)
|
||||||
|
if (pmu_found && PMU) {
|
||||||
|
// blink the axp led
|
||||||
|
PMU->setChargingLedMode(LEDon ? XPOWERS_CHG_LED_ON : XPOWERS_CHG_LED_OFF);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (LEDon)
|
||||||
|
LEDon = LED_STATE_ON;
|
||||||
|
else
|
||||||
|
LEDon = LED_STATE_OFF;
|
||||||
|
#ifdef PCA_LED_POWER
|
||||||
|
io.digitalWrite(PCA_LED_POWER, LEDon);
|
||||||
|
#endif
|
||||||
|
#ifdef PCA_LED_ENABLE
|
||||||
|
io.digitalWrite(PCA_LED_ENABLE, LEDon);
|
||||||
|
#endif
|
||||||
|
#ifdef LED_POWER
|
||||||
|
digitalWrite(LED_POWER, LEDon);
|
||||||
|
#endif
|
||||||
|
#ifdef LED_PAIRING
|
||||||
|
digitalWrite(LED_PAIRING, LEDon);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef Battery_LED_1
|
||||||
|
digitalWrite(Battery_LED_1, LEDon);
|
||||||
|
#endif
|
||||||
|
#ifdef Battery_LED_2
|
||||||
|
digitalWrite(Battery_LED_2, LEDon);
|
||||||
|
#endif
|
||||||
|
#ifdef Battery_LED_3
|
||||||
|
digitalWrite(Battery_LED_3, LEDon);
|
||||||
|
#endif
|
||||||
|
#ifdef Battery_LED_4
|
||||||
|
digitalWrite(Battery_LED_4, LEDon);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,10 +5,14 @@
|
|||||||
#include "PowerStatus.h"
|
#include "PowerStatus.h"
|
||||||
#include "concurrency/OSThread.h"
|
#include "concurrency/OSThread.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "input/InputBroker.h"
|
#include "main.h"
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
|
#if !MESHTASTIC_EXCLUDE_INPUTBROKER
|
||||||
|
#include "input/InputBroker.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
class StatusLEDModule : private concurrency::OSThread
|
class StatusLEDModule : private concurrency::OSThread
|
||||||
{
|
{
|
||||||
bool slowTrack = false;
|
bool slowTrack = false;
|
||||||
@@ -17,8 +21,11 @@ class StatusLEDModule : private concurrency::OSThread
|
|||||||
StatusLEDModule();
|
StatusLEDModule();
|
||||||
|
|
||||||
int handleStatusUpdate(const meshtastic::Status *);
|
int handleStatusUpdate(const meshtastic::Status *);
|
||||||
|
#if !MESHTASTIC_EXCLUDE_INPUTBROKER
|
||||||
int handleInputEvent(const InputEvent *arg);
|
int handleInputEvent(const InputEvent *arg);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void setPowerLED(bool);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
unsigned int my_interval = 1000; // interval in millisconds
|
unsigned int my_interval = 1000; // interval in millisconds
|
||||||
@@ -28,8 +35,10 @@ class StatusLEDModule : private concurrency::OSThread
|
|||||||
CallbackObserver<StatusLEDModule, const meshtastic::Status *>(this, &StatusLEDModule::handleStatusUpdate);
|
CallbackObserver<StatusLEDModule, const meshtastic::Status *>(this, &StatusLEDModule::handleStatusUpdate);
|
||||||
CallbackObserver<StatusLEDModule, const meshtastic::Status *> powerStatusObserver =
|
CallbackObserver<StatusLEDModule, const meshtastic::Status *> powerStatusObserver =
|
||||||
CallbackObserver<StatusLEDModule, const meshtastic::Status *>(this, &StatusLEDModule::handleStatusUpdate);
|
CallbackObserver<StatusLEDModule, const meshtastic::Status *>(this, &StatusLEDModule::handleStatusUpdate);
|
||||||
|
#if !MESHTASTIC_EXCLUDE_INPUTBROKER
|
||||||
CallbackObserver<StatusLEDModule, const InputEvent *> inputObserver =
|
CallbackObserver<StatusLEDModule, const InputEvent *> inputObserver =
|
||||||
CallbackObserver<StatusLEDModule, const InputEvent *>(this, &StatusLEDModule::handleInputEvent);
|
CallbackObserver<StatusLEDModule, const InputEvent *>(this, &StatusLEDModule::handleInputEvent);
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool CHARGE_LED_state = LED_STATE_OFF;
|
bool CHARGE_LED_state = LED_STATE_OFF;
|
||||||
|
|||||||
@@ -158,7 +158,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PIN_LED1
|
#ifdef PIN_LED1
|
||||||
#define LED_PIN PIN_LED1 // LED1 on nrf52840-DK
|
#define LED_POWER PIN_LED1 // LED1 on nrf52840-DK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PIN_BUTTON1
|
#ifdef PIN_BUTTON1
|
||||||
|
|||||||
@@ -103,8 +103,10 @@ class Power : private concurrency::OSThread
|
|||||||
bool axpChipInit();
|
bool axpChipInit();
|
||||||
/// Setup a simple ADC input based battery sensor
|
/// Setup a simple ADC input based battery sensor
|
||||||
bool analogInit();
|
bool analogInit();
|
||||||
/// Setup a Lipo battery level sensor
|
/// Setup cw2015 battery level sensor
|
||||||
bool lipoInit();
|
bool cw2015Init();
|
||||||
|
/// Setup a 17048 battery level sensor
|
||||||
|
bool max17048Init();
|
||||||
/// Setup a Lipo charger
|
/// Setup a Lipo charger
|
||||||
bool lipoChargerInit();
|
bool lipoChargerInit();
|
||||||
/// Setup a meshSolar battery sensor
|
/// Setup a meshSolar battery sensor
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "Default.h"
|
#include "Default.h"
|
||||||
#include "Led.h"
|
|
||||||
#include "MeshRadio.h"
|
#include "MeshRadio.h"
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
@@ -13,6 +12,7 @@
|
|||||||
#include "detect/LoRaRadioType.h"
|
#include "detect/LoRaRadioType.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "modules/StatusLEDModule.h"
|
||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
#include "target_specific.h"
|
#include "target_specific.h"
|
||||||
|
|
||||||
@@ -268,8 +268,7 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false, bool skipSaveN
|
|||||||
digitalWrite(PIN_WD_EN, LOW);
|
digitalWrite(PIN_WD_EN, LOW);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
ledBlink.set(false);
|
statusLEDModule->setPowerLED(false);
|
||||||
|
|
||||||
#ifdef RESET_OLED
|
#ifdef RESET_OLED
|
||||||
digitalWrite(RESET_OLED, 1); // put the display in reset before killing its power
|
digitalWrite(RESET_OLED, 1); // put the display in reset before killing its power
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#define LORA_CS 5
|
#define LORA_CS 5
|
||||||
#define RF95_FAN_EN 17
|
#define RF95_FAN_EN 17
|
||||||
|
|
||||||
// #define LED_PIN 16 // This is a LED_WS2812 not a standard LED
|
// This is a LED_WS2812 not a standard LED
|
||||||
#define HAS_NEOPIXEL // Enable the use of neopixels
|
#define HAS_NEOPIXEL // Enable the use of neopixels
|
||||||
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
|
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
|
||||||
#define NEOPIXEL_DATA 16 // gpio pin used to send data to the neopixels
|
#define NEOPIXEL_DATA 16 // gpio pin used to send data to the neopixels
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#define LORA_DIO2
|
#define LORA_DIO2
|
||||||
#define LORA_DIO3
|
#define LORA_DIO3
|
||||||
|
|
||||||
#define LED_PIN 16 // green - blue is at 17
|
#define LED_POWER 16 // green - blue is at 17
|
||||||
|
|
||||||
#define BUTTON_PIN 25
|
#define BUTTON_PIN 25
|
||||||
#define BUTTON_NEED_PULLUP
|
#define BUTTON_NEED_PULLUP
|
||||||
|
|||||||
@@ -23,8 +23,6 @@
|
|||||||
#define SX126X_TXEN RADIOLIB_NC
|
#define SX126X_TXEN RADIOLIB_NC
|
||||||
#define SX126X_RXEN RADIOLIB_NC
|
#define SX126X_RXEN RADIOLIB_NC
|
||||||
|
|
||||||
// Status
|
|
||||||
// #define LED_PIN 1
|
|
||||||
// External notification
|
// External notification
|
||||||
// FIXME: Check if EXT_NOTIFY_OUT actualy has any effect and removes the need for setting the external notication pin in the
|
// FIXME: Check if EXT_NOTIFY_OUT actualy has any effect and removes the need for setting the external notication pin in the
|
||||||
// app/preferences
|
// app/preferences
|
||||||
|
|||||||
@@ -21,8 +21,8 @@
|
|||||||
#define BUTTON_PIN 15 // Right side button - if not available, set device.button_gpio to 0 from Meshtastic client
|
#define BUTTON_PIN 15 // Right side button - if not available, set device.button_gpio to 0 from Meshtastic client
|
||||||
|
|
||||||
// LEDs
|
// LEDs
|
||||||
#define LED_PIN 13 // Tx LED
|
#define LED_POWER 13 // Tx LED
|
||||||
#define USER_LED 2 // Rx LED
|
#define USER_LED 2 // Rx LED
|
||||||
|
|
||||||
// Buzzer
|
// Buzzer
|
||||||
#define PIN_BUZZER 33
|
#define PIN_BUZZER 33
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#define ADC_MULTIPLIER 1.85 // (R1 = 470k, R2 = 680k)
|
#define ADC_MULTIPLIER 1.85 // (R1 = 470k, R2 = 680k)
|
||||||
#define EXT_PWR_DETECT 4 // Pin to detect connected external power source for LILYGO® TTGO T-Energy T18 and other DIY boards
|
#define EXT_PWR_DETECT 4 // Pin to detect connected external power source for LILYGO® TTGO T-Energy T18 and other DIY boards
|
||||||
#define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Module (#975).
|
#define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Module (#975).
|
||||||
#define LED_PIN 2 // add status LED (compatible with core-pcb and DIY targets)
|
#define LED_POWER 2 // add status LED (compatible with core-pcb and DIY targets)
|
||||||
|
|
||||||
// Radio
|
// Radio
|
||||||
#define USE_SX1262 // E22-900M30S uses SX1262
|
#define USE_SX1262 // E22-900M30S uses SX1262
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#define ADC_MULTIPLIER 1.85 // (R1 = 470k, R2 = 680k)
|
#define ADC_MULTIPLIER 1.85 // (R1 = 470k, R2 = 680k)
|
||||||
#define EXT_PWR_DETECT 4 // Pin to detect connected external power source for LILYGO® TTGO T-Energy T18 and other DIY boards
|
#define EXT_PWR_DETECT 4 // Pin to detect connected external power source for LILYGO® TTGO T-Energy T18 and other DIY boards
|
||||||
#define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Module (#975).
|
#define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Module (#975).
|
||||||
#define LED_PIN 2 // add status LED (compatible with core-pcb and DIY targets)
|
#define LED_POWER 2 // add status LED (compatible with core-pcb and DIY targets)
|
||||||
|
|
||||||
#define LORA_DIO0 26 // a No connect on the SX1262/SX1268 module
|
#define LORA_DIO0 26 // a No connect on the SX1262/SX1268 module
|
||||||
#define LORA_RESET 23 // RST for SX1276, and for SX1262/SX1268
|
#define LORA_RESET 23 // RST for SX1276, and for SX1262/SX1268
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// HACKBOX LoRa IO Kit
|
// HACKBOX LoRa IO Kit
|
||||||
// Uses a ESP-32-WROOM and a RA-01SH (SX1262) LoRa Board
|
// Uses a ESP-32-WROOM and a RA-01SH (SX1262) LoRa Board
|
||||||
|
|
||||||
#define LED_PIN 2 // LED
|
#define LED_POWER 2 // LED
|
||||||
#define LED_STATE_ON 1 // State when LED is lit
|
#define LED_STATE_ON 1 // State when LED is lit
|
||||||
|
|
||||||
#define HAS_SCREEN 0
|
#define HAS_SCREEN 0
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#define RESET_OLED 16 // If defined, this pin will be used to reset the display controller
|
#define RESET_OLED 16 // If defined, this pin will be used to reset the display controller
|
||||||
|
|
||||||
#define LED_PIN 25 // If defined we will blink this LED
|
#define LED_POWER 25 // If defined we will blink this LED
|
||||||
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
|
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
|
||||||
|
|
||||||
#define USE_RF95
|
#define USE_RF95
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#define RESET_OLED 16 // If defined, this pin will be used to reset the display controller
|
#define RESET_OLED 16 // If defined, this pin will be used to reset the display controller
|
||||||
|
|
||||||
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
|
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
|
||||||
#define LED_PIN 25 // If defined we will blink this LED
|
#define LED_POWER 25 // If defined we will blink this LED
|
||||||
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
|
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
|
||||||
|
|
||||||
#define USE_RF95
|
#define USE_RF95
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#define RESET_OLED 16 // If defined, this pin will be used to reset the display controller
|
#define RESET_OLED 16 // If defined, this pin will be used to reset the display controller
|
||||||
|
|
||||||
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
|
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
|
||||||
#define LED_PIN 25 // If defined we will blink this LED
|
#define LED_POWER 25 // If defined we will blink this LED
|
||||||
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
|
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
|
||||||
|
|
||||||
#define USE_RF95
|
#define USE_RF95
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#undef GPS_TX_PIN
|
#undef GPS_TX_PIN
|
||||||
|
|
||||||
// Green / Lora = PIN 22 / GPIO2, Yellow / Wifi = PIN 23 / GPIO0, Blue / BLE = PIN 25 / GPIO16
|
// Green / Lora = PIN 22 / GPIO2, Yellow / Wifi = PIN 23 / GPIO0, Blue / BLE = PIN 25 / GPIO16
|
||||||
#define LED_PIN 22
|
#define LED_POWER 22
|
||||||
#define WIFI_LED 23
|
#define WIFI_LED 23
|
||||||
#define BLE_LED 25
|
#define BLE_LED 25
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#define I2C_SCL SCL
|
#define I2C_SCL SCL
|
||||||
#define I2C_SDA SDA
|
#define I2C_SDA SDA
|
||||||
|
|
||||||
#define LED_PIN LED
|
#define LED_POWER LED
|
||||||
|
|
||||||
// active low, powers the Battery reader, but no lora antenna boost (?)
|
// active low, powers the Battery reader, but no lora antenna boost (?)
|
||||||
// #define VEXT_ENABLE Vext
|
// #define VEXT_ENABLE Vext
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
// Green LED
|
// Green LED
|
||||||
#define LED_STATE_ON 1 // State when LED is lit
|
#define LED_STATE_ON 1 // State when LED is lit
|
||||||
#define LED_PIN 10
|
#define LED_POWER 10
|
||||||
|
|
||||||
// PCF8563 RTC Module
|
// PCF8563 RTC Module
|
||||||
#define PCF8563_RTC 0x51
|
#define PCF8563_RTC 0x51
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
/*
|
/*
|
||||||
LED PIN setup.
|
LED PIN setup.
|
||||||
*/
|
*/
|
||||||
#define LED_PIN 15
|
#define LED_POWER 15
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Five way button when using ADC.
|
Five way button when using ADC.
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ static const uint8_t SCK = 33;
|
|||||||
#undef GPS_TX_PIN
|
#undef GPS_TX_PIN
|
||||||
#define GPS_TX_PIN (TX1)
|
#define GPS_TX_PIN (TX1)
|
||||||
|
|
||||||
#define LED_PIN LED_BLUE
|
#define LED_POWER LED_BLUE
|
||||||
|
|
||||||
#define PIN_VBAT WB_A0
|
#define PIN_VBAT WB_A0
|
||||||
#define BATTERY_PIN PIN_VBAT
|
#define BATTERY_PIN PIN_VBAT
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
|
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
|
||||||
|
|
||||||
#define LED_STATE_ON 0 // State when LED is lit
|
#define LED_STATE_ON 0 // State when LED is lit
|
||||||
#define LED_PIN 4 // Newer tbeams (1.1) have an extra led on GPIO4
|
#define LED_POWER 4 // Newer tbeams (1.1) have an extra led on GPIO4
|
||||||
|
|
||||||
// TTGO uses a common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if
|
// TTGO uses a common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if
|
||||||
// not found then probe for SX1262
|
// not found then probe for SX1262
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
#undef EXT_NOTIFY_OUT
|
#undef EXT_NOTIFY_OUT
|
||||||
#undef LED_STATE_ON
|
#undef LED_STATE_ON
|
||||||
#undef LED_PIN
|
#undef LED_POWER
|
||||||
|
|
||||||
#define HAS_CST226SE 1
|
#define HAS_CST226SE 1
|
||||||
#define HAS_TOUCHSCREEN 1
|
#define HAS_TOUCHSCREEN 1
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
|
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
|
||||||
#define VEXT_ON_VALUE LOW
|
#define VEXT_ON_VALUE LOW
|
||||||
#define LED_PIN 2 // If defined we will blink this LED
|
#define LED_POWER 2 // If defined we will blink this LED
|
||||||
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
|
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
|
||||||
#define BUTTON_NEED_PULLUP
|
#define BUTTON_NEED_PULLUP
|
||||||
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
|
#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#define RESET_OLED 16 // If defined, this pin will be used to reset the display controller
|
#define RESET_OLED 16 // If defined, this pin will be used to reset the display controller
|
||||||
|
|
||||||
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
|
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
|
||||||
#define LED_PIN 25 // If defined we will blink this LED
|
#define LED_POWER 25 // If defined we will blink this LED
|
||||||
#define BUTTON_PIN 36
|
#define BUTTON_PIN 36
|
||||||
#define BUTTON_NEED_PULLUP
|
#define BUTTON_NEED_PULLUP
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#define I2C_SCL 22
|
#define I2C_SCL 22
|
||||||
|
|
||||||
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
|
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
|
||||||
#define LED_PIN 25 // If defined we will blink this LED
|
#define LED_POWER 25 // If defined we will blink this LED
|
||||||
#define BUTTON_PIN \
|
#define BUTTON_PIN \
|
||||||
0 // If defined, this will be used for user button presses, if your board doesn't have a physical switch, you can wire one
|
0 // If defined, this will be used for user button presses, if your board doesn't have a physical switch, you can wire one
|
||||||
// between this pin and ground
|
// between this pin and ground
|
||||||
|
|||||||
@@ -22,4 +22,4 @@ build_flags =
|
|||||||
${env:tlora-v2-1-1_6.build_flags}
|
${env:tlora-v2-1-1_6.build_flags}
|
||||||
-DBUTTON_PIN=0
|
-DBUTTON_PIN=0
|
||||||
-DPIN_BUZZER=25
|
-DPIN_BUZZER=25
|
||||||
-DLED_PIN=-1
|
-DLED_POWER=-1
|
||||||
@@ -8,10 +8,10 @@
|
|||||||
#define I2C_SDA 21 // I2C pins for this board
|
#define I2C_SDA 21 // I2C pins for this board
|
||||||
#define I2C_SCL 22
|
#define I2C_SCL 22
|
||||||
|
|
||||||
#if defined(LED_PIN) && LED_PIN == -1
|
#if defined(LED_POWER) && LED_POWER == -1
|
||||||
#undef LED_PIN
|
#undef LED_POWER
|
||||||
#else
|
#else
|
||||||
#define LED_PIN 25 // If defined we will blink this LED
|
#define LED_POWER 25 // If defined we will blink this LED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define USE_RF95
|
#define USE_RF95
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#define I2C_SDA 21 // I2C pins for this board
|
#define I2C_SDA 21 // I2C pins for this board
|
||||||
#define I2C_SCL 22
|
#define I2C_SCL 22
|
||||||
|
|
||||||
#define LED_PIN 25 // If defined we will blink this LED
|
#define LED_POWER 25 // If defined we will blink this LED
|
||||||
#define BUTTON_PIN 12 // If defined, this will be used for user button presses,
|
#define BUTTON_PIN 12 // If defined, this will be used for user button presses,
|
||||||
|
|
||||||
#define BUTTON_NEED_PULLUP
|
#define BUTTON_NEED_PULLUP
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#define GPS_RX_PIN 9
|
#define GPS_RX_PIN 9
|
||||||
#define GPS_TX_PIN 10
|
#define GPS_TX_PIN 10
|
||||||
|
|
||||||
#define LED_PIN 13 // 13 red, 2 blue, 15 red
|
#define LED_POWER 13 // 13 red, 2 blue, 15 red
|
||||||
|
|
||||||
#define BUTTON_PIN 0
|
#define BUTTON_PIN 0
|
||||||
#define BUTTON_NEED_PULLUP
|
#define BUTTON_NEED_PULLUP
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#define I2C_SCL SCL
|
#define I2C_SCL SCL
|
||||||
|
|
||||||
#define BUTTON_PIN 9 // BOOT button
|
#define BUTTON_PIN 9 // BOOT button
|
||||||
#define LED_PIN 30 // RGB LED
|
#define LED_POWER 30 // RGB LED
|
||||||
|
|
||||||
#define USE_RF95
|
#define USE_RF95
|
||||||
#define LORA_SCK 4
|
#define LORA_SCK 4
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// Hackerboxes LoRa ESP32-C3 OLED Kit
|
// Hackerboxes LoRa ESP32-C3 OLED Kit
|
||||||
// Uses a ESP32-C3 OLED Board and a RA-01SH (SX1262) LoRa Board
|
// Uses a ESP32-C3 OLED Board and a RA-01SH (SX1262) LoRa Board
|
||||||
|
|
||||||
#define LED_PIN 8 // LED
|
#define LED_POWER 8 // LED
|
||||||
#define LED_STATE_ON 1 // State when LED is lit
|
#define LED_STATE_ON 1 // State when LED is lit
|
||||||
|
|
||||||
#define HAS_SCREEN 0
|
#define HAS_SCREEN 0
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// LED pin on HT-DEV-ESP_V2 and HT-DEV-ESP_V3
|
// LED pin on HT-DEV-ESP_V2 and HT-DEV-ESP_V3
|
||||||
// https://resource.heltec.cn/download/HT-CT62/HT-CT62_Reference_Design.pdf
|
// https://resource.heltec.cn/download/HT-CT62/HT-CT62_Reference_Design.pdf
|
||||||
// https://resource.heltec.cn/download/HT-DEV-ESP/HT-DEV-ESP_V3_Sch.pdf
|
// https://resource.heltec.cn/download/HT-DEV-ESP/HT-DEV-ESP_V3_Sch.pdf
|
||||||
#define LED_PIN 2 // LED
|
#define LED_POWER 2 // LED
|
||||||
#define LED_STATE_ON 1 // State when LED is lit
|
#define LED_STATE_ON 1 // State when LED is lit
|
||||||
|
|
||||||
#define HAS_SCREEN 0
|
#define HAS_SCREEN 0
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#define I2C_SDA 8 // I2C pins for this board
|
#define I2C_SDA 8 // I2C pins for this board
|
||||||
#define I2C_SCL 9
|
#define I2C_SCL 9
|
||||||
|
|
||||||
#define LED_PIN 7 // If defined we will blink this LED
|
#define LED_POWER 7 // If defined we will blink this LED
|
||||||
#define LED_STATE_ON 0 // State when LED is lit
|
#define LED_STATE_ON 0 // State when LED is lit
|
||||||
|
|
||||||
#define USE_SX1262
|
#define USE_SX1262
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#define I2C_SDA 34 // I2C pins for this board
|
#define I2C_SDA 34 // I2C pins for this board
|
||||||
#define I2C_SCL 36
|
#define I2C_SCL 36
|
||||||
|
|
||||||
#define LED_PIN 15 // If defined we will blink this LED
|
#define LED_POWER 15 // If defined we will blink this LED
|
||||||
|
|
||||||
#define HAS_NEOPIXEL // Enable the use of neopixels
|
#define HAS_NEOPIXEL // Enable the use of neopixels
|
||||||
#define NEOPIXEL_COUNT 3 // How many neopixels are connected
|
#define NEOPIXEL_COUNT 3 // How many neopixels are connected
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// EByte EoRA-Hub
|
// EByte EoRA-Hub
|
||||||
// Uses E80 (LR1121) LoRa module
|
// Uses E80 (LR1121) LoRa module
|
||||||
|
|
||||||
#define LED_PIN 35
|
#define LED_POWER 35
|
||||||
|
|
||||||
// Button - user interface
|
// Button - user interface
|
||||||
#define BUTTON_PIN 0 // BOOT button
|
#define BUTTON_PIN 0 // BOOT button
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// LED - status indication
|
// LED - status indication
|
||||||
#define LED_PIN 37
|
#define LED_POWER 37
|
||||||
|
|
||||||
// Button - user interface
|
// Button - user interface
|
||||||
#define BUTTON_PIN 0 // This is the BOOT button, and it has its own pull-up resistor
|
#define BUTTON_PIN 0 // This is the BOOT button, and it has its own pull-up resistor
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
#define LED_PIN 1
|
#define LED_POWER 1
|
||||||
#define LED_STATE_ON 1 // State when LED is lit
|
#define LED_STATE_ON 1 // State when LED is lit
|
||||||
// External notification
|
// External notification
|
||||||
// FIXME: Check if EXT_NOTIFY_OUT actualy has any effect and removes the need for setting the external notication pin in the
|
// FIXME: Check if EXT_NOTIFY_OUT actualy has any effect and removes the need for setting the external notication pin in the
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// Status
|
// Status
|
||||||
#define LED_PIN 1
|
#define LED_POWER 1
|
||||||
|
|
||||||
#define PIN_BUTTON1 47 // 功能键
|
#define PIN_BUTTON1 47 // 功能键
|
||||||
#define PIN_BUTTON2 4 // 电源键
|
#define PIN_BUTTON2 4 // 电源键
|
||||||
|
|||||||
@@ -8,5 +8,11 @@ void earlyInitVariant()
|
|||||||
Wire.begin(48, 47);
|
Wire.begin(48, 47);
|
||||||
io.pinMode(PCA_PIN_EINK_EN, OUTPUT);
|
io.pinMode(PCA_PIN_EINK_EN, OUTPUT);
|
||||||
io.pinMode(PCA_PIN_POWER_EN, OUTPUT);
|
io.pinMode(PCA_PIN_POWER_EN, OUTPUT);
|
||||||
|
io.pinMode(PCA_LED_POWER, OUTPUT);
|
||||||
|
io.pinMode(PCA_LED_USER, OUTPUT);
|
||||||
|
io.pinMode(PCA_LED_ENABLE, OUTPUT);
|
||||||
|
|
||||||
io.digitalWrite(PCA_PIN_POWER_EN, HIGH);
|
io.digitalWrite(PCA_PIN_POWER_EN, HIGH);
|
||||||
|
io.digitalWrite(PCA_LED_USER, LOW);
|
||||||
|
io.digitalWrite(PCA_LED_ENABLE, LOW);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,10 @@
|
|||||||
|
|
||||||
// LED
|
// LED
|
||||||
// Both of these are on the GPIO expander
|
// Both of these are on the GPIO expander
|
||||||
#define PCA_LED_USER 1 // the Blue LED
|
#define PCA_LED_USER 1 // the Blue LED
|
||||||
#define PCA_LED_POWER 3 // the Red LED? Seems to have hardware logic to blink when USB is plugged in.
|
#define PCA_LED_ENABLE 2 // the power supply to the LEDs, in an OR arrangement with VBUS power
|
||||||
|
#define PCA_LED_POWER 3 // the Red LED? Seems to have hardware logic to blink when USB is plugged in.
|
||||||
|
#define POWER_LED_HARDWARE_BLINKS_WHILE_CHARGING
|
||||||
|
|
||||||
// USB_CHECK
|
// USB_CHECK
|
||||||
#define EXT_PWR_DETECT 12
|
#define EXT_PWR_DETECT 12
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#define I2C_SDA 12
|
#define I2C_SDA 12
|
||||||
#define I2C_SCL 14
|
#define I2C_SCL 14
|
||||||
|
|
||||||
#define LED_PIN 46
|
#define LED_POWER 46
|
||||||
#define LED_STATE_ON 0 // State when LED is litted
|
#define LED_STATE_ON 0 // State when LED is litted
|
||||||
|
|
||||||
// #define BUTTON_PIN 15 // Pico OLED 1.3 User key 0 - removed User key 1 (17)
|
// #define BUTTON_PIN 15 // Pico OLED 1.3 User key 0 - removed User key 1 (17)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
// #define GPS_RX_PIN 44
|
// #define GPS_RX_PIN 44
|
||||||
// #define GPS_TX_PIN 43
|
// #define GPS_TX_PIN 43
|
||||||
|
|
||||||
#define LED_PIN 41
|
#define LED_POWER 41
|
||||||
#define BUTTON_PIN 2
|
#define BUTTON_PIN 2
|
||||||
#define BUTTON_NEED_PULLUP
|
#define BUTTON_NEED_PULLUP
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#define I2C_SDA 18 // 1 // I2C pins for this board
|
#define I2C_SDA 18 // 1 // I2C pins for this board
|
||||||
#define I2C_SCL 17 // 2
|
#define I2C_SCL 17 // 2
|
||||||
|
|
||||||
// #define LED_PIN 38 // This is a RGB LED not a standard LED
|
// #define LED_POWER 38 // This is a RGB LED not a standard LED
|
||||||
#define HAS_NEOPIXEL // Enable the use of neopixels
|
#define HAS_NEOPIXEL // Enable the use of neopixels
|
||||||
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
|
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
|
||||||
#define NEOPIXEL_DATA 38 // gpio pin used to send data to the neopixels
|
#define NEOPIXEL_DATA 38 // gpio pin used to send data to the neopixels
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#define I2C_SDA 18 // 1 // I2C pins for this board
|
#define I2C_SDA 18 // 1 // I2C pins for this board
|
||||||
#define I2C_SCL 17 // 2
|
#define I2C_SCL 17 // 2
|
||||||
|
|
||||||
// #define LED_PIN 38 // This is a RGB LED not a standard LED
|
// #define LED_POWER 38 // This is a RGB LED not a standard LED
|
||||||
#define HAS_NEOPIXEL // Enable the use of neopixels
|
#define HAS_NEOPIXEL // Enable the use of neopixels
|
||||||
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
|
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
|
||||||
#define NEOPIXEL_DATA 38 // gpio pin used to send data to the neopixels
|
#define NEOPIXEL_DATA 38 // gpio pin used to send data to the neopixels
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#define I2C_SDA1 45
|
#define I2C_SDA1 45
|
||||||
#define I2C_SCL1 46
|
#define I2C_SCL1 46
|
||||||
|
|
||||||
#define LED_PIN 6
|
#define LED_POWER 6
|
||||||
#define LED_STATE_ON 1
|
#define LED_STATE_ON 1
|
||||||
#define BUTTON_PIN 0
|
#define BUTTON_PIN 0
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#define LED_PIN 33
|
#define LED_POWER 33
|
||||||
#define LED_PIN2 34
|
#define LED_POWER2 34
|
||||||
#define EXT_PWR_DETECT 35
|
#define EXT_PWR_DETECT 35
|
||||||
|
|
||||||
#define BUTTON_PIN 18
|
#define BUTTON_PIN 18
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#define LED_PIN LED
|
#define LED_POWER LED
|
||||||
|
|
||||||
#define USE_SSD1306 // Heltec_v3 has a SSD1306 display
|
#define USE_SSD1306 // Heltec_v3 has a SSD1306 display
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ build_flags =
|
|||||||
${heltec_v4_base.build_flags}
|
${heltec_v4_base.build_flags}
|
||||||
-D HELTEC_V4_OLED
|
-D HELTEC_V4_OLED
|
||||||
-D USE_SSD1306 ; Heltec_v4 has an SSD1315 display (compatible with SSD1306 driver)
|
-D USE_SSD1306 ; Heltec_v4 has an SSD1315 display (compatible with SSD1306 driver)
|
||||||
-D LED_PIN=35
|
-D LED_POWER=35
|
||||||
-D RESET_OLED=21
|
-D RESET_OLED=21
|
||||||
-D I2C_SDA=17
|
-D I2C_SDA=17
|
||||||
-D I2C_SCL=18
|
-D I2C_SCL=18
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#define LED_PIN 45 // LED is not populated on earliest board variant
|
#define LED_POWER 45 // LED is not populated on earliest board variant
|
||||||
#define BUTTON_PIN 0
|
#define BUTTON_PIN 0
|
||||||
#define PIN_BUTTON2 21 // Second built-in button
|
#define PIN_BUTTON2 21 // Second built-in button
|
||||||
#define ALT_BUTTON_PIN PIN_BUTTON2 // Send the up event
|
#define ALT_BUTTON_PIN PIN_BUTTON2 // Send the up event
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#define LED_PIN 45 // LED is not populated on earliest board variant
|
#define LED_POWER 45 // LED is not populated on earliest board variant
|
||||||
#define BUTTON_PIN 0
|
#define BUTTON_PIN 0
|
||||||
#define PIN_BUTTON2 21 // Second built-in button
|
#define PIN_BUTTON2 21 // Second built-in button
|
||||||
#define ALT_BUTTON_PIN PIN_BUTTON2 // Send the up event
|
#define ALT_BUTTON_PIN PIN_BUTTON2 // Send the up event
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#define LED_PIN 18
|
#define LED_POWER 18
|
||||||
#define BUTTON_PIN 0
|
#define BUTTON_PIN 0
|
||||||
|
|
||||||
// I2C
|
// I2C
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#define LED_PIN 18
|
#define LED_POWER 18
|
||||||
#define BUTTON_PIN 0
|
#define BUTTON_PIN 0
|
||||||
|
|
||||||
// I2C
|
// I2C
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#define LED_PIN 18
|
#define LED_POWER 18
|
||||||
|
|
||||||
#define _VARIANT_HELTEC_WIRELESS_TRACKER
|
#define _VARIANT_HELTEC_WIRELESS_TRACKER
|
||||||
#define HELTEC_TRACKER_V1_X
|
#define HELTEC_TRACKER_V1_X
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#define LED_PIN 18
|
#define LED_POWER 18
|
||||||
|
|
||||||
#define HELTEC_TRACKER_V1_X
|
#define HELTEC_TRACKER_V1_X
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#define LED_PIN 18
|
#define LED_POWER 18
|
||||||
|
|
||||||
#define _VARIANT_HELTEC_WIRELESS_TRACKER
|
#define _VARIANT_HELTEC_WIRELESS_TRACKER
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#define I2C_SCL SCL
|
#define I2C_SCL SCL
|
||||||
#define I2C_SDA SDA
|
#define I2C_SDA SDA
|
||||||
|
|
||||||
#define LED_PIN LED
|
#define LED_POWER LED
|
||||||
|
|
||||||
#define VEXT_ENABLE Vext // active low, powers the oled display and the lora antenna boost
|
#define VEXT_ENABLE Vext // active low, powers the oled display and the lora antenna boost
|
||||||
#define VEXT_ON_VALUE LOW
|
#define VEXT_ON_VALUE LOW
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#define ADC_CHANNEL ADC1_GPIO4_CHANNEL
|
#define ADC_CHANNEL ADC1_GPIO4_CHANNEL
|
||||||
|
|
||||||
// LED
|
// LED
|
||||||
#define LED_PIN 21
|
#define LED_POWER 21
|
||||||
|
|
||||||
// Button
|
// Button
|
||||||
#define BUTTON_PIN 0
|
#define BUTTON_PIN 0
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#define I2C_SDA 11 // I2C pins for this board
|
#define I2C_SDA 11 // I2C pins for this board
|
||||||
#define I2C_SCL 10
|
#define I2C_SCL 10
|
||||||
|
|
||||||
#define LED_PIN 1 // If defined we will blink this LED
|
#define LED_POWER 1 // If defined we will blink this LED
|
||||||
|
|
||||||
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
|
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
|
||||||
#define BUTTON_NEED_PULLUP
|
#define BUTTON_NEED_PULLUP
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#define USE_SSD1306
|
#define USE_SSD1306
|
||||||
#define DISPLAY_FLIP_SCREEN
|
#define DISPLAY_FLIP_SCREEN
|
||||||
|
|
||||||
#define LED_PIN 15 // If defined we will blink this LED
|
#define LED_POWER 15 // If defined we will blink this LED
|
||||||
|
|
||||||
#define HAS_NEOPIXEL // Enable the use of neopixels
|
#define HAS_NEOPIXEL // Enable the use of neopixels
|
||||||
#define NEOPIXEL_COUNT 3 // How many neopixels are connected
|
#define NEOPIXEL_COUNT 3 // How many neopixels are connected
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
#define PIN_LED1 LED_GREEN
|
#define PIN_LED1 LED_GREEN
|
||||||
#define LED_NOTIFICATION LED_BLUE
|
#define LED_NOTIFICATION LED_BLUE
|
||||||
|
|
||||||
#define LED_PIN LED_GREEN
|
#define LED_POWER LED_GREEN
|
||||||
#define ledOff(pin) pinMode(pin, INPUT)
|
#define ledOff(pin) pinMode(pin, INPUT)
|
||||||
|
|
||||||
#define LED_STATE_ON 1 // State when LED is litted
|
#define LED_STATE_ON 1 // State when LED is litted
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#define PIN_LED1 LED_GREEN
|
#define PIN_LED1 LED_GREEN
|
||||||
#define LED_NOTIFICATION LED_BLUE
|
#define LED_NOTIFICATION LED_BLUE
|
||||||
|
|
||||||
#define LED_PIN LED_GREEN
|
#define LED_POWER LED_GREEN
|
||||||
#define ledOff(pin) pinMode(pin, INPUT)
|
#define ledOff(pin) pinMode(pin, INPUT)
|
||||||
|
|
||||||
#define LED_STATE_ON 1 // State when LED is litted
|
#define LED_STATE_ON 1 // State when LED is litted
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ Expansion Board Infomation : https://www.seeedstudio.com/Seeeduino-XIAO-Expansio
|
|||||||
L76K GPS Module Information : https://www.seeedstudio.com/L76K-GNSS-Module-for-Seeed-Studio-XIAO-p-5864.html
|
L76K GPS Module Information : https://www.seeedstudio.com/L76K-GNSS-Module-for-Seeed-Studio-XIAO-p-5864.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define LED_PIN 48
|
#define LED_POWER 48
|
||||||
#define LED_STATE_ON 1 // State when LED is lit
|
#define LED_STATE_ON 1 // State when LED is lit
|
||||||
|
|
||||||
#define BUTTON_PIN 21 // This is the Program Button
|
#define BUTTON_PIN 21 // This is the Program Button
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// LED
|
// LED
|
||||||
#define LED_PIN 18
|
#define LED_POWER 18
|
||||||
#define LED_STATE_ON 1 // HIGH = ON
|
#define LED_STATE_ON 1 // HIGH = ON
|
||||||
|
|
||||||
// Battery ADC
|
// Battery ADC
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#define HAS_SCREEN 1 // Allow for OLED Screens on I2C Header of shield
|
#define HAS_SCREEN 1 // Allow for OLED Screens on I2C Header of shield
|
||||||
|
|
||||||
#define LED_PIN 38 // If defined we will blink this LED
|
#define LED_POWER 38 // If defined we will blink this LED
|
||||||
#define BUTTON_PIN 0 // If defined, this will be used for user button presses,
|
#define BUTTON_PIN 0 // If defined, this will be used for user button presses,
|
||||||
|
|
||||||
#define BUTTON_NEED_PULLUP
|
#define BUTTON_NEED_PULLUP
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#define GPS_RX_PIN 44
|
#define GPS_RX_PIN 44
|
||||||
#define GPS_TX_PIN 43
|
#define GPS_TX_PIN 43
|
||||||
|
|
||||||
#define LED_PIN 37
|
#define LED_POWER 37
|
||||||
#define BUTTON_PIN 0
|
#define BUTTON_PIN 0
|
||||||
#define BUTTON_NEED_PULLUP
|
#define BUTTON_NEED_PULLUP
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#define I2C_SDA1 43
|
#define I2C_SDA1 43
|
||||||
#define I2C_SCL1 44
|
#define I2C_SCL1 44
|
||||||
|
|
||||||
#define LED_PIN 37 // If defined we will blink this LED
|
#define LED_POWER 37 // If defined we will blink this LED
|
||||||
#define BUTTON_PIN 0 // If defined, this will be used for user button presses,
|
#define BUTTON_PIN 0 // If defined, this will be used for user button presses,
|
||||||
|
|
||||||
#define BUTTON_NEED_PULLUP
|
#define BUTTON_NEED_PULLUP
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#define LED_PIN 18
|
#define LED_POWER 18
|
||||||
|
|
||||||
#define HELTEC_TRACKER_V1_X
|
#define HELTEC_TRACKER_V1_X
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#define LED_PIN 18
|
#define LED_POWER 18
|
||||||
|
|
||||||
#define HELTEC_TRACKER_V1_X
|
#define HELTEC_TRACKER_V1_X
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#define LED_PIN 18
|
#define LED_POWER 18
|
||||||
|
|
||||||
#define HELTEC_TRACKER_V1_X
|
#define HELTEC_TRACKER_V1_X
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
#define SD_SPI_FREQUENCY 25000000
|
#define SD_SPI_FREQUENCY 25000000
|
||||||
|
|
||||||
#define LED_PIN 13 // the red part of the RGB LED
|
#define LED_POWER 13 // the red part of the RGB LED
|
||||||
#define LED_STATE_ON 0 // State when LED is lit
|
#define LED_STATE_ON 0 // State when LED is lit
|
||||||
|
|
||||||
#define ALT_BUTTON_PIN 21 // Button 3 - square - top button in landscape mode
|
#define ALT_BUTTON_PIN 21 // Button 3 - square - top button in landscape mode
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ build_flags =
|
|||||||
${arduino_base.build_flags}
|
${arduino_base.build_flags}
|
||||||
-D ARCH_PORTDUINO
|
-D ARCH_PORTDUINO
|
||||||
-fPIC
|
-fPIC
|
||||||
|
-D_FORTIFY_SOURCE=2
|
||||||
|
-fstack-protector-all -Wstack-protector --param ssp-buffer-size=4
|
||||||
-Isrc/platform/portduino
|
-Isrc/platform/portduino
|
||||||
-DRADIOLIB_EEPROM_UNSUPPORTED
|
-DRADIOLIB_EEPROM_UNSUPPORTED
|
||||||
-DPORTDUINO_LINUX_HARDWARE
|
-DPORTDUINO_LINUX_HARDWARE
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ extern "C" {
|
|||||||
// LED
|
// LED
|
||||||
#define LED_RED 33
|
#define LED_RED 33
|
||||||
#define LED_POWER LED_RED
|
#define LED_POWER LED_RED
|
||||||
#define LED_CHARGE LED_POWER // Signals the Status LED Module to handle this LED
|
|
||||||
#define LED_GREEN 35
|
#define LED_GREEN 35
|
||||||
#define LED_NOTIFICATION LED_GREEN
|
#define LED_NOTIFICATION LED_GREEN
|
||||||
#define LED_BLUE 37
|
#define LED_BLUE 37
|
||||||
|
|||||||
@@ -32,9 +32,6 @@ const uint32_t g_ADigitalPinMap[] = {
|
|||||||
|
|
||||||
void initVariant()
|
void initVariant()
|
||||||
{
|
{
|
||||||
pinMode(LED_CHARGE, OUTPUT);
|
|
||||||
ledOff(LED_CHARGE);
|
|
||||||
|
|
||||||
pinMode(LED_PAIRING, OUTPUT);
|
pinMode(LED_PAIRING, OUTPUT);
|
||||||
ledOff(LED_PAIRING);
|
ledOff(LED_PAIRING);
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ extern "C" {
|
|||||||
|
|
||||||
// LEDs
|
// LEDs
|
||||||
#define LED_BLUE -1
|
#define LED_BLUE -1
|
||||||
#define LED_CHARGE (12)
|
#define LED_POWER (12)
|
||||||
#define LED_PAIRING (7)
|
#define LED_PAIRING (7)
|
||||||
#define LED_NOTIFICATION LED_PAIRING
|
#define LED_NOTIFICATION LED_PAIRING
|
||||||
|
|
||||||
|
|||||||
@@ -32,9 +32,6 @@ const uint32_t g_ADigitalPinMap[] = {
|
|||||||
|
|
||||||
void initVariant()
|
void initVariant()
|
||||||
{
|
{
|
||||||
pinMode(LED_PIN, OUTPUT);
|
|
||||||
digitalWrite(LED_PIN, LOW);
|
|
||||||
|
|
||||||
pinMode(PIN_3V3_EN, OUTPUT);
|
pinMode(PIN_3V3_EN, OUTPUT);
|
||||||
digitalWrite(PIN_3V3_EN, HIGH);
|
digitalWrite(PIN_3V3_EN, HIGH);
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ extern "C" {
|
|||||||
|
|
||||||
#define PIN_LED1 (32 + 7) // P1.07 Blue D2
|
#define PIN_LED1 (32 + 7) // P1.07 Blue D2
|
||||||
|
|
||||||
#define LED_PIN PIN_LED1
|
#define LED_POWER PIN_LED1
|
||||||
|
|
||||||
#define LED_BLUE -1
|
#define LED_BLUE -1
|
||||||
#define LED_STATE_ON 1 // State when LED is lit
|
#define LED_STATE_ON 1 // State when LED is lit
|
||||||
|
|||||||
@@ -32,9 +32,6 @@ const uint32_t g_ADigitalPinMap[] = {
|
|||||||
|
|
||||||
void initVariant()
|
void initVariant()
|
||||||
{
|
{
|
||||||
pinMode(LED_PIN, OUTPUT);
|
|
||||||
digitalWrite(LED_PIN, LOW);
|
|
||||||
|
|
||||||
pinMode(PIN_3V3_EN, OUTPUT);
|
pinMode(PIN_3V3_EN, OUTPUT);
|
||||||
digitalWrite(PIN_3V3_EN, HIGH);
|
digitalWrite(PIN_3V3_EN, HIGH);
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ extern "C" {
|
|||||||
|
|
||||||
#define PIN_LED1 (32 + 7) // P1.07 Blue D2
|
#define PIN_LED1 (32 + 7) // P1.07 Blue D2
|
||||||
|
|
||||||
#define LED_PIN PIN_LED1
|
#define LED_POWER PIN_LED1
|
||||||
|
|
||||||
#define LED_BLUE -1
|
#define LED_BLUE -1
|
||||||
#define LED_STATE_ON 1 // State when LED is lit
|
#define LED_STATE_ON 1 // State when LED is lit
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ extern "C" {
|
|||||||
|
|
||||||
#define PIN_LED1 (-1)
|
#define PIN_LED1 (-1)
|
||||||
|
|
||||||
#define LED_PIN PIN_LED1
|
#define LED_POWER PIN_LED1
|
||||||
|
|
||||||
#define LED_BLUE -1
|
#define LED_BLUE -1
|
||||||
#define LED_STATE_ON 1 // State when LED is lit
|
#define LED_STATE_ON 1 // State when LED is lit
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ void initVariant()
|
|||||||
pinMode(PIN_LED2, OUTPUT);
|
pinMode(PIN_LED2, OUTPUT);
|
||||||
digitalWrite(PIN_LED2, LOW);
|
digitalWrite(PIN_LED2, LOW);
|
||||||
pinMode(PIN_LED2, OUTPUT);
|
pinMode(PIN_LED2, OUTPUT);
|
||||||
// digitalWrite(LED_PIN, LOW);
|
|
||||||
|
|
||||||
pinMode(GPS_EN, OUTPUT);
|
pinMode(GPS_EN, OUTPUT);
|
||||||
digitalWrite(GPS_EN, HIGH);
|
digitalWrite(GPS_EN, HIGH);
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ static const uint8_t A5 = PIN_A5;
|
|||||||
#define LED_GREEN (13)
|
#define LED_GREEN (13)
|
||||||
#define LED_BLUE (12)
|
#define LED_BLUE (12)
|
||||||
|
|
||||||
#define PIN_LED1 LED_GREEN // PIN_LED1 is used in src/platform/nrf52/architecture.h to define LED_PIN
|
#define PIN_LED1 LED_GREEN // PIN_LED1 is used in src/platform/nrf52/architecture.h to define LED_POWER
|
||||||
#define PIN_LED2 LED_BLUE
|
#define PIN_LED2 LED_BLUE
|
||||||
#define PIN_LED3 LED_RED
|
#define PIN_LED3 LED_RED
|
||||||
|
|
||||||
|
|||||||
@@ -32,10 +32,6 @@ const uint32_t g_ADigitalPinMap[] = {
|
|||||||
|
|
||||||
void initVariant()
|
void initVariant()
|
||||||
{
|
{
|
||||||
// LED1 & LED2
|
|
||||||
pinMode(LED_PIN, OUTPUT);
|
|
||||||
digitalWrite(LED_PIN, LOW);
|
|
||||||
|
|
||||||
pinMode(PIN_3V3_EN, OUTPUT);
|
pinMode(PIN_3V3_EN, OUTPUT);
|
||||||
digitalWrite(PIN_3V3_EN, HIGH);
|
digitalWrite(PIN_3V3_EN, HIGH);
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user