diff -r 4d8cca2d5b68 -r d327e0aff62f main/task_user.c --- a/main/task_user.c Sun Nov 24 12:08:01 2019 +0100 +++ b/main/task_user.c Mon Nov 25 11:34:38 2019 +0100 @@ -18,8 +18,8 @@ int SubOffset = 0; ///< Submenu offset u8g2_t u8g2; ///< A structure which will contain all the data for one display rotary_encoder_info_t rinfo = { 0 }; ///< Rotary encoder record -rotary_encoder_event_t event = { 0 }; -QueueHandle_t event_queue; +rotary_encoder_event_t event = { 0 }; ///< Rotary encoder events +QueueHandle_t event_queue; ///< Events queue static xQueueHandle gpio_evt_queue = NULL; ///< Rotary pushbutton queue static int PushDuration = 0; ///< Duration of the pushed button struct strStations APs[10]; ///< List of APs we know @@ -28,7 +28,7 @@ struct strStations editAP; ///< Data of station to edit char sensors[DS18B20_MAX][17]; ///< Sensors to select -extern const esp_app_desc_t *app_desc; +extern const esp_app_desc_t *app_desc; ///< App description extern unit_t units[3]; ///< Pressure test units extern SemaphoreHandle_t xSemaphoreUnits; ///< Units lock semaphore extern DS18B20_State *ds18b20_state; ///< DS18B20 state @@ -423,6 +423,13 @@ +/** + * @brief The list of detected DS18B20 sensors. + * @param no The unit index number. + * @param sub The submenu index number. + * @param offset The offset in the list. + */ + void screen_list_sensors(int no, int sub, int offset) { int i; @@ -471,6 +478,9 @@ +/** + * @brief The WiFi overview screen. + */ void screen_wifi() { char buf[65]; @@ -497,6 +507,10 @@ +/** + * @brief The WiFi setup menu. + * @param sub The submenu entry to hilite. + */ void screen_wifi_setup(int sub) { screen_top("WiFi AP setup"); @@ -508,6 +522,11 @@ +/** + * @brief Show the list if WiFi Access Points. + * @param sub The sub entry line. + * @param offset The offset in the list. + */ void screen_list_aps(int sub, int offset) { int i; @@ -531,7 +550,6 @@ num_ssids++; } } -//printf("loaded %d SSIDs sub %d offset %d\n", num_ssids, sub, offset); screen_top("WiFi AP lijst"); if (num_ssids == 0) { @@ -550,6 +568,10 @@ +/** + * @brief Edit WiFi AP menu. + * @param sub The menu entry to hilite. + */ void screen_edit_ap(int sub) { screen_top("WiFi wijzig AP"); @@ -564,6 +586,9 @@ +/** + * @brief The network status screen. + */ void screen_network() { char ip[17], nm[17], gw[17]; @@ -587,6 +612,10 @@ +/** + * @brief The network setup menu. + * @param sub The menu entry to hilite. + */ void screen_network_setup(int sub) { screen_top("Netwerk setup"); @@ -598,6 +627,9 @@ +/** + * @brief MQTT status + */ void screen_mqtt() { screen_top("MQTT Status"); @@ -609,6 +641,10 @@ +/** + * @brief MQTT setup menu. + * @param sub The submenu entry to hilite. + */ void screen_mqtt_setup(int sub) { screen_top("MQTT Setup"); @@ -621,6 +657,9 @@ +/** + * @brief The OTA update menu. + */ void screen_update() { screen_top("Update software"); @@ -630,6 +669,11 @@ +/** + * @brief The update status screen. + * @param m1 The first message line or NULL. + * @param m2 The second message line or NULL. + */ void screen_updating(char *m1, char *m2) { screen_top("Bijwerken ..."); @@ -756,6 +800,9 @@ +/** + * @brief Handle menu changes. + */ void menu_change(void) { if (New_Loop2 != Main_Loop2) { @@ -768,19 +815,16 @@ break; case ML2_USER: - ESP_LOGI(TAG, "Loop user: User mainmenu"); screen_main(); break; case ML2_UNIT1: case ML2_UNIT2: case ML2_UNIT3: - ESP_LOGI(TAG, "Loop user: Unit %d", Main_Loop2 - ML2_UNIT1); screen_unit(Main_Loop2 - ML2_UNIT1); break; case ML2_WIFI: - ESP_LOGI(TAG, "Loop user: WiFi"); screen_wifi(); break; @@ -801,7 +845,6 @@ break; case ML2_NETWORK: - ESP_LOGI(TAG, "Loop user: Network"); screen_network(); break; @@ -811,7 +854,6 @@ break; case ML2_MQTT: - ESP_LOGI(TAG, "Loop user: MQTT"); screen_mqtt(); break; @@ -821,7 +863,6 @@ break; case ML2_UPDATE: - ESP_LOGI(TAG, "Loop user: Update"); screen_update(); break; @@ -863,6 +904,9 @@ +/** + * @brief Handle rotary switch for menu navigation. + */ void menu_rotary(void) { switch (Main_Loop2) { @@ -928,6 +972,9 @@ +/** + * @brief Pressed keys actions + */ void menu_loop(void) { int idx = 0;