From 9b71709c130ae16411d8b9f1163439f142084b41 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 15 Sep 2017 17:36:42 +0700 Subject: [PATCH] defer callback for hw encoder to ada callback --- changelog.md | 1 + libraries/RotaryEncoder/RotaryEncoder.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 3eb65f0e..007770af 100644 --- a/changelog.md +++ b/changelog.md @@ -8,6 +8,7 @@ - Added systemOff() to enter hibernate mode - Correct waitForEvent() function with SoftDevice enabled and disabled. - Added RotaryEncoder support for both Hardware and Software Encoder. +- Ada Callback task is started along with loop task, used as worker thread to defer interrupt callback. ## 0.7.0 diff --git a/libraries/RotaryEncoder/RotaryEncoder.cpp b/libraries/RotaryEncoder/RotaryEncoder.cpp index 2ec9b817..38f457e3 100644 --- a/libraries/RotaryEncoder/RotaryEncoder.cpp +++ b/libraries/RotaryEncoder/RotaryEncoder.cpp @@ -198,7 +198,7 @@ void HwRotaryEncoder::_irq_handler(void) if ( _cb ) { int32_t step = read(); - if ( step ) _cb(step); + if ( step ) ada_callback(NULL, _cb, step); } } }