From 4384aeaa986b1ff19f399d50bd450c3275e76cd4 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 1 Sep 2017 19:27:28 +0700 Subject: [PATCH] clean up --- .../Peripheral/StandardFirmataBLE/StandardFirmataBLE.ino | 7 ++++++- .../examples/Peripheral/custom_hrm/custom_hrm.ino | 3 --- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/Bluefruit52Lib/examples/Peripheral/StandardFirmataBLE/StandardFirmataBLE.ino b/libraries/Bluefruit52Lib/examples/Peripheral/StandardFirmataBLE/StandardFirmataBLE.ino index f1c44878..a2f5cde2 100644 --- a/libraries/Bluefruit52Lib/examples/Peripheral/StandardFirmataBLE/StandardFirmataBLE.ino +++ b/libraries/Bluefruit52Lib/examples/Peripheral/StandardFirmataBLE/StandardFirmataBLE.ino @@ -861,7 +861,12 @@ void startAdv(void) void loop() { // Skip if not connected and bleuart notification is enabled - if ( !(Bluefruit.connected() && bleuart.notifyEnabled()) ) return; + if ( !(Bluefruit.connected() && bleuart.notifyEnabled()) ) + { + // go to low power mode since there is nothing to do + waitForEvent(); + return; + } byte pin, analogPin; diff --git a/libraries/Bluefruit52Lib/examples/Peripheral/custom_hrm/custom_hrm.ino b/libraries/Bluefruit52Lib/examples/Peripheral/custom_hrm/custom_hrm.ino index f40f0419..983d7fc2 100644 --- a/libraries/Bluefruit52Lib/examples/Peripheral/custom_hrm/custom_hrm.ino +++ b/libraries/Bluefruit52Lib/examples/Peripheral/custom_hrm/custom_hrm.ino @@ -222,9 +222,6 @@ void loop() // Only send update once per second delay(1000); - - // No need to call waitForEvent() here, it will be invoked by - // rtos_idle_callback() caused by above delay() } /**