diff Discovery/Src/logbook.c @ 929:63c340abd70e Evo_2_23 tip

Add a line to the compass heading dive menu that shows the currently set heading to enable the diver to confirm it / add it to notes. Also add a log entry every time a new compass heading is set or the heading is cleared. And add a way to add compass headings to the log without changing the currently set heading - this was added after discussion with cave divers who are interested in recording headings when mapping out caves. From mikeller
author heinrichsweikamp
date Mon, 02 Dec 2024 11:16:10 +0100
parents b456be1e152d
children
line wrap: on
line diff
--- a/Discovery/Src/logbook.c	Tue Nov 26 21:30:06 2024 +0100
+++ b/Discovery/Src/logbook.c	Mon Dec 02 11:16:10 2024 +0100
@@ -458,6 +458,10 @@
         eventByte1.ub.bit7 = 1;
         eventByte2.ub.bit0 = 1;
     }
+    if (state->events.compassHeadingUpdate) {
+        eventByte1.ub.bit7 = 1;
+        eventByte2.ub.bit1 = 1;
+    }
     //Add EventByte 1
     if(eventByte1.uw > 0)
     {
@@ -498,6 +502,11 @@
         sample[length] = state->events.info_bailoutHe;
         length += 1;
     }
+    if (state->events.compassHeadingUpdate) {
+        // New heading and type of heading
+        sample[length++] = state->events.info_compassHeadingUpdate & 0xFF;
+        sample[length++] = (state->events.info_compassHeadingUpdate & 0xFF00) >> 8;
+    }
 
 
     if(divisor.temperature == 0)