main/iotbalkon.c

changeset 14
2a9f67ecbc72
parent 12
bb72d448e282
child 15
64028e178ff1
--- a/main/iotbalkon.c	Mon Apr 03 20:11:29 2023 +0200
+++ b/main/iotbalkon.c	Tue Apr 04 14:33:26 2023 +0200
@@ -7,14 +7,19 @@
 
 static const char *TAG = "iotbalkon";
 
-#define State_Init       0
-#define State_Connect    1
-#define State_Working    2
-#define State_WorkDone   3
-#define State_Stop       4
-#define State_Wait       5
-#define State_Measure    6
-#define State_GoSleep    7
+/*
+ * Main State table.
+ */
+typedef enum {
+    State_Init = 0,
+    State_Connect,
+    State_Working,
+    State_WorkDone,
+    State_Stop,
+    State_Wait,
+    State_Measure,
+    State_GoSleep
+} Main_State;
 
 
 static TaskHandle_t			xTaskBMP280 = NULL;
@@ -233,9 +238,9 @@
 
     if (xSemaphoreTake(xSemaphoreINA219, 25) == pdTRUE) {
 
-	s_Volts[loopno] = ina219_state->Solar.volts + (ina219_state->Solar.shunt / 1000);
+	s_Volts[loopno] = ina219_state->Solar.volts + ina219_state->Solar.shunt;
 	s_Current[loopno] = ina219_state->Solar.current;
-	b_Volts[loopno] = ina219_state->Battery.volts + (ina219_state->Battery.shunt / 1000);
+	b_Volts[loopno] = ina219_state->Battery.volts + ina219_state->Battery.shunt;
         b_Current[loopno] = ina219_state->Battery.current;
 	m_Valid[loopno] = ina219_state->valid;
 	xSemaphoreGive(xSemaphoreINA219);

mercurial