fix #142 add destructor for SoftwareTimer

This commit is contained in:
hathach committed 2018-04-08 13:43:26 +07:00
1 parent 2938ca0a6c
commit 620470d5dc
2 files changed
+3 -2

No files matched your search

+2 -1
View File
@@ -44,7 +44,8 @@ class SoftwareTimer
TimerHandle_t _handle;
public:
SoftwareTimer() { _handle = NULL; }
SoftwareTimer() { _handle = NULL; }
virtual ~SoftwareTimer() { if(_handle != NULL) xTimerDelete(_handle, 0); }
void begin(uint32_t ms, TimerCallbackFunction_t callback)
{
+1 -1
View File
@@ -165,7 +165,7 @@ void BLECentral::_event_handler(ble_evt_t* evt)
case BLE_GAP_EVT_DISCONNECTED:
if ( Bluefruit.Gap.getRole(evt_conn_hdl) == BLE_GAP_ROLE_CENTRAL)
{
// Invoke callback
// Invoke callback reason is BLE_HCI_STATUS code
if ( _disconnect_cb) ada_callback(NULL, _disconnect_cb, evt_conn_hdl, evt->evt.gap_evt.params.disconnected.reason);
}
break;