Swapped ADC channels 6 and 7. Completed the DS18B20 assign to unit.

Sat, 23 Nov 2019 19:10:05 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 23 Nov 2019 19:10:05 +0100
changeset 36
e2a43e7c4035
parent 35
090b9d36b7a1
child 37
358bbd5b608e

Swapped ADC channels 6 and 7. Completed the DS18B20 assign to unit.

main/Kconfig.projbuild file | annotate | diff | comparison | revisions
main/task_user.c file | annotate | diff | comparison | revisions
sdkconfig file | annotate | diff | comparison | revisions
--- a/main/Kconfig.projbuild	Thu Nov 21 22:19:27 2019 +0100
+++ b/main/Kconfig.projbuild	Sat Nov 23 19:10:05 2019 +0100
@@ -85,14 +85,14 @@
     config PRESSURE_1
 	int "Pressure transducer 1"
 	range 4 7
-	default 6
+	default 7
 	help
 		The ADC1 channel to measure the first pressure transducer
 
     config PRESSURE_2
         int "Pressure transducer 2"
         range 4 7
-        default 7
+        default 6
         help
                 The ADC1 channel to measure the second pressure transducer
 
--- a/main/task_user.c	Thu Nov 21 22:19:27 2019 +0100
+++ b/main/task_user.c	Sat Nov 23 19:10:05 2019 +0100
@@ -332,15 +332,11 @@
  */
 void screen_splash()
 {
-//    screen_top("CO2 meter %s", app_desc->version);
+    screen_top("CO2 meter %s", app_desc->version);
 
-//    u8g2_SetFont(&u8g2, u8g2_font_t0_22b_tf);
-//    u8g2_uint_t w = u8g2_GetUTF8Width(&u8g2, "Welkom");
-//    u8g2_DrawUTF8(&u8g2, (128 - w) / 2,50, "Welkom");
-
-u8g2_SetDrawColor(&u8g2, 1);
-u8g2_DrawBox(&u8g2, 0, 0, 128, 64);
-
+    u8g2_SetFont(&u8g2, u8g2_font_t0_22b_tf);
+    u8g2_uint_t w = u8g2_GetUTF8Width(&u8g2, "Welkom");
+    u8g2_DrawUTF8(&u8g2, (128 - w) / 2,50, "Welkom");
     u8g2_SendBuffer(&u8g2);
     u8g2_SetPowerSave(&u8g2, 0); // wake up display
 }
@@ -1006,7 +1002,18 @@
 		idx = Main_Loop2 - ML2_SEL_SENSOR1;
 		if ((SubMenu + SubOffset) < num_sensors) {
 		    ESP_LOGI(TAG, "Select sensor %d %s for unit %d", SubMenu + SubOffset, sensors[SubMenu + SubOffset], idx + 1);
-
+		    if (xSemaphoreTake(xSemaphoreUnits, 25) == pdTRUE) {
+			strcpy(units[idx].temperature_rom_code, sensors[SubMenu + SubOffset]);
+                        write_units();
+                        xSemaphoreGive(xSemaphoreUnits);
+			New_Loop2 = ML2_SETUP_UNIT1 + idx;
+                    	SubMenu = 2;
+                    	SubOffset = 0;
+			if (Main_Loop1 == ML1_DONE)
+                            Main_Loop1 = ML1_INIT;
+                    } else {
+			ESP_LOGE(TAG, "Failed units lock for new romcode");
+		    }
 		} else {
 		    New_Loop2 = ML2_SETUP_UNIT1 + idx;
 		    SubMenu = 2;
--- a/sdkconfig	Thu Nov 21 22:19:27 2019 +0100
+++ b/sdkconfig	Sat Nov 23 19:10:05 2019 +0100
@@ -88,8 +88,8 @@
 CONFIG_ROT_ENC_B_GPIO=27
 CONFIG_ROT_ENC_SW_GPIO=14
 CONFIG_BATT_CHANNEL=4
-CONFIG_PRESSURE_1=6
-CONFIG_PRESSURE_2=7
+CONFIG_PRESSURE_1=7
+CONFIG_PRESSURE_2=6
 CONFIG_PRESSURE_3=5
 CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y
 # CONFIG_COMPILER_OPTIMIZATION_SIZE is not set

mercurial