Add #if HASP_USE_QRCODE

This commit is contained in:
fvanroie 2024-04-04 01:31:22 +02:00
parent 9b57bf6feb
commit 9ba255807e

View File

@ -1757,8 +1757,10 @@ static hasp_attribute_type_t attribute_common_text(lv_obj_t* obj, uint16_t attr_
#if LV_USE_WIN != 0 #if LV_USE_WIN != 0
{LV_HASP_WINDOW, ATTR_TEXT, lv_win_set_title, lv_win_get_title}, {LV_HASP_WINDOW, ATTR_TEXT, lv_win_set_title, lv_win_get_title},
#endif #endif
{LV_HASP_MSGBOX, ATTR_TEXT, my_msgbox_set_text, lv_msgbox_get_text}, #if HASP_USE_QRCODE > 0
{LV_HASP_QRCODE, ATTR_TEXT, my_qrcode_set_text, my_qrcode_get_text} {LV_HASP_QRCODE, ATTR_TEXT, my_qrcode_set_text, my_qrcode_get_text},
#endif
{LV_HASP_MSGBOX, ATTR_TEXT, my_msgbox_set_text, lv_msgbox_get_text}
}; };
for(int i = 0; i < sizeof(list) / sizeof(list[0]); i++) { for(int i = 0; i < sizeof(list) / sizeof(list[0]); i++) {
@ -2375,12 +2377,12 @@ static hasp_attribute_type_t attribute_common_int(lv_obj_t* obj, uint16_t attr_h
val = obj->user_data.groupid; val = obj->user_data.groupid;
break; // attribute_found break; // attribute_found
// case ATTR_TRANSITION: // case ATTR_TRANSITION:
// if(update) // if(update)
// obj->user_data.transitionid = (uint8_t)val; // obj->user_data.transitionid = (uint8_t)val;
// else // else
// val = obj->user_data.transitionid; // val = obj->user_data.transitionid;
// break; // attribute_found // break; // attribute_found
case ATTR_OBJID: case ATTR_OBJID:
if(update && val != obj->user_data.objid) return HASP_ATTR_TYPE_INT_READONLY; if(update && val != obj->user_data.objid) return HASP_ATTR_TYPE_INT_READONLY;
@ -2452,6 +2454,7 @@ static hasp_attribute_type_t attribute_common_int(lv_obj_t* obj, uint16_t attr_h
val = lv_obj_get_ext_click_pad_top(obj); val = lv_obj_get_ext_click_pad_top(obj);
break; // attribute_found break; // attribute_found
#if HASP_USE_QRCODE > 0
case ATTR_SIZE: case ATTR_SIZE:
if(obj_check_type(obj, LV_HASP_QRCODE)) { if(obj_check_type(obj, LV_HASP_QRCODE)) {
if(update) { if(update) {
@ -2461,6 +2464,7 @@ static hasp_attribute_type_t attribute_common_int(lv_obj_t* obj, uint16_t attr_h
} }
} }
break; break;
#endif
default: default:
return HASP_ATTR_TYPE_NOT_FOUND; // attribute_not found return HASP_ATTR_TYPE_NOT_FOUND; // attribute_not found
@ -2511,12 +2515,12 @@ static hasp_attribute_type_t attribute_common_bool(lv_obj_t* obj, uint16_t attr_
val = !(lv_obj_get_state(obj, LV_BTN_PART_MAIN) & LV_STATE_DISABLED); val = !(lv_obj_get_state(obj, LV_BTN_PART_MAIN) & LV_STATE_DISABLED);
break; // attribute_found break; // attribute_found
// case ATTR_SWIPE: // case ATTR_SWIPE:
// if(update) // if(update)
// obj->user_data.swipeid = (!!val) % 16; // obj->user_data.swipeid = (!!val) % 16;
// else // else
// val = obj->user_data.swipeid; // val = obj->user_data.swipeid;
// break; // attribute_found // break; // attribute_found
case ATTR_TOGGLE: case ATTR_TOGGLE:
switch(obj_get_type(obj)) { switch(obj_get_type(obj)) {