From 75d2a8009e15cb3a4bb68914b84ff773bfb9f26b Mon Sep 17 00:00:00 2001 From: Pol Van Aubel Date: Thu, 2 May 2019 01:07:22 +0200 Subject: [PATCH 1/8] Extend SoftwareTimer with ISR-safe functions. --- cores/nRF5/utility/SoftwareTimer.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cores/nRF5/utility/SoftwareTimer.h b/cores/nRF5/utility/SoftwareTimer.h index ac724431..a36731d1 100644 --- a/cores/nRF5/utility/SoftwareTimer.h +++ b/cores/nRF5/utility/SoftwareTimer.h @@ -52,6 +52,11 @@ class SoftwareTimer _handle = xTimerCreate(NULL, ms2tick(ms), true, NULL, callback); } + void begin(uint32_t ms, TimerCallbackFunction_t callback, bool repeating) + { + _handle = xTimerCreate(NULL, ms2tick(ms), repeating, NULL, callback); + } + TimerHandle_t getHandle(void) { return _handle; @@ -59,6 +64,17 @@ class SoftwareTimer void start(void) { xTimerStart(_handle, 0); } void stop (void) { xTimerStop (_handle, 0); } + void reset(void) { xTimerReset(_handle, 0); } + + BaseType_t startFromISR(BaseType_t* pxHigherPriorityTaskWoken) { + return xTimerStartFromISR(_handle, pxHigherPriorityTaskWoken); + } + BaseType_t stopFromISR(BaseType_t* pxHigherPriorityTaskWoken) { + return xTimerStopFromISR (_handle, pxHigherPriorityTaskWoken); + } + BaseType_t resetFromISR(BaseType_t* pxHigherPriorityTaskWoken) { + return xTimerResetFromISR(_handle, pxHigherPriorityTaskWoken); + } void setPeriod(uint32_t ms) { From 6b9331883d8ea56b710af28c6c444f57cc8c4c53 Mon Sep 17 00:00:00 2001 From: Pol Van Aubel Date: Fri, 3 May 2019 11:34:08 +0200 Subject: [PATCH 2/8] Add default and clean up superfluous begin function. --- cores/nRF5/utility/SoftwareTimer.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cores/nRF5/utility/SoftwareTimer.h b/cores/nRF5/utility/SoftwareTimer.h index a36731d1..dbeb01d4 100644 --- a/cores/nRF5/utility/SoftwareTimer.h +++ b/cores/nRF5/utility/SoftwareTimer.h @@ -47,12 +47,7 @@ class SoftwareTimer SoftwareTimer() { _handle = NULL; } virtual ~SoftwareTimer() { if(_handle != NULL) xTimerDelete(_handle, 0); } - void begin(uint32_t ms, TimerCallbackFunction_t callback) - { - _handle = xTimerCreate(NULL, ms2tick(ms), true, NULL, callback); - } - - void begin(uint32_t ms, TimerCallbackFunction_t callback, bool repeating) + void begin(uint32_t ms, TimerCallbackFunction_t callback, bool repeating = true) { _handle = xTimerCreate(NULL, ms2tick(ms), repeating, NULL, callback); } From 5b6e35d4e08471d5128cc328fc71d8532c5c08a8 Mon Sep 17 00:00:00 2001 From: Pol Van Aubel Date: Sat, 4 May 2019 04:23:39 +0200 Subject: [PATCH 3/8] Add defaults for pxHigherPriorityTaskWoken. --- cores/nRF5/utility/SoftwareTimer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cores/nRF5/utility/SoftwareTimer.h b/cores/nRF5/utility/SoftwareTimer.h index dbeb01d4..ba6920f6 100644 --- a/cores/nRF5/utility/SoftwareTimer.h +++ b/cores/nRF5/utility/SoftwareTimer.h @@ -61,13 +61,13 @@ class SoftwareTimer void stop (void) { xTimerStop (_handle, 0); } void reset(void) { xTimerReset(_handle, 0); } - BaseType_t startFromISR(BaseType_t* pxHigherPriorityTaskWoken) { + BaseType_t startFromISR(BaseType_t* pxHigherPriorityTaskWoken = NULL) { return xTimerStartFromISR(_handle, pxHigherPriorityTaskWoken); } - BaseType_t stopFromISR(BaseType_t* pxHigherPriorityTaskWoken) { + BaseType_t stopFromISR(BaseType_t* pxHigherPriorityTaskWoken = NULL) { return xTimerStopFromISR (_handle, pxHigherPriorityTaskWoken); } - BaseType_t resetFromISR(BaseType_t* pxHigherPriorityTaskWoken) { + BaseType_t resetFromISR(BaseType_t* pxHigherPriorityTaskWoken = NULL) { return xTimerResetFromISR(_handle, pxHigherPriorityTaskWoken); } From 2c3bb1c8fb6b1b4e0eef0913acbc99397a9084af Mon Sep 17 00:00:00 2001 From: ogatatsu Date: Sat, 11 May 2019 15:39:59 +0900 Subject: [PATCH 4/8] Fix connection handle in BLEHidAdafruit single connection api --- .../src/services/BLEHidAdafruit.cpp | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/libraries/Bluefruit52Lib/src/services/BLEHidAdafruit.cpp b/libraries/Bluefruit52Lib/src/services/BLEHidAdafruit.cpp index 9472e6ee..73772443 100644 --- a/libraries/Bluefruit52Lib/src/services/BLEHidAdafruit.cpp +++ b/libraries/Bluefruit52Lib/src/services/BLEHidAdafruit.cpp @@ -386,78 +386,78 @@ bool BLEHidAdafruit::mousePan(uint16_t conn_hdl, int8_t pan) //------------- Keyboard -------------// bool BLEHidAdafruit::keyboardReport(hid_keyboard_report_t* report) { - return keyboardReport(BLE_GATT_HANDLE_INVALID, report); + return keyboardReport(BLE_CONN_HANDLE_INVALID, report); } bool BLEHidAdafruit::keyboardReport(uint8_t modifier, uint8_t keycode[6]) { - return keyboardReport(BLE_GATT_HANDLE_INVALID, modifier, keycode); + return keyboardReport(BLE_CONN_HANDLE_INVALID, modifier, keycode); } bool BLEHidAdafruit::keyPress(char ch) { - return keyPress(BLE_GATT_HANDLE_INVALID, ch); + return keyPress(BLE_CONN_HANDLE_INVALID, ch); } bool BLEHidAdafruit::keyRelease(void) { - return keyRelease(BLE_GATT_HANDLE_INVALID); + return keyRelease(BLE_CONN_HANDLE_INVALID); } bool BLEHidAdafruit::keySequence(const char* str, int interval) { - return keySequence(BLE_GATT_HANDLE_INVALID, str, interval); + return keySequence(BLE_CONN_HANDLE_INVALID, str, interval); } //------------- Consumer Media Keys -------------// bool BLEHidAdafruit::consumerReport(uint16_t usage_code) { - return consumerReport(BLE_GATT_HANDLE_INVALID, usage_code); + return consumerReport(BLE_CONN_HANDLE_INVALID, usage_code); } bool BLEHidAdafruit::consumerKeyPress(uint16_t usage_code) { - return consumerKeyPress(BLE_GATT_HANDLE_INVALID, usage_code); + return consumerKeyPress(BLE_CONN_HANDLE_INVALID, usage_code); } bool BLEHidAdafruit::consumerKeyRelease(void) { - return consumerKeyRelease(BLE_GATT_HANDLE_INVALID); + return consumerKeyRelease(BLE_CONN_HANDLE_INVALID); } //------------- Mouse -------------// bool BLEHidAdafruit::mouseReport(hid_mouse_report_t* report) { - return mouseReport(BLE_GATT_HANDLE_INVALID, report); + return mouseReport(BLE_CONN_HANDLE_INVALID, report); } bool BLEHidAdafruit::mouseReport(uint8_t buttons, int8_t x, int8_t y, int8_t wheel, int8_t pan) { - return mouseReport(BLE_GATT_HANDLE_INVALID, buttons, x, y, wheel, pan); + return mouseReport(BLE_CONN_HANDLE_INVALID, buttons, x, y, wheel, pan); } bool BLEHidAdafruit::mouseButtonPress(uint8_t buttons) { - return mouseButtonPress(BLE_GATT_HANDLE_INVALID, buttons); + return mouseButtonPress(BLE_CONN_HANDLE_INVALID, buttons); } bool BLEHidAdafruit::mouseButtonRelease(void) { - return mouseButtonRelease(BLE_GATT_HANDLE_INVALID); + return mouseButtonRelease(BLE_CONN_HANDLE_INVALID); } bool BLEHidAdafruit::mouseMove(int8_t x, int8_t y) { - return mouseMove(BLE_GATT_HANDLE_INVALID, x, y); + return mouseMove(BLE_CONN_HANDLE_INVALID, x, y); } bool BLEHidAdafruit::mouseScroll(int8_t scroll) { - return mouseScroll(BLE_GATT_HANDLE_INVALID, scroll); + return mouseScroll(BLE_CONN_HANDLE_INVALID, scroll); } bool BLEHidAdafruit::mousePan(int8_t pan) { - return mousePan(BLE_GATT_HANDLE_INVALID, pan); + return mousePan(BLE_CONN_HANDLE_INVALID, pan); } From 2ce11a601a80ff5f19b99fefd1c4869f38e7aebd Mon Sep 17 00:00:00 2001 From: Pol Van Aubel Date: Tue, 14 May 2019 22:25:31 +0200 Subject: [PATCH 5/8] Abstract away scheduler wake. --- cores/nRF5/utility/SoftwareTimer.h | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/cores/nRF5/utility/SoftwareTimer.h b/cores/nRF5/utility/SoftwareTimer.h index ba6920f6..e39b7301 100644 --- a/cores/nRF5/utility/SoftwareTimer.h +++ b/cores/nRF5/utility/SoftwareTimer.h @@ -61,14 +61,25 @@ class SoftwareTimer void stop (void) { xTimerStop (_handle, 0); } void reset(void) { xTimerReset(_handle, 0); } - BaseType_t startFromISR(BaseType_t* pxHigherPriorityTaskWoken = NULL) { - return xTimerStartFromISR(_handle, pxHigherPriorityTaskWoken); + bool startFromISR(void) { + BaseType_t ret, xHigherPriorityTaskWoken = pdFALSE; + ret = xTimerStartFromISR(_handle, &xHigherPriorityTaskWoken); + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); + return (ret == pdPASS); } - BaseType_t stopFromISR(BaseType_t* pxHigherPriorityTaskWoken = NULL) { - return xTimerStopFromISR (_handle, pxHigherPriorityTaskWoken); + + bool stopFromISR(void) { + BaseType_t ret, xHigherPriorityTaskWoken = pdFALSE; + ret = xTimerStopFromISR(_handle, &xHigherPriorityTaskWoken); + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); + return (ret == pdPASS); } - BaseType_t resetFromISR(BaseType_t* pxHigherPriorityTaskWoken = NULL) { - return xTimerResetFromISR(_handle, pxHigherPriorityTaskWoken); + + bool resetFromISR(void) { + BaseType_t ret, xHigherPriorityTaskWoken = pdFALSE; + ret = xTimerResetFromISR(_handle, &xHigherPriorityTaskWoken); + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); + return (ret == pdPASS); } void setPeriod(uint32_t ms) From 59966f6d83c99cee674ee2f3340220938ec6f2f1 Mon Sep 17 00:00:00 2001 From: Sayanee Date: Mon, 20 May 2019 19:59:54 +0800 Subject: [PATCH 6/8] Fix Service spelling --- libraries/Bluefruit52Lib/keywords.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/Bluefruit52Lib/keywords.txt b/libraries/Bluefruit52Lib/keywords.txt index d1cee182..e3cac92a 100644 --- a/libraries/Bluefruit52Lib/keywords.txt +++ b/libraries/Bluefruit52Lib/keywords.txt @@ -531,14 +531,14 @@ ANCS_ACTION_NEGATIVE LITERAL1 ANCS_APP_ATTR_DISPLAY_NAME LITERAL1 ####################################### -# UUID128 Serivce Constants +# UUID128 Service Constants ####################################### BLEUART_UUID_SERVICE LITERAL1 BLEANCS_UUID_SERVICE LITERAL1 ####################################### -# UUID16 Serivce Constants +# UUID16 Service Constants ####################################### UUID16_SVC_ALERT_NOTIFICATION LITERAL1 UUID16_SVC_BATTERY LITERAL1 From dc9671b2b14b472e90f44dc98614692c95474514 Mon Sep 17 00:00:00 2001 From: Sayanee Date: Mon, 20 May 2019 20:44:03 +0800 Subject: [PATCH 7/8] Add Environmental Sensing GATT Service and UV Index GATT Characteristics --- libraries/Bluefruit52Lib/keywords.txt | 2 ++ libraries/Bluefruit52Lib/src/BLEUuid.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libraries/Bluefruit52Lib/keywords.txt b/libraries/Bluefruit52Lib/keywords.txt index d1cee182..1181a638 100644 --- a/libraries/Bluefruit52Lib/keywords.txt +++ b/libraries/Bluefruit52Lib/keywords.txt @@ -547,6 +547,7 @@ UUID16_SVC_CURRENT_TIME LITERAL1 UUID16_SVC_CYCLING_SPEED_AND_CADENCE LITERAL1 UUID16_SVC_LOCATION_AND_NAVIGATION LITERAL1 UUID16_SVC_DEVICE_INFORMATION LITERAL1 +UUID16_SVC_ENVIRONMENTAL_SENSING LITERAL1 UUID16_SVC_GLUCOSE LITERAL1 UUID16_SVC_HEALTH_THERMOMETER LITERAL1 UUID16_SVC_HEART_RATE LITERAL1 @@ -656,3 +657,4 @@ UUID16_PLX_FEATURES LITERAL1 +UUID16_CHR_UV_INDEX LITERAL1 diff --git a/libraries/Bluefruit52Lib/src/BLEUuid.h b/libraries/Bluefruit52Lib/src/BLEUuid.h index 6cdc1014..9b0b7529 100644 --- a/libraries/Bluefruit52Lib/src/BLEUuid.h +++ b/libraries/Bluefruit52Lib/src/BLEUuid.h @@ -84,6 +84,7 @@ class BLEUuid #define UUID16_SVC_CYCLING_POWER 0x1818 #define UUID16_SVC_LOCATION_AND_NAVIGATION 0x1819 #define UUID16_SVC_DEVICE_INFORMATION 0x180A +#define UUID16_SVC_ENVIRONMENTAL_SENSING 0x181A #define UUID16_SVC_GLUCOSE 0x1808 #define UUID16_SVC_HEALTH_THERMOMETER 0x1809 #define UUID16_SVC_HEART_RATE 0x180D @@ -195,6 +196,7 @@ class BLEUuid #define UUID16_PLX_SPOT_CHECK_MEAS 0x2A5E #define UUID16_PLX_CONTINUOUS_MEAS 0x2A5F #define UUID16_PLX_FEATURES 0x2A60 +#define UUID16_CHR_UV_INDEX 0x2A76 /*------------------------------------------------------------------*/ /* Company UUID From e5ed58b096a1df9c079a00cb9a9d5a8318c26ee9 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 24 May 2019 12:58:11 +0700 Subject: [PATCH 8/8] Update issue templates --- .../for-questions-please-use-our-forum-support.md | 14 -------------- .../questions-please-use-our-forum-support.md | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/for-questions-please-use-our-forum-support.md diff --git a/.github/ISSUE_TEMPLATE/for-questions-please-use-our-forum-support.md b/.github/ISSUE_TEMPLATE/for-questions-please-use-our-forum-support.md deleted file mode 100644 index 1504ce09..00000000 --- a/.github/ISSUE_TEMPLATE/for-questions-please-use-our-forum-support.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: For questions please use our forum support -about: Please don't open issue for question -title: '' -labels: '' -assignees: '' - ---- - -**Please DO NOT use GitHub issues for question or troubleshooting projects.** Instead use the forums at http://forums.adafruit.com. Only create issue if it is a bug, feature or discussion that requires **code changes to resolve**. - -**Check our tutorial and examples** There is chance that our tutorial and examples has useful information for you: -- [Feather nRF52832 tutorial](https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide) -- [Feather nRF52840 tutorial](https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather) diff --git a/.github/ISSUE_TEMPLATE/questions-please-use-our-forum-support.md b/.github/ISSUE_TEMPLATE/questions-please-use-our-forum-support.md index f24ac2c6..c4148946 100644 --- a/.github/ISSUE_TEMPLATE/questions-please-use-our-forum-support.md +++ b/.github/ISSUE_TEMPLATE/questions-please-use-our-forum-support.md @@ -1,6 +1,6 @@ --- name: Questions please use our forum support -about: Post your question at forums.adafruit.com +about: Don't open issue, post your question at forums.adafruit.com title: '' labels: '' assignees: ''