Lizzy project

Dependencies:   aconno_I2C Lis2dh12 adc52832_common aconno_SEGGER_RTT

Files at this revision

API Documentation at this revision

Comitter:
dbartolovic
Date:
Mon Sep 17 12:46:41 2018 +0000
Branch:
testing-ignore
Parent:
16:482d8f81d6f3
Child:
24:7539258b015c
Commit message:
Testing, ignore this branch

Changed in this revision

source/main.cpp Show annotated file Show diff for this revision Revisions of this file
source/main.h Show annotated file Show diff for this revision Revisions of this file
tasks/tasks.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/source/main.cpp	Wed Aug 29 17:08:08 2018 +0000
+++ b/source/main.cpp	Mon Sep 17 12:46:41 2018 +0000
@@ -84,7 +84,7 @@
     mems.enableAxes(X_axis);
     mems.enableAxes(Y_axis);
     mems.enableAxes(Z_axis);    
-    mems.setODR(ODR_50Hz);
+    mems.setODR(ACC_ODR_SLEEP_MODE);
     //mems.setScale(_16g);
     mems.setScale(_8g);
     mems.int1Setup(0x40);       // IntActivity 1 driven to INT1 pad
--- a/source/main.h	Wed Aug 29 17:08:08 2018 +0000
+++ b/source/main.h	Mon Sep 17 12:46:41 2018 +0000
@@ -25,6 +25,10 @@
 #define BLE_ACTIVE_TIME_S   (0.4)
 #define POWER_UP_DELAY_MS   (200)
 
+#define STOP_FPU()                                                             \
+  __set_FPSCR(__get_FPSCR()  & ~(0x0000009F));                                 \
+  (void) __get_FPSCR();                                                        \
+  NVIC_ClearPendingIRQ(FPU_IRQn)
 
 #if PRINT_ON_RTT
     #include "SEGGER_RTT.h"
@@ -35,6 +39,8 @@
 
 #define INT1_THRESHOLD      (30)
 #define INT1_DUR            (12)
+#define ACC_ODR_ACTIVE_MODE (ODR_50Hz)
+#define ACC_ODR_SLEEP_MODE  (ODR_25Hz)
     
 #define ACC_INT_SIG         (0x00001020)    // Acc interrupt signal
 #define DISABLE_BLE_SIG     (0x00001030)
--- a/tasks/tasks.cpp	Wed Aug 29 17:08:08 2018 +0000
+++ b/tasks/tasks.cpp	Mon Sep 17 12:46:41 2018 +0000
@@ -122,8 +122,8 @@
             updateServiceT.signal_set(MEAS_DONE);
             bleT.signal_set(MEAS_DONE);
             
-            //wait_ms(MEASURE_INTERVAL_MS);
-            Thread::wait(MEASURE_INTERVAL_MS);
+            wait_ms(MEASURE_INTERVAL_MS);
+            //Thread::wait(MEASURE_INTERVAL_MS);
             untilSleep--;
             
             if( (untilSleep <= 0) && !bleIsClientConnected() )