From 54f22bf19e7ed2e44ebc829d611e5ba522d3edf3 Mon Sep 17 00:00:00 2001 From: Karel Kalthoff Date: Fri, 24 Mar 2017 12:24:08 -0500 Subject: [PATCH 01/10] improvement: using specific range messages over writing to registers --- hardware/bean/avr/cores/bean/Bean.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hardware/bean/avr/cores/bean/Bean.cpp b/hardware/bean/avr/cores/bean/Bean.cpp index b67f4c7..78cee09 100644 --- a/hardware/bean/avr/cores/bean/Bean.cpp +++ b/hardware/bean/avr/cores/bean/Bean.cpp @@ -328,12 +328,14 @@ void BeanClass::enableWakeOnAccelerometer(uint8_t sources) { uint8_t BeanClass::getAccelerationRange(void) { uint8_t value; - Serial.accelRegisterRead(REG_G_SETTING, 1, &value); + //Serial.accelRegisterRead(REG_G_SETTING, 1, &value); + Serial.accelRangeRead(&value); return value; } void BeanClass::setAccelerationRange(uint8_t range) { - Serial.accelRegisterWrite(REG_G_SETTING, range); + //Serial.accelRegisterWrite(REG_G_SETTING, range); + Serial.accelRangeSet(&range); } int16_t BeanClass::getAccelerationX(void) { From a0301348de4e6356de343f73d42e796190fd399b Mon Sep 17 00:00:00 2001 From: Karel Kalthoff Date: Fri, 24 Mar 2017 12:34:33 -0500 Subject: [PATCH 02/10] fix: pointer --- hardware/bean/avr/cores/bean/Bean.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/bean/avr/cores/bean/Bean.cpp b/hardware/bean/avr/cores/bean/Bean.cpp index 78cee09..457f929 100644 --- a/hardware/bean/avr/cores/bean/Bean.cpp +++ b/hardware/bean/avr/cores/bean/Bean.cpp @@ -335,7 +335,7 @@ uint8_t BeanClass::getAccelerationRange(void) { void BeanClass::setAccelerationRange(uint8_t range) { //Serial.accelRegisterWrite(REG_G_SETTING, range); - Serial.accelRangeSet(&range); + Serial.accelRangeSet(range); } int16_t BeanClass::getAccelerationX(void) { From b5576114bcdfd65fe9a3d28bd526aadca21cb8b5 Mon Sep 17 00:00:00 2001 From: Karel Kalthoff Date: Mon, 27 Mar 2017 08:46:25 -0500 Subject: [PATCH 03/10] indicate error in reading acc range --- hardware/bean/avr/cores/bean/Bean.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hardware/bean/avr/cores/bean/Bean.cpp b/hardware/bean/avr/cores/bean/Bean.cpp index 457f929..164c61c 100644 --- a/hardware/bean/avr/cores/bean/Bean.cpp +++ b/hardware/bean/avr/cores/bean/Bean.cpp @@ -329,7 +329,9 @@ void BeanClass::enableWakeOnAccelerometer(uint8_t sources) { uint8_t BeanClass::getAccelerationRange(void) { uint8_t value; //Serial.accelRegisterRead(REG_G_SETTING, 1, &value); - Serial.accelRangeRead(&value); + if (Serial.accelRangeRead(&value)) { + return 0xFF; + } return value; } From 9d893a8d2bbd8535e5ccccdbcaad58aa62a7bdfd Mon Sep 17 00:00:00 2001 From: Karel Kalthoff Date: Mon, 27 Mar 2017 09:27:12 -0500 Subject: [PATCH 04/10] Revert "indicate error in reading acc range" This reverts commit b5576114bcdfd65fe9a3d28bd526aadca21cb8b5. --- hardware/bean/avr/cores/bean/Bean.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hardware/bean/avr/cores/bean/Bean.cpp b/hardware/bean/avr/cores/bean/Bean.cpp index 164c61c..457f929 100644 --- a/hardware/bean/avr/cores/bean/Bean.cpp +++ b/hardware/bean/avr/cores/bean/Bean.cpp @@ -329,9 +329,7 @@ void BeanClass::enableWakeOnAccelerometer(uint8_t sources) { uint8_t BeanClass::getAccelerationRange(void) { uint8_t value; //Serial.accelRegisterRead(REG_G_SETTING, 1, &value); - if (Serial.accelRangeRead(&value)) { - return 0xFF; - } + Serial.accelRangeRead(&value); return value; } From 7f26c1a84669691578e409025252c884e66f07dd Mon Sep 17 00:00:00 2001 From: Karel Kalthoff Date: Fri, 24 Mar 2017 12:24:08 -0500 Subject: [PATCH 05/10] improvement: using specific range messages over writing to registers --- hardware/bean/avr/cores/bean/Bean.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hardware/bean/avr/cores/bean/Bean.cpp b/hardware/bean/avr/cores/bean/Bean.cpp index b67f4c7..78cee09 100644 --- a/hardware/bean/avr/cores/bean/Bean.cpp +++ b/hardware/bean/avr/cores/bean/Bean.cpp @@ -328,12 +328,14 @@ void BeanClass::enableWakeOnAccelerometer(uint8_t sources) { uint8_t BeanClass::getAccelerationRange(void) { uint8_t value; - Serial.accelRegisterRead(REG_G_SETTING, 1, &value); + //Serial.accelRegisterRead(REG_G_SETTING, 1, &value); + Serial.accelRangeRead(&value); return value; } void BeanClass::setAccelerationRange(uint8_t range) { - Serial.accelRegisterWrite(REG_G_SETTING, range); + //Serial.accelRegisterWrite(REG_G_SETTING, range); + Serial.accelRangeSet(&range); } int16_t BeanClass::getAccelerationX(void) { From ace3e74d11018d06f401db85e7512f375f7a2fe0 Mon Sep 17 00:00:00 2001 From: Karel Kalthoff Date: Fri, 24 Mar 2017 12:34:33 -0500 Subject: [PATCH 06/10] fix: pointer --- hardware/bean/avr/cores/bean/Bean.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/bean/avr/cores/bean/Bean.cpp b/hardware/bean/avr/cores/bean/Bean.cpp index 78cee09..457f929 100644 --- a/hardware/bean/avr/cores/bean/Bean.cpp +++ b/hardware/bean/avr/cores/bean/Bean.cpp @@ -335,7 +335,7 @@ uint8_t BeanClass::getAccelerationRange(void) { void BeanClass::setAccelerationRange(uint8_t range) { //Serial.accelRegisterWrite(REG_G_SETTING, range); - Serial.accelRangeSet(&range); + Serial.accelRangeSet(range); } int16_t BeanClass::getAccelerationX(void) { From ff77e8e8d0eb586bbfa776be1ce6809f0123fb1c Mon Sep 17 00:00:00 2001 From: Karel Kalthoff Date: Mon, 27 Mar 2017 08:46:25 -0500 Subject: [PATCH 07/10] indicate error in reading acc range --- hardware/bean/avr/cores/bean/Bean.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hardware/bean/avr/cores/bean/Bean.cpp b/hardware/bean/avr/cores/bean/Bean.cpp index 457f929..164c61c 100644 --- a/hardware/bean/avr/cores/bean/Bean.cpp +++ b/hardware/bean/avr/cores/bean/Bean.cpp @@ -329,7 +329,9 @@ void BeanClass::enableWakeOnAccelerometer(uint8_t sources) { uint8_t BeanClass::getAccelerationRange(void) { uint8_t value; //Serial.accelRegisterRead(REG_G_SETTING, 1, &value); - Serial.accelRangeRead(&value); + if (Serial.accelRangeRead(&value)) { + return 0xFF; + } return value; } From ad064af452b53aa89a575f26cb56e43adf654545 Mon Sep 17 00:00:00 2001 From: Karel Kalthoff Date: Mon, 27 Mar 2017 09:27:12 -0500 Subject: [PATCH 08/10] Revert "indicate error in reading acc range" This reverts commit b5576114bcdfd65fe9a3d28bd526aadca21cb8b5. --- hardware/bean/avr/cores/bean/Bean.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hardware/bean/avr/cores/bean/Bean.cpp b/hardware/bean/avr/cores/bean/Bean.cpp index 164c61c..457f929 100644 --- a/hardware/bean/avr/cores/bean/Bean.cpp +++ b/hardware/bean/avr/cores/bean/Bean.cpp @@ -329,9 +329,7 @@ void BeanClass::enableWakeOnAccelerometer(uint8_t sources) { uint8_t BeanClass::getAccelerationRange(void) { uint8_t value; //Serial.accelRegisterRead(REG_G_SETTING, 1, &value); - if (Serial.accelRangeRead(&value)) { - return 0xFF; - } + Serial.accelRangeRead(&value); return value; } From abeb202f7d099fca69dcc5882fe37de633a26d9e Mon Sep 17 00:00:00 2001 From: Karel Kalthoff Date: Fri, 31 Mar 2017 11:10:10 -0500 Subject: [PATCH 09/10] fix: removing comments for formatting restrictions --- hardware/bean/avr/cores/bean/Bean.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/hardware/bean/avr/cores/bean/Bean.cpp b/hardware/bean/avr/cores/bean/Bean.cpp index 457f929..c7d173c 100644 --- a/hardware/bean/avr/cores/bean/Bean.cpp +++ b/hardware/bean/avr/cores/bean/Bean.cpp @@ -328,13 +328,11 @@ void BeanClass::enableWakeOnAccelerometer(uint8_t sources) { uint8_t BeanClass::getAccelerationRange(void) { uint8_t value; - //Serial.accelRegisterRead(REG_G_SETTING, 1, &value); Serial.accelRangeRead(&value); return value; } void BeanClass::setAccelerationRange(uint8_t range) { - //Serial.accelRegisterWrite(REG_G_SETTING, range); Serial.accelRangeSet(range); } From 457297d3557bbaee85dacbd69fe9d9e5abd412d2 Mon Sep 17 00:00:00 2001 From: Stephen Stack Date: Wed, 5 Apr 2017 13:51:56 -0500 Subject: [PATCH 10/10] release: changelog + boards.txt for v2.0.3 --- CHANGELOG.md | 6 ++++++ hardware/bean/avr/boards.txt | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d462a6..1942518 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 2.0.3 + +### Fixes + +* Fix `getAccelerationRange` + # 2.0.2 ### Fixes diff --git a/hardware/bean/avr/boards.txt b/hardware/bean/avr/boards.txt index 2851556..cb6266e 100644 --- a/hardware/bean/avr/boards.txt +++ b/hardware/bean/avr/boards.txt @@ -1,4 +1,4 @@ -bean.name=LightBlue Bean (2.0.0) +bean.name=LightBlue Bean (2.0.3) bean.upload.tool=beanupload bean.upload.protocol=ptdble bean.upload.maximum_size=32256 @@ -11,7 +11,7 @@ bean.build.variant=bean bean.build.bean_variant=1 bean.build.board=AVR_UNO -beanplus.name=LightBlue Bean+ (2.0.0) +beanplus.name=LightBlue Bean+ (2.0.3) beanplus.upload.tool=beanupload beanplus.upload.protocol=ptdble beanplus.upload.maximum_size=32256