# HG changeset patch # User Michiel Broek # Date 1574532605 -3600 # Node ID e2a43e7c4035a14b25360f3f08c4884adea99909 # Parent 090b9d36b7a1fdd3b28ba42fcb1f8176c0c466f1 Swapped ADC channels 6 and 7. Completed the DS18B20 assign to unit. diff -r 090b9d36b7a1 -r e2a43e7c4035 main/Kconfig.projbuild --- 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 diff -r 090b9d36b7a1 -r e2a43e7c4035 main/task_user.c --- 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; diff -r 090b9d36b7a1 -r e2a43e7c4035 sdkconfig --- 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