Add a watchdog module to meshsolar. (#9337)

* add watchdog module

* Restore the code in power.h

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Quency-D
2026-01-29 10:41:27 +08:00
committed by GitHub
parent df400850c1
commit b2f2f6b305
4 changed files with 75 additions and 7 deletions

View File

@@ -39,15 +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_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
@@ -59,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
@@ -137,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