ble nano hid over gatt
Dependencies: BLE_API mbed-dev nRF51822
Diff: HIDController_BLE.cpp
- Revision:
- 21:d801c32231b0
- Parent:
- 20:d8840ac38434
- Child:
- 22:a78f0a91280a
--- a/HIDController_BLE.cpp Mon Aug 22 14:37:16 2016 +0000 +++ b/HIDController_BLE.cpp Mon Aug 22 14:59:41 2016 +0000 @@ -60,6 +60,9 @@ // Read ADC result uint16_t raw10bit = static_cast<uint16_t>(NRF_ADC->RESULT); + + NRF_ADC->ENABLE = ADC_ENABLE_ENABLE_Disabled; + float ratio = raw10bit / static_cast<float>(1<<10); float batteryVoltage = ratio * (REFERNECE * PRESCALE); @@ -260,6 +263,7 @@ void HIDController::waitForEvent() { BLE& ble = BLE::Instance(BLE::DEFAULT_INSTANCE); + keyboardService->stopReportTicker(); ble.waitForEvent(); }