Skip to content

Commit 0e6562d

Browse files
hathachCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent ec0a415 commit 0e6562d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

libraries/Bluefruit52Lib/src/bluefruit.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,13 +563,16 @@ int8_t AdafruitBluefruit::getTxPower(void)
563563

564564
void AdafruitBluefruit::autoConnLed(bool enabled) {
565565
_led_conn = enabled;
566-
if (!enabled) {
566+
if (!enabled && _led_blink_th != NULL) {
567567
xTimerStop(_led_blink_th, 0);
568568
}
569569
}
570570

571571
void AdafruitBluefruit::setConnLedInterval(uint32_t ms)
572572
{
573+
// Timer is created in begin(); if called earlier, just ignore.
574+
if (_led_blink_th == NULL) return;
575+
573576
BaseType_t active = xTimerIsTimerActive(_led_blink_th);
574577
xTimerChangePeriod(_led_blink_th, ms2tick(ms), 0);
575578

0 commit comments

Comments
 (0)