From 73f0b8e13145ebf62dfbb90ad9f0869bd499ef51 Mon Sep 17 00:00:00 2001 From: fvanroie <15969459+fvanroie@users.noreply.github.com> Date: Tue, 4 May 2021 02:21:01 +0200 Subject: [PATCH] Rename object_set_group_values and object_set_normalized_group_values --- src/hasp/hasp_object.cpp | 12 ++++++------ src/hasp/hasp_object.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hasp/hasp_object.cpp b/src/hasp/hasp_object.cpp index 664dea4f..252662a0 100644 --- a/src/hasp/hasp_object.cpp +++ b/src/hasp/hasp_object.cpp @@ -222,7 +222,7 @@ void object_dispatch_state(uint8_t pageid, uint8_t btnid, const char* payload) // ##################### State Changers ######################################################## -void object_set_group_value(lv_obj_t* parent, uint8_t groupid, int16_t intval) +void object_set_group_values(lv_obj_t* parent, uint8_t groupid, int16_t intval) { if(groupid == 0 || parent == nullptr) return; @@ -233,7 +233,7 @@ void object_set_group_value(lv_obj_t* parent, uint8_t groupid, int16_t intval) if(groupid == child->user_data.groupid) hasp_process_obj_attribute_val(child, NULL, intval, intval, true); /* update grandchildren */ - object_set_group_value(child, groupid, intval); + object_set_group_values(child, groupid, intval); /* check tabs */ if(check_obj_type(child, LV_HASP_TABVIEW)) { @@ -246,7 +246,7 @@ void object_set_group_value(lv_obj_t* parent, uint8_t groupid, int16_t intval) hasp_process_obj_attribute_val(tab, NULL, intval, intval, true); /* tab found, update it */ /* check grandchildren */ - object_set_group_value(tab, groupid, intval); + object_set_group_values(tab, groupid, intval); } //#endif } @@ -256,14 +256,14 @@ void object_set_group_value(lv_obj_t* parent, uint8_t groupid, int16_t intval) } } -// TODO make this a recursive function that goes over all objects only ONCE -void object_set_normalized_group_value(uint8_t groupid, lv_obj_t* src_obj, int16_t val, int16_t min, int16_t max) +// Recursive function that goes over all objects only ONCE +void object_set_normalized_group_values(uint8_t groupid, lv_obj_t* src_obj, int16_t val, int16_t min, int16_t max) { if(groupid == 0) return; if(min == max) return; for(uint8_t page = 0; page < HASP_NUM_PAGES; page++) { - object_set_group_value(haspPages.get_obj(page), groupid, val); + object_set_group_values(haspPages.get_obj(page), groupid, val); // uint8_t startid = 1; // for(uint8_t objid = startid; objid < 20; objid++) { // lv_obj_t* obj = hasp_find_obj_from_parent_id(get_page_obj(page), objid); diff --git a/src/hasp/hasp_object.h b/src/hasp/hasp_object.h index 16e4adfb..2b2eecc1 100644 --- a/src/hasp/hasp_object.h +++ b/src/hasp/hasp_object.h @@ -75,7 +75,7 @@ void object_dispatch_state(uint8_t pageid, uint8_t btnid, const char* payload); void hasp_process_attribute(uint8_t pageid, uint8_t objid, const char* attr, const char* payload); -void object_set_normalized_group_value(uint8_t groupid, lv_obj_t* src_obj, int16_t val, int16_t min, int16_t max); +void object_set_normalized_group_values(uint8_t groupid, lv_obj_t* src_obj, int16_t val, int16_t min, int16_t max); #define HASP_OBJ_BAR 1971 #define HASP_OBJ_BTN 3164