Merge pull request #865 from adafruit/fix-auto-led-conn
stop blink timer in autoConnLed(false)
This commit is contained in:
1 file changed
+7
-2
@@ -561,13 +561,18 @@ int8_t AdafruitBluefruit::getTxPower(void)
|
||||
return _tx_power;
|
||||
}
|
||||
|
||||
void AdafruitBluefruit::autoConnLed(bool enabled)
|
||||
{
|
||||
void AdafruitBluefruit::autoConnLed(bool enabled) {
|
||||
_led_conn = enabled;
|
||||
if (!enabled && _led_blink_th != NULL) {
|
||||
xTimerStop(_led_blink_th, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void AdafruitBluefruit::setConnLedInterval(uint32_t ms)
|
||||
{
|
||||
// Timer is created in begin(); if called earlier, just ignore.
|
||||
if (_led_blink_th == NULL) return;
|
||||
|
||||
BaseType_t active = xTimerIsTimerActive(_led_blink_th);
|
||||
xTimerChangePeriod(_led_blink_th, ms2tick(ms), 0);
|
||||
|
||||
|
||||
Reference in new issue
Block a user