Geo beacon for VF.

Dependencies:   MMA8452 aconno_bsp adc52832_common

Files at this revision

API Documentation at this revision

Comitter:
jurica238814
Date:
Mon Sep 18 10:09:12 2017 +0000
Parent:
29:7b794a8633b4
Commit message:
Acc included: sleep mode: 27.6uA.

Changed in this revision

MMA8452.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/MMA8452.lib	Thu Sep 14 13:32:06 2017 +0000
+++ b/MMA8452.lib	Mon Sep 18 10:09:12 2017 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/users/jurica238814/code/MMA8452/#bda670d7a481
+https://developer.mbed.org/users/jurica238814/code/MMA8452/#ba3e65007adf
--- a/main.cpp	Thu Sep 14 13:32:06 2017 +0000
+++ b/main.cpp	Mon Sep 18 10:09:12 2017 +0000
@@ -57,7 +57,7 @@
     #include "nrf52_uart.h"
     NRF52_UART uart(p25, p26, Baud9600);
     char buffer[255];
-    #define SEND(...) {uint8_t len = sprintf(buffer, __VA_ARGS__); uart.send(buffer, len);}
+    #define SEND(...) {uint8_t len = sprintf(buffer, __VA_ARGS__); uart.send(buffer, len); wait_ms(10);}
 #else
     #define SEND(...)
 #endif
@@ -416,15 +416,19 @@
 
 #if USE_ACC
     void pulse_handler(){
-    #if DEBUG_WAKEUP_BUZZER
-        buzzerStart();
-        wait_ms(50);
-        buzzerStop();
-    #endif
-    #if DEBUG_ACC
-        int_led = !int_led;
-    #endif
-    shushShush = false;
+        char data;
+        #if DEBUG_WAKEUP_BUZZER
+            buzzerStart();
+            wait_ms(50);
+            buzzerStop();
+        #endif
+        #if DEBUG_ACC
+            int_led = !int_led;
+        #endif
+        shushShush = false;
+        SEND("Interrupt!\r\n");
+        acc.get_register((char)FF_MT_SRC, &data);
+        SEND("FF_MT_SRC= %d\r\n", data);
     }
 #endif