mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-29 13:12:04 +00:00
Merge branch 'develop' into remove-canned-define
This commit is contained in:
@@ -56,6 +56,7 @@ 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,6 +1,7 @@
|
||||
#include "configuration.h"
|
||||
#if !MESHTASTIC_EXCLUDE_INPUTBROKER
|
||||
#include "buzz/BuzzerFeedbackThread.h"
|
||||
#include "modules/StatusLEDModule.h"
|
||||
#include "modules/SystemCommandsModule.h"
|
||||
#endif
|
||||
#if !MESHTASTIC_EXCLUDE_PKI
|
||||
@@ -90,6 +91,9 @@
|
||||
#include "modules/DropzoneModule.h"
|
||||
#endif
|
||||
|
||||
#if defined(HAS_HARDWARE_WATCHDOG)
|
||||
#include "watchdog/watchdogThread.h"
|
||||
#endif
|
||||
/**
|
||||
* Create module instances here. If you are adding a new module, you must 'new' it here (or somewhere else)
|
||||
*/
|
||||
@@ -228,6 +232,9 @@ void setupModules()
|
||||
#if !MESHTASTIC_EXCLUDE_RANGETEST && !MESHTASTIC_EXCLUDE_GPS
|
||||
if (moduleConfig.has_range_test && moduleConfig.range_test.enabled)
|
||||
new RangeTestModule();
|
||||
#endif
|
||||
#if defined(HAS_HARDWARE_WATCHDOG)
|
||||
watchdogThread = new WatchdogThread();
|
||||
#endif
|
||||
// NOTE! This module must be added LAST because it likes to check for replies from other modules and avoid sending extra
|
||||
// acks
|
||||
|
||||
@@ -529,37 +529,46 @@ bool EnvironmentTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPac
|
||||
|
||||
bool EnvironmentTelemetryModule::getEnvironmentTelemetry(meshtastic_Telemetry *m)
|
||||
{
|
||||
bool valid = true;
|
||||
bool valid = false;
|
||||
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) {
|
||||
valid = valid && sensor->getMetrics(m);
|
||||
get_metrics = sensor->getMetrics(m); // avoid short-circuit evaluation rules
|
||||
valid = valid || get_metrics;
|
||||
hasSensor = true;
|
||||
}
|
||||
|
||||
#ifndef T1000X_SENSOR_EN
|
||||
if (ina219Sensor.hasSensor()) {
|
||||
valid = valid && ina219Sensor.getMetrics(m);
|
||||
get_metrics = ina219Sensor.getMetrics(m);
|
||||
valid = valid || get_metrics;
|
||||
hasSensor = true;
|
||||
}
|
||||
if (ina260Sensor.hasSensor()) {
|
||||
valid = valid && ina260Sensor.getMetrics(m);
|
||||
get_metrics = ina260Sensor.getMetrics(m);
|
||||
valid = valid || get_metrics;
|
||||
hasSensor = true;
|
||||
}
|
||||
if (ina3221Sensor.hasSensor()) {
|
||||
valid = valid && ina3221Sensor.getMetrics(m);
|
||||
get_metrics = ina3221Sensor.getMetrics(m);
|
||||
valid = valid || get_metrics;
|
||||
hasSensor = true;
|
||||
}
|
||||
if (max17048Sensor.hasSensor()) {
|
||||
valid = valid && max17048Sensor.getMetrics(m);
|
||||
get_metrics = max17048Sensor.getMetrics(m);
|
||||
valid = valid || get_metrics;
|
||||
hasSensor = true;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAS_RAKPROT
|
||||
valid = valid && rak9154Sensor.getMetrics(m);
|
||||
get_metrics = rak9154Sensor.getMetrics(m);
|
||||
valid = valid || get_metrics;
|
||||
hasSensor = true;
|
||||
#endif
|
||||
return valid && hasSensor;
|
||||
|
||||
@@ -168,18 +168,21 @@ bool HealthTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPacket &
|
||||
|
||||
bool HealthTelemetryModule::getHealthTelemetry(meshtastic_Telemetry *m)
|
||||
{
|
||||
bool valid = true;
|
||||
bool valid = false;
|
||||
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()) {
|
||||
valid = valid && max30102Sensor.getMetrics(m);
|
||||
get_metrics = max30102Sensor.getMetrics(m);
|
||||
valid = valid || get_metrics; // avoid short-circuit evaluation rules
|
||||
hasSensor = true;
|
||||
}
|
||||
if (mlx90614Sensor.hasSensor()) {
|
||||
valid = valid && mlx90614Sensor.getMetrics(m);
|
||||
get_metrics = mlx90614Sensor.getMetrics(m);
|
||||
valid = valid || get_metrics;
|
||||
hasSensor = true;
|
||||
}
|
||||
|
||||
|
||||
37
src/watchdog/watchdogThread.cpp
Normal file
37
src/watchdog/watchdogThread.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#include "watchdogThread.h"
|
||||
#include "configuration.h"
|
||||
|
||||
#ifdef HAS_HARDWARE_WATCHDOG
|
||||
WatchdogThread *watchdogThread;
|
||||
|
||||
WatchdogThread::WatchdogThread() : OSThread("Watchdog")
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
void WatchdogThread::feedDog(void)
|
||||
{
|
||||
digitalWrite(HARDWARE_WATCHDOG_DONE, HIGH);
|
||||
delay(1);
|
||||
digitalWrite(HARDWARE_WATCHDOG_DONE, LOW);
|
||||
}
|
||||
|
||||
int32_t WatchdogThread::runOnce()
|
||||
{
|
||||
LOG_DEBUG("Feeding hardware watchdog");
|
||||
feedDog();
|
||||
return HARDWARE_WATCHDOG_TIMEOUT_MS;
|
||||
}
|
||||
|
||||
bool WatchdogThread::setup()
|
||||
{
|
||||
LOG_DEBUG("init hardware watchdog");
|
||||
pinMode(HARDWARE_WATCHDOG_WAKE, INPUT);
|
||||
pinMode(HARDWARE_WATCHDOG_DONE, OUTPUT);
|
||||
delay(1);
|
||||
digitalWrite(HARDWARE_WATCHDOG_DONE, LOW);
|
||||
delay(1);
|
||||
feedDog();
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
19
src/watchdog/watchdogThread.h
Normal file
19
src/watchdog/watchdogThread.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include "concurrency/OSThread.h"
|
||||
|
||||
#ifdef HAS_HARDWARE_WATCHDOG
|
||||
class WatchdogThread : private concurrency::OSThread
|
||||
{
|
||||
public:
|
||||
|
||||
WatchdogThread();
|
||||
void feedDog(void);
|
||||
virtual bool setup();
|
||||
virtual int32_t runOnce() override;
|
||||
|
||||
};
|
||||
|
||||
extern WatchdogThread *watchdogThread;
|
||||
#endif
|
||||
@@ -8,6 +8,7 @@ build_flags =
|
||||
-I variants/esp32/chatter2
|
||||
-DMESHTASTIC_EXCLUDE_WEBSERVER=1
|
||||
-DMESHTASTIC_EXCLUDE_PAXCOUNTER=1
|
||||
-ULED_BUILTIN
|
||||
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
|
||||
@@ -14,3 +14,4 @@ build_flags =
|
||||
${esp32_base.build_flags}
|
||||
-D DIY_V1
|
||||
-I variants/esp32/diy/hydra
|
||||
-ULED_BUILTIN
|
||||
|
||||
@@ -17,3 +17,4 @@ build_flags =
|
||||
-D DIY_V1
|
||||
-D EBYTE_E22
|
||||
-I variants/esp32/diy/v1
|
||||
-ULED_BUILTIN
|
||||
|
||||
@@ -14,3 +14,4 @@ build_flags =
|
||||
${esp32_base.build_flags}
|
||||
-D NANO_G1_EXPLORER
|
||||
-I variants/esp32/nano-g1-explorer
|
||||
-ULED_BUILTIN
|
||||
|
||||
@@ -14,3 +14,4 @@ build_flags =
|
||||
${esp32_base.build_flags}
|
||||
-D NANO_G1
|
||||
-I variants/esp32/nano-g1
|
||||
-ULED_BUILTIN
|
||||
|
||||
@@ -9,6 +9,7 @@ build_flags =
|
||||
-DHAS_STK8XXX=1
|
||||
-O2
|
||||
-I variants/esp32/radiomaster_900_bandit
|
||||
-ULED_BUILTIN
|
||||
board_build.f_cpu = 240000000L
|
||||
upload_protocol = esptool
|
||||
lib_deps =
|
||||
|
||||
@@ -13,5 +13,6 @@ build_flags =
|
||||
-DCONFIG_DISABLE_HAL_LOCKS=1
|
||||
-O2
|
||||
-I variants/esp32/radiomaster_900_bandit_nano
|
||||
-ULED_BUILTIN
|
||||
board_build.f_cpu = 240000000L
|
||||
upload_protocol = esptool
|
||||
|
||||
@@ -16,5 +16,6 @@ build_flags =
|
||||
-DCONFIG_DISABLE_HAL_LOCKS=1
|
||||
-O2
|
||||
-I variants/esp32/radiomaster_900_bandit_nano
|
||||
-ULED_BUILTIN
|
||||
board_build.f_cpu = 240000000L
|
||||
upload_protocol = esptool
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
#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,8 +6,6 @@
|
||||
#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;
|
||||
|
||||
|
||||
@@ -14,3 +14,4 @@ build_flags =
|
||||
${esp32_base.build_flags}
|
||||
-D STATION_G1
|
||||
-I variants/esp32/station-g1
|
||||
-ULED_BUILTIN
|
||||
|
||||
@@ -18,6 +18,7 @@ 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]
|
||||
|
||||
@@ -12,7 +12,7 @@ extends = esp32_base
|
||||
board = ttgo-lora32-v21
|
||||
board_check = true
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D TLORA_V2_1_16 -I variants/esp32/tlora_v2_1_16
|
||||
${esp32_base.build_flags} -D TLORA_V2_1_16 -I variants/esp32/tlora_v2_1_16 -ULED_BUILTIN
|
||||
upload_speed = 115200
|
||||
|
||||
[env:sugarcube]
|
||||
|
||||
@@ -6,4 +6,5 @@ build_flags =
|
||||
-D TLORA_V2_1_16
|
||||
-I variants/esp32/tlora_v2_1_16
|
||||
-D LORA_TCXO_GPIO=12
|
||||
-D BUTTON_PIN=0
|
||||
-D BUTTON_PIN=0
|
||||
-ULED_BUILTIN
|
||||
@@ -8,3 +8,4 @@ build_flags =
|
||||
-I variants/esp32c6/tlora_c6
|
||||
-DARDUINO_USB_CDC_ON_BOOT=1
|
||||
-DARDUINO_USB_MODE=1
|
||||
-ULED_BUILTIN
|
||||
|
||||
@@ -6,4 +6,5 @@ board_build.partitions = default_8MB.csv
|
||||
build_flags =
|
||||
${esp32s3_base.build_flags} -I variants/esp32s3/heltec_capsule_sensor_v3
|
||||
-D HELTEC_CAPSULE_SENSOR_V3
|
||||
-ULED_BUILTIN
|
||||
;-D DEBUG_DISABLED ; uncomment this line to disable DEBUG output
|
||||
|
||||
@@ -7,6 +7,7 @@ build_flags =
|
||||
${esp32s3_base.build_flags}
|
||||
-I variants/esp32s3/heltec_sensor_hub
|
||||
-D HELTEC_SENSOR_HUB
|
||||
-ULED_BUILTIN
|
||||
|
||||
lib_deps = ${esp32s3_base.lib_deps}
|
||||
# renovate: datasource=custom.pio depName=NeoPixel packageName=adafruit/library/Adafruit NeoPixel
|
||||
|
||||
@@ -18,3 +18,4 @@ build_flags =
|
||||
${esp32s3_base.build_flags}
|
||||
-D HELTEC_V3
|
||||
-I variants/esp32s3/heltec_v3
|
||||
-ULED_BUILTIN
|
||||
|
||||
@@ -6,10 +6,6 @@
|
||||
#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,10 +3,6 @@
|
||||
|
||||
#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,10 +3,6 @@
|
||||
|
||||
#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,10 +3,6 @@
|
||||
|
||||
#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,10 +3,6 @@
|
||||
|
||||
#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,10 +3,6 @@
|
||||
|
||||
#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,10 +11,6 @@
|
||||
#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,10 +11,6 @@
|
||||
#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,10 +10,6 @@
|
||||
#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;
|
||||
|
||||
|
||||
@@ -17,3 +17,4 @@ build_flags =
|
||||
${esp32s3_base.build_flags}
|
||||
-D HELTEC_WSL_V3
|
||||
-I variants/esp32s3/heltec_wsl_v3
|
||||
-ULED_BUILTIN
|
||||
|
||||
@@ -10,10 +10,7 @@
|
||||
// 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)
|
||||
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_BUILTIN SOC_GPIO_PIN_COUNT + 48
|
||||
#define RGB_BRIGHTNESS 64
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
|
||||
@@ -49,10 +49,6 @@ 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,9 +24,6 @@ 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,7 +22,4 @@ 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,8 +3,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// static const uint8_t LED_BUILTIN = -1;
|
||||
|
||||
// static const uint8_t TX = 43;
|
||||
// static const uint8_t RX = 44;
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
#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,8 +3,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// static const uint8_t LED_BUILTIN = -1;
|
||||
|
||||
// static const uint8_t TX = 43;
|
||||
// static const uint8_t RX = 44;
|
||||
|
||||
|
||||
@@ -11,10 +11,6 @@
|
||||
#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,10 +11,6 @@
|
||||
#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,10 +11,6 @@
|
||||
#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,9 +6,6 @@
|
||||
#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,7 +50,6 @@ 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,7 +55,6 @@ 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)
|
||||
|
||||
@@ -58,7 +58,6 @@ 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
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ 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)
|
||||
|
||||
@@ -40,7 +40,6 @@ 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,7 +51,6 @@ 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,7 +51,6 @@ 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,7 +51,6 @@ 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,7 +29,6 @@ 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,7 +29,6 @@ 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,7 +34,6 @@ 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,7 +52,6 @@ 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
|
||||
|
||||
@@ -81,7 +81,6 @@ 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,7 +38,6 @@ 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,7 +44,6 @@ 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,8 +49,6 @@ 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,7 +48,6 @@ 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,7 +30,6 @@ 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,7 +74,6 @@ 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,7 +26,6 @@ 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
|
||||
|
||||
|
||||
@@ -39,16 +39,15 @@ extern "C" {
|
||||
#define NUM_ANALOG_INPUTS (1)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
#define PIN_LED1 (0 + 4) // green (confirmed on 1.0 board)
|
||||
#define PIN_LED1 (32 + 15) // 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
|
||||
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
|
||||
#define NEOPIXEL_DATA (32 + 15) // gpio pin used to send data to the neopixels
|
||||
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
|
||||
// #define HAS_NEOPIXEL // Enable the use of neopixels
|
||||
// #define NEOPIXEL_COUNT 1 // How many neopixels are connected
|
||||
// #define NEOPIXEL_DATA (32 + 15) // gpio pin used to send data to the neopixels
|
||||
// #define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
|
||||
|
||||
/*
|
||||
* Buttons
|
||||
@@ -60,8 +59,8 @@ extern "C" {
|
||||
/*
|
||||
No longer populated on PCB
|
||||
*/
|
||||
#define PIN_SERIAL2_RX (0 + 9)
|
||||
#define PIN_SERIAL2_TX (0 + 10)
|
||||
#define PIN_SERIAL2_RX (-1)
|
||||
#define PIN_SERIAL2_TX (-1)
|
||||
|
||||
/*
|
||||
* I2C
|
||||
@@ -138,6 +137,12 @@ No longer populated on PCB
|
||||
// To debug via the segger JLINK console rather than the CDC-ACM serial device
|
||||
// #define USE_SEGGER
|
||||
|
||||
// Hardware watchdog
|
||||
#define HAS_HARDWARE_WATCHDOG
|
||||
#define HARDWARE_WATCHDOG_DONE (0 + 9)
|
||||
#define HARDWARE_WATCHDOG_WAKE (0 + 10)
|
||||
#define HARDWARE_WATCHDOG_TIMEOUT_MS (6*60*1000) // 6 minute watchdog
|
||||
|
||||
#define BQ4050_SDA_PIN (32 + 1) // I2C data line pin
|
||||
#define BQ4050_SCL_PIN (32 + 0) // I2C clock line pin
|
||||
#define BQ4050_EMERGENCY_SHUTDOWN_PIN (32 + 3) // Emergency shutdown pin
|
||||
|
||||
@@ -31,7 +31,6 @@ 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
|
||||
|
||||
@@ -49,7 +49,6 @@ 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,7 +52,6 @@ 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,7 +45,6 @@ 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
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@ 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,7 +47,6 @@ 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,7 +48,6 @@ 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,7 +47,6 @@ 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,7 +47,6 @@ 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,7 +47,6 @@ 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,7 +29,6 @@ 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,7 +47,6 @@ 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,7 +47,6 @@ 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,7 +47,6 @@ 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,7 +47,6 @@ 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,7 +23,6 @@
|
||||
#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,7 +23,6 @@
|
||||
#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,7 +23,6 @@
|
||||
#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,8 +69,6 @@ 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,7 +52,6 @@ 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
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ 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
|
||||
|
||||
@@ -52,7 +52,6 @@ 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
|
||||
|
||||
@@ -48,7 +48,6 @@ 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,8 +58,6 @@ 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,7 +48,6 @@ 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,8 +54,6 @@ 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,8 +45,6 @@
|
||||
#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,7 +26,6 @@ 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 LED_BUILTIN
|
||||
#define LED_PIN PIN_LED
|
||||
#define ledOff(pin) pinMode(pin, INPUT)
|
||||
|
||||
#define BUTTON_PIN 9
|
||||
|
||||
@@ -22,6 +22,7 @@ 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 LED_BUILTIN
|
||||
#define LED_PIN PIN_LED
|
||||
|
||||
#define BATTERY_PIN 26
|
||||
// ratio of voltage divider = 3.0 (R17=200k, R18=100k)
|
||||
|
||||
@@ -13,7 +13,6 @@ 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,9 +19,4 @@ Do not expect a working Meshtastic device with this target.
|
||||
|
||||
#define WIO_E5
|
||||
|
||||
#if (defined(LED_BUILTIN) && LED_BUILTIN == PNUM_NOT_DEFINED)
|
||||
#undef LED_BUILTIN
|
||||
#define LED_BUILTIN (LED_PIN)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user