summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoey Castillo <joeycastillo@utexas.edu>2022-02-19 13:28:09 -0500
committerJoey Castillo <joeycastillo@utexas.edu>2022-02-19 13:28:09 -0500
commit691c068e6e1baf7330099f990e5144eeb8cd99bc (patch)
tree7978acda654af163fb1d122cb1d2193b7c3b1dca
parent9f0f72eb203ae1fe93c850a38a6a9de9ab192ba8 (diff)
downloadSensor-Watch-691c068e6e1baf7330099f990e5144eeb8cd99bc.tar.gz
Sensor-Watch-691c068e6e1baf7330099f990e5144eeb8cd99bc.tar.bz2
Sensor-Watch-691c068e6e1baf7330099f990e5144eeb8cd99bc.zip
stuff parameters into the bits we're not using
-rw-r--r--movement/watch_faces/sensor/accelerometer_data_acquisition_face.c1
-rw-r--r--movement/watch_faces/sensor/accelerometer_data_acquisition_face.h21
2 files changed, 18 insertions, 4 deletions
diff --git a/movement/watch_faces/sensor/accelerometer_data_acquisition_face.c b/movement/watch_faces/sensor/accelerometer_data_acquisition_face.c
index d16ea0d3..d965ec2e 100644
--- a/movement/watch_faces/sensor/accelerometer_data_acquisition_face.c
+++ b/movement/watch_faces/sensor/accelerometer_data_acquisition_face.c
@@ -31,6 +31,7 @@ static const char activity_types[][3] = {
"SL", // Sleeping
"WH", // Washing Hands
"WA", // Walking
+ "WB", // Walking with Beverage
"JO", // Jogging
"RU", // Running
"BI", // Biking
diff --git a/movement/watch_faces/sensor/accelerometer_data_acquisition_face.h b/movement/watch_faces/sensor/accelerometer_data_acquisition_face.h
index a8c74ccc..b3fdbbd7 100644
--- a/movement/watch_faces/sensor/accelerometer_data_acquisition_face.h
+++ b/movement/watch_faces/sensor/accelerometer_data_acquisition_face.h
@@ -34,15 +34,28 @@
typedef union {
struct {
- int16_t temperature_and_type : 16; // high two bits are record type, val & 0xFFF is temperature
+ union {
+ int16_t record_type : 2;
+ int16_t range : 2;
+ int16_t temperature : 12;
+ } info;
int8_t char1 : 8;
int8_t char2 : 8;
int32_t timestamp : 32;
} header;
struct {
- int16_t x_accel_and_type : 16; // high two bits are record type, val & 0x3FFF is x_accel
- int16_t y_accel : 16;
- int16_t z_accel : 16;
+ union {
+ int16_t mode : 2;
+ int16_t accel : 14;
+ } x;
+ union {
+ int16_t lpmode : 2;
+ int16_t accel : 14;
+ } y;
+ union {
+ int16_t filter : 2;
+ int16_t accel : 14;
+ } z;
int32_t counter : 16;
} data;
uint64_t value;