Skip to content

Commit 98efb25

Browse files
authored
Thinknode_m5 minor fixes (meshtastic#10049)
1 parent 8dc3c05 commit 98efb25

5 files changed

Lines changed: 15 additions & 8 deletions

File tree

src/mesh/NodeDB.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ void NodeDB::installDefaultModuleConfig()
819819
moduleConfig.has_store_forward = true;
820820
moduleConfig.has_telemetry = true;
821821
moduleConfig.has_external_notification = true;
822-
#if defined(PIN_BUZZER) || defined(PIN_VIBRATION) || defined(LED_NOTIFICATION)
822+
#if defined(PIN_BUZZER) || defined(PIN_VIBRATION) || defined(LED_NOTIFICATION) || defined(PCA_LED_NOTIFICATION)
823823
moduleConfig.external_notification.enabled = true;
824824
#endif
825825
#if defined(PIN_BUZZER)

src/modules/ExternalNotificationModule.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ void ExternalNotificationModule::setExternalState(uint8_t index, bool on)
203203
default:
204204
if (output > 0)
205205
digitalWrite(output, (moduleConfig.external_notification.active ? on : !on));
206+
#ifdef PCA_LED_NOTIFICATION
207+
io.digitalWrite(PCA_LED_NOTIFICATION, on);
208+
209+
#endif
206210
break;
207211
}
208212

src/platform/esp32/main-esp32.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ void cpuDeepSleep(uint32_t msecToWake)
231231
#if SOC_RTCIO_HOLD_SUPPORTED && SOC_PM_SUPPORT_EXT_WAKEUP
232232
uint64_t gpioMask = (1ULL << (config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN));
233233
#endif
234-
234+
#ifdef ALT_BUTTON_WAKE
235+
gpioMask |= (1ULL << BUTTON_PIN_ALT);
236+
#endif
235237
#ifdef BUTTON_NEED_PULLUP
236238
gpio_pullup_en((gpio_num_t)BUTTON_PIN);
237239
#endif

variants/esp32s3/ELECROW-ThinkNode-M5/variant.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ void earlyInitVariant()
99
io.pinMode(PCA_PIN_EINK_EN, OUTPUT);
1010
io.pinMode(PCA_PIN_POWER_EN, OUTPUT);
1111
io.pinMode(PCA_LED_POWER, OUTPUT);
12-
io.pinMode(PCA_LED_USER, OUTPUT);
12+
io.pinMode(PCA_LED_NOTIFICATION, OUTPUT);
1313
io.pinMode(PCA_LED_ENABLE, OUTPUT);
1414

1515
io.digitalWrite(PCA_PIN_POWER_EN, HIGH);
16-
io.digitalWrite(PCA_LED_USER, LOW);
16+
io.digitalWrite(PCA_LED_NOTIFICATION, LOW);
1717
io.digitalWrite(PCA_LED_ENABLE, LOW);
1818
}
1919

variants/esp32s3/ELECROW-ThinkNode-M5/variant.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88

99
// LED
1010
// Both of these are on the GPIO expander
11-
#define PCA_LED_USER 1 // the Blue LED
12-
#define PCA_LED_ENABLE 2 // the power supply to the LEDs, in an OR arrangement with VBUS power
13-
#define PCA_LED_POWER 3 // the Red LED? Seems to have hardware logic to blink when USB is plugged in.
11+
#define PCA_LED_NOTIFICATION 1 // the Blue LED
12+
#define PCA_LED_ENABLE 2 // the power supply to the LEDs, in an OR arrangement with VBUS power
13+
#define PCA_LED_POWER 3 // the Red LED? Seems to have hardware logic to blink when USB is plugged in.
1414
#define POWER_LED_HARDWARE_BLINKS_WHILE_CHARGING
1515

1616
// USB_CHECK
1717
#define EXT_PWR_DETECT 12
1818
#define BATTERY_PIN 8
1919
#define ADC_CHANNEL ADC1_GPIO8_CHANNEL
2020

21-
#define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage.
21+
#define ADC_MULTIPLIER 2.0 // 2.0 + 10% for correction of display undervoltage.
2222

2323
#define PIN_BUZZER 9
2424

@@ -86,6 +86,7 @@
8686

8787
#define BUTTON_PIN PIN_BUTTON1
8888
#define BUTTON_PIN_ALT PIN_BUTTON2
89+
#define ALT_BUTTON_WAKE
8990

9091
#define SERIAL_PRINT_PORT 0
9192
#endif

0 commit comments

Comments
 (0)