From bccea2d419f72bf7c7d94c72d32611eaf615ce56 Mon Sep 17 00:00:00 2001
From: Aapo Torkkeli <aamato@utu.fi>
Date: Tue, 12 Nov 2019 12:53:44 +0200
Subject: [PATCH] Improve readability.

---
 project/ble.c | 2 +-
 project/imu.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/project/ble.c b/project/ble.c
index 03b3e9b..74a1ecb 100644
--- a/project/ble.c
+++ b/project/ble.c
@@ -117,7 +117,7 @@
 #define DEAD_BEEF                       0xDEADBEEF                              /**< Value used as error code on stack dump, can be used to identify stack location on stack unwind. */
 
 #define APP_TIMER_MAX_TIMERS            1                                       /**< Maximum number of timers used by the application. */
-#define TIMER_INTERVAL                  APP_TIMER_TICKS(1000)
+#define TIMER_INTERVAL                  APP_TIMER_TICKS(100)
 
 // Determines if temperature type is given as characteristic (1) or as a field of measurement (0)
 #define TEMP_TYPE_AS_CHARACTERISTIC 0
diff --git a/project/imu.c b/project/imu.c
index 8808eee..6611384 100644
--- a/project/imu.c
+++ b/project/imu.c
@@ -169,7 +169,7 @@ void calculate_orientation(){
   if ( (z_axis_abs > x_axis_abs) && (z_axis_abs > y_axis_abs)) {
       // base orientation on Z
       if (z_axis > 0) {
-          orientation = (uint32_t) ORIENTATION_ZERO;
+          orientation = (uint32_t) ORIENTATION_THREE;
       } else {
           orientation = (uint32_t) ORIENTATION_ONE;
       }
@@ -178,12 +178,12 @@ void calculate_orientation(){
       if (y_axis > 0) {
           orientation = (uint32_t) ORIENTATION_TWO;
       } else {
-          orientation = (uint32_t) ORIENTATION_THREE;
+          orientation = (uint32_t) ORIENTATION_FOUR;
       }
   } else {
       // base orientation on X
       if (x_axis < 0) {
-          orientation = (uint32_t) ORIENTATION_FOUR;
+          orientation = (uint32_t) ORIENTATION_ZERO;
       } else {
           orientation = (uint32_t) ORIENTATION_FIVE;
       }
-- 
GitLab