diff Discovery/Src/data_central.c @ 868:db92692c014f Evo_2_23

Introduce speed dependend coloring of depth: The depth value in the will now be colored based on the current ascent speed. The color code matches the one of the bar graph which was already used for visualization of the ascent speed. To keep color code consistent the existing color selection functions have been merged to one common Gfx function (T3/T7 - bar graph and color text)
author Ideenmodellierer
date Mon, 12 Aug 2024 15:14:19 +0200
parents 70092f552f5a
children e373e90a48db
line wrap: on
line diff
--- a/Discovery/Src/data_central.c	Mon Aug 12 14:30:22 2024 +0200
+++ b/Discovery/Src/data_central.c	Mon Aug 12 15:14:19 2024 +0200
@@ -911,3 +911,28 @@
 {
     stateUsedWrite->timerState = TIMER_STATE_OFF;
 }
+
+#define SPEED_SLOW		(5.0f)
+#define SPEED_MEDIUM	(10.0f)
+#define SPEED_HIGH		(15.0f)
+
+uint8_t drawingColor_from_ascentspeed(float speed)
+{
+	uint8_t color = CLUT_Font020;
+
+    if(speed >= SPEED_HIGH)
+    {
+    	color = CLUT_WarningRed;
+    }
+    else if(speed >= SPEED_MEDIUM)
+    {
+    	color = CLUT_WarningYellow;
+    }
+    else if(speed >= SPEED_SLOW)
+    {
+    	color = CLUT_NiceGreen;
+    }
+    return color;
+}
+
+