Moved fiber_remove_idle_component inside condition which delays BLE disconnect

This commit is contained in:
Martin Woolley 2016-12-20 17:31:40 +00:00
parent 404c46251b
commit 673c16c0ef

View file

@ -496,11 +496,12 @@ void MicroBitBLEManager::idleTick()
if((system_timer_current_time() - pairing_completed_at_time) >= MICROBIT_BLE_DISCONNECT_AFTER_PAIRING_DELAY) {
if (ble)
ble->disconnect(pairingHandle, Gap::REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF);
fiber_remove_idle_component(this);
}
fiber_remove_idle_component(this);
}
/**
* Stops any currently running BLE advertisements
*/