From 54f22bf19e7ed2e44ebc829d611e5ba522d3edf3 Mon Sep 17 00:00:00 2001 From: Karel Kalthoff Date: Fri, 24 Mar 2017 12:24:08 -0500 Subject: [PATCH] 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) {