From c709b0b12685d79f6cce03636d224340abe109fc Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Fri, 4 Nov 2022 17:51:56 +0300 Subject: [PATCH] Update DHT monitor --- applications/plugins/dht_temp_sensor/DHT.h | 1 + .../plugins/dht_temp_sensor/quenon_dht_mon.c | 18 +++++++++--------- .../scenes/DHTMon_sensorEdit_scene.c | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/applications/plugins/dht_temp_sensor/DHT.h b/applications/plugins/dht_temp_sensor/DHT.h index 9a6308ae7..409847d8b 100644 --- a/applications/plugins/dht_temp_sensor/DHT.h +++ b/applications/plugins/dht_temp_sensor/DHT.h @@ -8,6 +8,7 @@ #define DHT_POLLING_CONTROL 1 //Включение проверки частоты опроса датчика #define DHT_POLLING_INTERVAL_DHT11 \ 2000 //Интервал опроса DHT11 (0.5 Гц по даташиту). Можно поставить 1500, будет работать +//Костыль, временно 2 секунды для датчика AM2302 #define DHT_POLLING_INTERVAL_DHT22 2000 //Интервал опроса DHT22 (1 Гц по даташиту) #define DHT_IRQ_CONTROL //Выключать прерывания во время обмена данных с датчиком /* Структура возвращаемых датчиком данных */ diff --git a/applications/plugins/dht_temp_sensor/quenon_dht_mon.c b/applications/plugins/dht_temp_sensor/quenon_dht_mon.c index 4084a351c..78d309f5d 100644 --- a/applications/plugins/dht_temp_sensor/quenon_dht_mon.c +++ b/applications/plugins/dht_temp_sensor/quenon_dht_mon.c @@ -11,18 +11,18 @@ const GpioPin RX_14 = {.pin = LL_GPIO_PIN_7, .port = GPIOB}; //Перечень достуных портов ввода/вывода static const GpioItem gpio_item[] = { - {2, "2", &gpio_ext_pa7}, - {3, "3", &gpio_ext_pa6}, - {4, "4", &gpio_ext_pa4}, - {5, "5", &gpio_ext_pb3}, - {6, "6", &gpio_ext_pb2}, - {7, "7", &gpio_ext_pc3}, - {10, "10 (SWC)", &SWC_10}, + {2, "2 (A7)", &gpio_ext_pa7}, + {3, "3 (A6)", &gpio_ext_pa6}, + {4, "4 (A4)", &gpio_ext_pa4}, + {5, "5 (B3)", &gpio_ext_pb3}, + {6, "6 (B2)", &gpio_ext_pb2}, + {7, "7 (C3)", &gpio_ext_pc3}, + {10, " 10(SWC) ", &SWC_10}, {12, "12 (SIO)", &SIO_12}, {13, "13 (TX)", &TX_13}, {14, "14 (RX)", &RX_14}, - {15, "15", &gpio_ext_pc1}, - {16, "16", &gpio_ext_pc0}, + {15, "15 (C1)", &gpio_ext_pc1}, + {16, "16 (C0)", &gpio_ext_pc0}, {17, "17 (1W)", &ibutton_gpio}}; //Данные плагина diff --git a/applications/plugins/dht_temp_sensor/scenes/DHTMon_sensorEdit_scene.c b/applications/plugins/dht_temp_sensor/scenes/DHTMon_sensorEdit_scene.c index c44fc2528..5decac3d1 100644 --- a/applications/plugins/dht_temp_sensor/scenes/DHTMon_sensorEdit_scene.c +++ b/applications/plugins/dht_temp_sensor/scenes/DHTMon_sensorEdit_scene.c @@ -81,7 +81,7 @@ void sensorEdit_scene(PluginData* app) { app->item = variable_item_list_add(variable_item_list, "Type:", 2, addSensor_sensorTypeChanged, app); - variable_item_set_current_value_index(nameItem, app->currentSensorEdit->type); + variable_item_set_current_value_index(app->item, app->currentSensorEdit->type); variable_item_set_current_value_text(app->item, sensorsTypes[app->currentSensorEdit->type]); //GPIO