SD卡剩余存储空间查询功能完毕

This commit is contained in:
jarvis 2025-03-13 14:04:19 +08:00
parent 7f8ed9aaba
commit 33d1e78c29
28 changed files with 493 additions and 553 deletions

File diff suppressed because one or more lines are too long

View File

@ -21597,436 +21597,6 @@
"guid": "GUID54981273-416665S4525470",
"deepid": -272247948,
"children": [
{
"guid": "GUID27659208-416643S4516470",
"deepid": -405853522,
"children": [
{
"guid": "GUID37214586-416641S4516470",
"deepid": -1036970608,
"dont_export": false,
"locked": false,
"properties": [
{
"nid": -2115434375,
"strtype": "OBJECT/Name",
"strval": "labelReadSDCard",
"InheritedType": 10
},
{
"nid": 78222931,
"strtype": "OBJECT/Layout",
"InheritedType": 1
},
{
"Flow": 0,
"Wrap": false,
"Reversed": false,
"MainAlignment": 0,
"CrossAlignment": 0,
"TrackAlignment": 0,
"LayoutType": 0,
"nid": -24032721,
"strtype": "OBJECT/Layout_type",
"strval": "No_layout",
"InheritedType": 13
},
{
"nid": -991820165,
"strtype": "OBJECT/Transform",
"InheritedType": 1
},
{
"nid": -1412771030,
"flags": 17,
"strtype": "OBJECT/Position",
"intarray": [
6,
0
],
"InheritedType": 7
},
{
"nid": 1117825647,
"flags": 51,
"strtype": "OBJECT/Size",
"intarray": [
1,
1
],
"InheritedType": 7
},
{
"nid": 264469869,
"strtype": "OBJECT/Align",
"strval": "LEFT_MID",
"InheritedType": 3
},
{
"nid": -1121968139,
"flags": 1048576,
"strtype": "OBJECT/Flags",
"InheritedType": 1
},
{
"nid": 27949949,
"strtype": "OBJECT/Clickable",
"strval": "False",
"InheritedType": 2
},
{
"nid": 225,
"flags": 1048576,
"strtype": "OBJECT/Scrolling",
"InheritedType": 1
},
{
"nid": -352989475,
"strtype": "OBJECT/Scrollbar_mode",
"strval": "AUTO",
"InheritedType": 3
},
{
"nid": 1998480301,
"strtype": "OBJECT/Scroll_direction",
"strval": "ALL",
"InheritedType": 3
},
{
"nid": 314,
"strtype": "OBJECT/Scroll_snap_x",
"strval": "NONE",
"InheritedType": 3
},
{
"nid": 315,
"strtype": "OBJECT/Scroll_snap_y",
"strval": "NONE",
"InheritedType": 3
},
{
"nid": 1183940027,
"flags": 1048576,
"strtype": "OBJECT/States",
"InheritedType": 1
},
{
"nid": -2082824226,
"strtype": "LABEL/Label",
"InheritedType": 1
},
{
"nid": -823186472,
"strtype": "LABEL/Long_mode",
"strval": "WRAP",
"InheritedType": 3
},
{
"nid": -1016692578,
"strtype": "LABEL/Text",
"strval": "< < <Read SD Card Infomation > > >",
"InheritedType": 10
},
{
"part": "lv.PART.MAIN",
"childs": [
{
"nid": -1517026208,
"strtype": "_style/StyleState",
"strval": "DEFAULT",
"childs": [
{
"nid": -1215236551,
"strtype": "_style/Text_Font",
"strval": "MiSansM",
"InheritedType": 3
}
],
"InheritedType": 1
}
],
"nid": 1519611281,
"strtype": "LABEL/Style_main",
"strval": "lv.PART.MAIN, Text, Rectangle, Pad, Transform",
"InheritedType": 11
},
{
"nid": -405618431,
"strtype": "LABEL/Recolor",
"strval": "False",
"InheritedType": 2
}
],
"saved_objtypeKey": "LABEL"
}
],
"dont_export": false,
"locked": false,
"properties": [
{
"nid": -681132463,
"strtype": "OBJECT/Name",
"strval": "panelReadSDCard",
"InheritedType": 10
},
{
"nid": -213406922,
"strtype": "OBJECT/Layout",
"InheritedType": 1
},
{
"Flow": 0,
"Wrap": false,
"Reversed": false,
"MainAlignment": 0,
"CrossAlignment": 0,
"TrackAlignment": 0,
"LayoutType": 0,
"nid": 226946871,
"strtype": "OBJECT/Layout_type",
"strval": "No_layout",
"InheritedType": 13
},
{
"nid": 1924889041,
"strtype": "OBJECT/Transform",
"InheritedType": 1
},
{
"nid": 1022385359,
"flags": 17,
"strtype": "OBJECT/Position",
"intarray": [
0,
-192
],
"InheritedType": 7
},
{
"nid": -1902044296,
"flags": 17,
"strtype": "OBJECT/Size",
"intarray": [
320,
40
],
"InheritedType": 7
},
{
"nid": -1867879252,
"strtype": "OBJECT/Align",
"strval": "CENTER",
"InheritedType": 3
},
{
"nid": 182248937,
"strtype": "OBJECT/Flags",
"InheritedType": 1
},
{
"nid": 1986213011,
"strtype": "OBJECT/Press_lock",
"strval": "False",
"InheritedType": 2
},
{
"nid": 1140440416,
"strtype": "OBJECT/Click_focusable",
"strval": "False",
"InheritedType": 2
},
{
"nid": 225,
"flags": 1048576,
"strtype": "OBJECT/Scrolling",
"InheritedType": 1
},
{
"nid": 258676648,
"strtype": "OBJECT/Scrollable",
"strval": "False",
"InheritedType": 2
},
{
"nid": 879869614,
"strtype": "OBJECT/Scroll_elastic",
"strval": "False",
"InheritedType": 2
},
{
"nid": -1864463964,
"strtype": "OBJECT/Scroll_momentum",
"strval": "False",
"InheritedType": 2
},
{
"nid": -1668155878,
"strtype": "OBJECT/Scroll_chain",
"strval": "False",
"InheritedType": 2
},
{
"nid": -990896041,
"strtype": "OBJECT/Scrollbar_mode",
"strval": "AUTO",
"InheritedType": 3
},
{
"nid": -107218965,
"strtype": "OBJECT/Scroll_direction",
"strval": "ALL",
"InheritedType": 3
},
{
"nid": 314,
"strtype": "OBJECT/Scroll_snap_x",
"strval": "NONE",
"InheritedType": 3
},
{
"nid": 315,
"strtype": "OBJECT/Scroll_snap_y",
"strval": "NONE",
"InheritedType": 3
},
{
"nid": -1232892943,
"flags": 1048576,
"strtype": "OBJECT/States",
"InheritedType": 1
},
{
"part": "lv.PART.MAIN",
"childs": [
{
"nid": 39589672,
"strtype": "_style/StyleState",
"strval": "DEFAULT",
"childs": [
{
"nid": -572322502,
"strtype": "_style/Bg_Radius",
"InheritedType": 6
},
{
"nid": 354027873,
"strtype": "_style/Bg_Color",
"intarray": [
255,
255,
255,
255
],
"InheritedType": 7
},
{
"nid": -641560474,
"strtype": "_style/Border_Color",
"intarray": [
180,
180,
180,
255
],
"InheritedType": 7
},
{
"nid": -471990370,
"strtype": "_style/Border width",
"integer": 1,
"InheritedType": 6
},
{
"nid": -875694179,
"strtype": "_style/Border side",
"strval": "BOTTOM",
"InheritedType": 3
}
],
"InheritedType": 1
}
],
"nid": -1103671070,
"strtype": "PANEL/Style_main",
"strval": "lv.PART.MAIN, Rectangle, Pad, Text, Transform",
"InheritedType": 11
},
{
"part": "lv.PART.SCROLLBAR",
"childs": [],
"nid": 203295555,
"strtype": "PANEL/Style_scrollbar",
"strval": "lv.PART.SCROLLBAR, Rectangle, Pad",
"InheritedType": 11
},
{
"disabled": false,
"nid": 1000293,
"strtype": "_event/EventHandler",
"strval": "CLICKED",
"childs": [
{
"nid": 1000294,
"strtype": "_event/name",
"strval": "Event19",
"InheritedType": 10
},
{
"nid": 1000295,
"strtype": "_event/condition_C",
"strval": "",
"InheritedType": 10
},
{
"nid": 1000296,
"strtype": "_event/condition_P",
"strval": "",
"InheritedType": 10
},
{
"nid": 1000297,
"strtype": "_event/action",
"strval": "CALL FUNCTION",
"childs": [
{
"nid": 1000298,
"strtype": "CALL FUNCTION/Name",
"strval": "CALL FUNCTION",
"InheritedType": 10
},
{
"nid": 1000299,
"strtype": "CALL FUNCTION/Call",
"strval": "<{Function_name}>( event_struct )",
"InheritedType": 10
},
{
"nid": 1000300,
"strtype": "CALL FUNCTION/CallC",
"strval": "<{Function_name}>( e );",
"InheritedType": 10
},
{
"nid": 1000301,
"strtype": "CALL FUNCTION/Function_name",
"strval": "on_panelReadSDCard_clicked",
"InheritedType": 10
},
{
"nid": 1000302,
"strtype": "CALL FUNCTION/Dont_export_function",
"strval": "False",
"InheritedType": 2
}
],
"InheritedType": 10
}
],
"InheritedType": 4
}
],
"saved_objtypeKey": "PANEL"
},
{
"guid": "GUID17247824-416674S31629470",
"deepid": 1778734548,
@ -22094,10 +21664,15 @@
},
{
"nid": 90,
"flags": 1048576,
"strtype": "OBJECT/Flags",
"InheritedType": 1
},
{
"nid": 110,
"strtype": "OBJECT/Clickable",
"strval": "False",
"InheritedType": 2
},
{
"nid": 225,
"flags": 1048576,
@ -22391,7 +21966,7 @@
"strtype": "OBJECT/Position",
"intarray": [
62,
-72
-130
],
"InheritedType": 7
},
@ -22476,8 +22051,7 @@
"InheritedType": 11
}
],
"saved_objtypeKey": "PANEL",
"tree_closed": true
"saved_objtypeKey": "PANEL"
},
{
"guid": "GUID52991056-416682S30629470",
@ -22952,7 +22526,7 @@
"strtype": "OBJECT/Position",
"intarray": [
-96,
-72
-130
],
"InheritedType": 7
},
@ -22962,7 +22536,7 @@
"strtype": "OBJECT/Size",
"intarray": [
112,
173
180
],
"InheritedType": 7
},
@ -23079,8 +22653,8 @@
"flags": 17,
"strtype": "OBJECT/Position",
"intarray": [
0,
89
-1,
36
],
"InheritedType": 7
},
@ -23223,6 +22797,346 @@
}
],
"saved_objtypeKey": "TEXTAREA"
},
{
"guid": "GUID87854016-304018S714472",
"deepid": -1364038747,
"children": [
{
"guid": "GUID37214586-416641S4516470",
"deepid": -1036970608,
"dont_export": false,
"locked": false,
"properties": [
{
"nid": -2115434375,
"strtype": "OBJECT/Name",
"strval": "labelReadSDCard",
"InheritedType": 10
},
{
"nid": 78222931,
"strtype": "OBJECT/Layout",
"InheritedType": 1
},
{
"Flow": 0,
"Wrap": false,
"Reversed": false,
"MainAlignment": 0,
"CrossAlignment": 0,
"TrackAlignment": 0,
"LayoutType": 0,
"nid": -24032721,
"strtype": "OBJECT/Layout_type",
"strval": "No_layout",
"InheritedType": 13
},
{
"nid": -991820165,
"strtype": "OBJECT/Transform",
"InheritedType": 1
},
{
"nid": -1412771030,
"flags": 17,
"strtype": "OBJECT/Position",
"intarray": [
-5,
-1
],
"InheritedType": 7
},
{
"nid": 1117825647,
"flags": 51,
"strtype": "OBJECT/Size",
"intarray": [
1,
1
],
"InheritedType": 7
},
{
"nid": 264469869,
"strtype": "OBJECT/Align",
"strval": "LEFT_MID",
"InheritedType": 3
},
{
"nid": -1121968139,
"flags": 1048576,
"strtype": "OBJECT/Flags",
"InheritedType": 1
},
{
"nid": 27949949,
"strtype": "OBJECT/Clickable",
"strval": "False",
"InheritedType": 2
},
{
"nid": 225,
"flags": 1048576,
"strtype": "OBJECT/Scrolling",
"InheritedType": 1
},
{
"nid": -352989475,
"strtype": "OBJECT/Scrollbar_mode",
"strval": "AUTO",
"InheritedType": 3
},
{
"nid": 1998480301,
"strtype": "OBJECT/Scroll_direction",
"strval": "ALL",
"InheritedType": 3
},
{
"nid": 314,
"strtype": "OBJECT/Scroll_snap_x",
"strval": "NONE",
"InheritedType": 3
},
{
"nid": 315,
"strtype": "OBJECT/Scroll_snap_y",
"strval": "NONE",
"InheritedType": 3
},
{
"nid": 1183940027,
"flags": 1048576,
"strtype": "OBJECT/States",
"InheritedType": 1
},
{
"nid": -2082824226,
"strtype": "LABEL/Label",
"InheritedType": 1
},
{
"nid": -823186472,
"strtype": "LABEL/Long_mode",
"strval": "WRAP",
"InheritedType": 3
},
{
"nid": -1016692578,
"strtype": "LABEL/Text",
"strval": "< < <Read SD Card Infomation > > >",
"InheritedType": 10
},
{
"part": "lv.PART.MAIN",
"childs": [
{
"nid": -1517026208,
"strtype": "_style/StyleState",
"strval": "DEFAULT",
"childs": [
{
"nid": -1215236551,
"strtype": "_style/Text_Font",
"strval": "MiSansM",
"InheritedType": 3
}
],
"InheritedType": 1
}
],
"nid": 1519611281,
"strtype": "LABEL/Style_main",
"strval": "lv.PART.MAIN, Text, Rectangle, Pad, Transform",
"InheritedType": 11
},
{
"nid": -405618431,
"strtype": "LABEL/Recolor",
"strval": "False",
"InheritedType": 2
}
],
"saved_objtypeKey": "LABEL"
}
],
"dont_export": false,
"locked": false,
"properties": [
{
"nid": 10,
"strtype": "OBJECT/Name",
"strval": "buttonReadSDCard",
"InheritedType": 10
},
{
"nid": 20,
"strtype": "OBJECT/Layout",
"InheritedType": 1
},
{
"Flow": 0,
"Wrap": false,
"Reversed": false,
"MainAlignment": 0,
"CrossAlignment": 0,
"TrackAlignment": 0,
"LayoutType": 0,
"nid": 30,
"strtype": "OBJECT/Layout_type",
"strval": "No_layout",
"InheritedType": 13
},
{
"nid": 40,
"strtype": "OBJECT/Transform",
"InheritedType": 1
},
{
"nid": 50,
"flags": 17,
"strtype": "OBJECT/Position",
"intarray": [
-2,
137
],
"InheritedType": 7
},
{
"nid": 60,
"flags": 17,
"strtype": "OBJECT/Size",
"intarray": [
300,
50
],
"InheritedType": 7
},
{
"nid": 70,
"strtype": "OBJECT/Align",
"strval": "CENTER",
"InheritedType": 3
},
{
"nid": 90,
"flags": 1048576,
"strtype": "OBJECT/Flags",
"InheritedType": 1
},
{
"nid": 225,
"flags": 1048576,
"strtype": "OBJECT/Scrolling",
"InheritedType": 1
},
{
"nid": 300,
"strtype": "OBJECT/Scrollbar_mode",
"strval": "AUTO",
"InheritedType": 3
},
{
"nid": 310,
"strtype": "OBJECT/Scroll_direction",
"strval": "ALL",
"InheritedType": 3
},
{
"nid": 314,
"strtype": "OBJECT/Scroll_snap_x",
"strval": "NONE",
"InheritedType": 3
},
{
"nid": 315,
"strtype": "OBJECT/Scroll_snap_y",
"strval": "NONE",
"InheritedType": 3
},
{
"nid": 320,
"flags": 1048576,
"strtype": "OBJECT/States",
"InheritedType": 1
},
{
"part": "lv.PART.MAIN",
"childs": [],
"nid": 1010,
"strtype": "BUTTON/Style_main",
"strval": "lv.PART.MAIN, Rectangle, Pad, Text, Transform",
"InheritedType": 11
},
{
"disabled": false,
"nid": 1000323,
"strtype": "_event/EventHandler",
"strval": "CLICKED",
"childs": [
{
"nid": 1000324,
"strtype": "_event/name",
"strval": "Event22",
"InheritedType": 10
},
{
"nid": 1000325,
"strtype": "_event/condition_C",
"strval": "",
"InheritedType": 10
},
{
"nid": 1000326,
"strtype": "_event/condition_P",
"strval": "",
"InheritedType": 10
},
{
"nid": 1000327,
"strtype": "_event/action",
"strval": "CALL FUNCTION",
"childs": [
{
"nid": 1000328,
"strtype": "CALL FUNCTION/Name",
"strval": "CALL FUNCTION",
"InheritedType": 10
},
{
"nid": 1000329,
"strtype": "CALL FUNCTION/Call",
"strval": "<{Function_name}>( event_struct )",
"InheritedType": 10
},
{
"nid": 1000330,
"strtype": "CALL FUNCTION/CallC",
"strval": "<{Function_name}>( e );",
"InheritedType": 10
},
{
"nid": 1000331,
"strtype": "CALL FUNCTION/Function_name",
"strval": "on_buttonReadSDCard_clicked",
"InheritedType": 10
},
{
"nid": 1000332,
"strtype": "CALL FUNCTION/Dont_export_function",
"strval": "False",
"InheritedType": 2
}
],
"InheritedType": 10
}
],
"InheritedType": 4
}
],
"saved_objtypeKey": "BUTTON",
"tree_closed": true
}
],
"dont_export": false,
@ -23622,7 +23536,7 @@
"uiExportFolderPath": "D:\\yuwell_workspace\\FluxDC\\SquareLineProj\\Export",
"projectExportFolderPath": "D:\\yuwell_workspace\\FluxDC\\SquareLineProj\\Export",
"custom_variable_prefix": "uic",
"backup_cnt": 657,
"backup_cnt": 671,
"autosave_cnt": 0,
"group_color_cnt": 0,
"lvgl_version": "8.3.6",
@ -23639,7 +23553,7 @@
"drive_fatfs_path": "",
"naming": "_Screen_Name",
"naming_force_lowercase": false,
"nidcnt": 1000323,
"nidcnt": 1000333,
"BitDepth": 16,
"Name": "ESP32S3_UI"
}

View File

@ -94,3 +94,7 @@ def on_buttonFluxRead_clicked(event_struct):
def on_buttonClearTextarea_clicked(event_struct):
return
def on_buttonReadSDCard_clicked(event_struct):
return

View File

@ -53,37 +53,11 @@ void ui_pageSDCard_screen_init(void)
lv_obj_set_style_pad_top(ui_pageSDCard_panelBody, 30, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_bottom(ui_pageSDCard_panelBody, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_pageSDCard_panelReadSDCard = lv_obj_create(ui_pageSDCard_panelBody);
lv_obj_set_width(ui_pageSDCard_panelReadSDCard, 320);
lv_obj_set_height(ui_pageSDCard_panelReadSDCard, 40);
lv_obj_set_x(ui_pageSDCard_panelReadSDCard, 0);
lv_obj_set_y(ui_pageSDCard_panelReadSDCard, -192);
lv_obj_set_align(ui_pageSDCard_panelReadSDCard, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_pageSDCard_panelReadSDCard,
LV_OBJ_FLAG_PRESS_LOCK | LV_OBJ_FLAG_CLICK_FOCUSABLE | LV_OBJ_FLAG_SCROLLABLE | LV_OBJ_FLAG_SCROLL_ELASTIC |
LV_OBJ_FLAG_SCROLL_MOMENTUM | LV_OBJ_FLAG_SCROLL_CHAIN); /// Flags
lv_obj_set_style_radius(ui_pageSDCard_panelReadSDCard, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_pageSDCard_panelReadSDCard, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_pageSDCard_panelReadSDCard, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_border_color(ui_pageSDCard_panelReadSDCard, lv_color_hex(0xB4B4B4), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_border_opa(ui_pageSDCard_panelReadSDCard, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_border_width(ui_pageSDCard_panelReadSDCard, 1, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_border_side(ui_pageSDCard_panelReadSDCard, LV_BORDER_SIDE_BOTTOM, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_pageSDCard_labelReadSDCard = lv_label_create(ui_pageSDCard_panelReadSDCard);
lv_obj_set_width(ui_pageSDCard_labelReadSDCard, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_pageSDCard_labelReadSDCard, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_pageSDCard_labelReadSDCard, 6);
lv_obj_set_y(ui_pageSDCard_labelReadSDCard, 0);
lv_obj_set_align(ui_pageSDCard_labelReadSDCard, LV_ALIGN_LEFT_MID);
lv_label_set_text(ui_pageSDCard_labelReadSDCard, "< < <Read SD Card Infomation > > >");
lv_obj_set_style_text_font(ui_pageSDCard_labelReadSDCard, &ui_font_MiSansM, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_pageSDCard_panelSDCardFree = lv_obj_create(ui_pageSDCard_panelBody);
lv_obj_set_width(ui_pageSDCard_panelSDCardFree, 180);
lv_obj_set_height(ui_pageSDCard_panelSDCardFree, 180);
lv_obj_set_x(ui_pageSDCard_panelSDCardFree, 62);
lv_obj_set_y(ui_pageSDCard_panelSDCardFree, -72);
lv_obj_set_y(ui_pageSDCard_panelSDCardFree, -130);
lv_obj_set_align(ui_pageSDCard_panelSDCardFree, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_pageSDCard_panelSDCardFree, LV_OBJ_FLAG_SCROLLABLE); /// Flags
@ -93,6 +67,7 @@ void ui_pageSDCard_screen_init(void)
lv_obj_set_x(ui_pageSDCard_arcSDCardFree, 3);
lv_obj_set_y(ui_pageSDCard_arcSDCardFree, 4);
lv_obj_set_align(ui_pageSDCard_arcSDCardFree, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_pageSDCard_arcSDCardFree, LV_OBJ_FLAG_CLICKABLE); /// Flags
lv_arc_set_value(ui_pageSDCard_arcSDCardFree, 50);
ui_pageSDCard_labelSDCardFree = lv_label_create(ui_pageSDCard_panelSDCardFree);
@ -105,9 +80,9 @@ void ui_pageSDCard_screen_init(void)
ui_pageSDCard_panelSDCardUse = lv_obj_create(ui_pageSDCard_panelBody);
lv_obj_set_width(ui_pageSDCard_panelSDCardUse, 112);
lv_obj_set_height(ui_pageSDCard_panelSDCardUse, 173);
lv_obj_set_height(ui_pageSDCard_panelSDCardUse, 180);
lv_obj_set_x(ui_pageSDCard_panelSDCardUse, -96);
lv_obj_set_y(ui_pageSDCard_panelSDCardUse, -72);
lv_obj_set_y(ui_pageSDCard_panelSDCardUse, -130);
lv_obj_set_align(ui_pageSDCard_panelSDCardUse, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_pageSDCard_panelSDCardUse, LV_OBJ_FLAG_SCROLLABLE); /// Flags
@ -138,13 +113,29 @@ void ui_pageSDCard_screen_init(void)
ui_pageSDCard_textAreaSDCard = lv_textarea_create(ui_pageSDCard_panelBody);
lv_obj_set_width(ui_pageSDCard_textAreaSDCard, 320);
lv_obj_set_height(ui_pageSDCard_textAreaSDCard, 130);
lv_obj_set_x(ui_pageSDCard_textAreaSDCard, 0);
lv_obj_set_y(ui_pageSDCard_textAreaSDCard, 89);
lv_obj_set_x(ui_pageSDCard_textAreaSDCard, -1);
lv_obj_set_y(ui_pageSDCard_textAreaSDCard, 36);
lv_obj_set_align(ui_pageSDCard_textAreaSDCard, LV_ALIGN_CENTER);
lv_textarea_set_placeholder_text(ui_pageSDCard_textAreaSDCard, "Placeholder...");
ui_pageSDCard_buttonReadSDCard = lv_btn_create(ui_pageSDCard_panelBody);
lv_obj_set_width(ui_pageSDCard_buttonReadSDCard, 300);
lv_obj_set_height(ui_pageSDCard_buttonReadSDCard, 50);
lv_obj_set_x(ui_pageSDCard_buttonReadSDCard, -2);
lv_obj_set_y(ui_pageSDCard_buttonReadSDCard, 137);
lv_obj_set_align(ui_pageSDCard_buttonReadSDCard, LV_ALIGN_CENTER);
ui_pageSDCard_labelReadSDCard = lv_label_create(ui_pageSDCard_buttonReadSDCard);
lv_obj_set_width(ui_pageSDCard_labelReadSDCard, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_pageSDCard_labelReadSDCard, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_pageSDCard_labelReadSDCard, -5);
lv_obj_set_y(ui_pageSDCard_labelReadSDCard, -1);
lv_obj_set_align(ui_pageSDCard_labelReadSDCard, LV_ALIGN_LEFT_MID);
lv_label_set_text(ui_pageSDCard_labelReadSDCard, "< < <Read SD Card Infomation > > >");
lv_obj_set_style_text_font(ui_pageSDCard_labelReadSDCard, &ui_font_MiSansM, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_add_event_cb(ui_pageSDCard_panelHeader, ui_event_pageSDCard_panelHeader, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ui_pageSDCard_panelReadSDCard, ui_event_pageSDCard_panelReadSDCard, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ui_pageSDCard_buttonReadSDCard, ui_event_pageSDCard_buttonReadSDCard, LV_EVENT_ALL, NULL);
uic_pageSDCard_panelSDCardFree = ui_pageSDCard_panelSDCardFree;
}

View File

@ -200,9 +200,6 @@ lv_obj_t * ui_pageSDCard_panelHeader;
lv_obj_t * ui_pageSDCard_labelHeaderTitle;
lv_obj_t * ui_pageSDCard_labelBack;
lv_obj_t * ui_pageSDCard_panelBody;
void ui_event_pageSDCard_panelReadSDCard(lv_event_t * e);
lv_obj_t * ui_pageSDCard_panelReadSDCard;
lv_obj_t * ui_pageSDCard_labelReadSDCard;
lv_obj_t * ui_pageSDCard_panelSDCardFree;
lv_obj_t * ui_pageSDCard_arcSDCardFree;
lv_obj_t * ui_pageSDCard_labelSDCardFree;
@ -211,6 +208,9 @@ lv_obj_t * ui_pageSDCard_labelSDCardUsed;
lv_obj_t * ui_pageSDCard_labelSDCardSize;
lv_obj_t * ui_pageSDCard_lableSDCardMountPoint;
lv_obj_t * ui_pageSDCard_textAreaSDCard;
void ui_event_pageSDCard_buttonReadSDCard(lv_event_t * e);
lv_obj_t * ui_pageSDCard_buttonReadSDCard;
lv_obj_t * ui_pageSDCard_labelReadSDCard;
// CUSTOM VARIABLES
lv_obj_t * uic_pageSDCard_panelSDCardFree;
@ -519,12 +519,12 @@ void ui_event_pageSDCard_panelHeader(lv_event_t * e)
}
}
void ui_event_pageSDCard_panelReadSDCard(lv_event_t * e)
void ui_event_pageSDCard_buttonReadSDCard(lv_event_t * e)
{
lv_event_code_t event_code = lv_event_get_code(e);
if(event_code == LV_EVENT_CLICKED) {
on_panelReadSDCard_clicked(e);
on_buttonReadSDCard_clicked(e);
}
}

View File

@ -208,9 +208,6 @@ extern lv_obj_t * ui_pageSDCard_panelHeader;
extern lv_obj_t * ui_pageSDCard_labelHeaderTitle;
extern lv_obj_t * ui_pageSDCard_labelBack;
extern lv_obj_t * ui_pageSDCard_panelBody;
void ui_event_pageSDCard_panelReadSDCard(lv_event_t * e);
extern lv_obj_t * ui_pageSDCard_panelReadSDCard;
extern lv_obj_t * ui_pageSDCard_labelReadSDCard;
extern lv_obj_t * ui_pageSDCard_panelSDCardFree;
extern lv_obj_t * ui_pageSDCard_arcSDCardFree;
extern lv_obj_t * ui_pageSDCard_labelSDCardFree;
@ -219,6 +216,9 @@ extern lv_obj_t * ui_pageSDCard_labelSDCardUsed;
extern lv_obj_t * ui_pageSDCard_labelSDCardSize;
extern lv_obj_t * ui_pageSDCard_lableSDCardMountPoint;
extern lv_obj_t * ui_pageSDCard_textAreaSDCard;
void ui_event_pageSDCard_buttonReadSDCard(lv_event_t * e);
extern lv_obj_t * ui_pageSDCard_buttonReadSDCard;
extern lv_obj_t * ui_pageSDCard_labelReadSDCard;
// CUSTOM VARIABLES
extern lv_obj_t * uic_pageSDCard_panelSDCardFree;

View File

@ -119,3 +119,8 @@ void on_buttonClearTextarea_clicked(lv_event_t * e)
{
// Your code here
}
void on_buttonReadSDCard_clicked(lv_event_t * e)
{
// Your code here
}

View File

@ -19,7 +19,7 @@ void on_dropDownWifiName_valueChanged(lv_event_t * e);
void on_buttonClearPassword_clicked(lv_event_t * e);
void on_buttonSearchWifi_clicked(lv_event_t * e);
void on_buttonConnectWifi_clicked(lv_event_t * e);
void on_panelReadSDCard_clicked(lv_event_t * e);
void on_buttonReadSDCard_clicked(lv_event_t * e);
#ifdef __cplusplus
} /*extern "C"*/

View File

@ -131,9 +131,9 @@ static esp_err_t s_example_read_file(const char *path)
return ESP_OK;
}
uint64_t total_bytes = 0;
uint64_t free_bytes = 0;
float free_percent = 0;
uint64_t total_bytes = 0;
uint64_t free_bytes = 0;
float free_percent = 0;
void flux_sd_init(void)
{
@ -184,13 +184,15 @@ void flux_sd_init(void)
const char *file_hello = MOUNT_POINT"/hello.txt";
char data[EXAMPLE_MAX_CHAR_SIZE];
snprintf(data, EXAMPLE_MAX_CHAR_SIZE, "%s %s!\n", "Hello how are you", card->cid.name);
ret = s_example_write_file(file_hello, data);
if (ret != ESP_OK) {
return;
}
#if 0
esp_vfs_fat_info(MOUNT_POINT,&total_bytes,&free_bytes);
free_percent = (float)free_bytes / (float)total_bytes * 100;
@ -198,6 +200,7 @@ void flux_sd_init(void)
printf("Total space: %llu\n", total_bytes);
printf("Free space: %llu\n", free_bytes);
printf("Free percent: %.3f\n", free_percent);
#endif
}

View File

@ -15,6 +15,10 @@ extern "C" {
#define EXAMPLE_MAX_CHAR_SIZE 64
#define MOUNT_POINT "/sdcard"
extern uint64_t total_bytes;
extern uint64_t free_bytes;
extern float free_percent;
typedef struct {
const char** names;

View File

@ -29,5 +29,5 @@ fonts/ui_font_symbolsalibaba.c
)
idf_component_register(SRCS ${SOURCES}
PRIV_REQUIRES driver lvgl FluxMod FluxWifi FluxUart
PRIV_REQUIRES driver lvgl FluxMod FluxWifi FluxUart FluxSD
INCLUDE_DIRS "." )

View File

@ -53,37 +53,11 @@ void ui_pageSDCard_screen_init(void)
lv_obj_set_style_pad_top(ui_pageSDCard_panelBody, 30, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_bottom(ui_pageSDCard_panelBody, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_pageSDCard_panelReadSDCard = lv_obj_create(ui_pageSDCard_panelBody);
lv_obj_set_width(ui_pageSDCard_panelReadSDCard, 320);
lv_obj_set_height(ui_pageSDCard_panelReadSDCard, 40);
lv_obj_set_x(ui_pageSDCard_panelReadSDCard, 0);
lv_obj_set_y(ui_pageSDCard_panelReadSDCard, -192);
lv_obj_set_align(ui_pageSDCard_panelReadSDCard, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_pageSDCard_panelReadSDCard,
LV_OBJ_FLAG_PRESS_LOCK | LV_OBJ_FLAG_CLICK_FOCUSABLE | LV_OBJ_FLAG_SCROLLABLE | LV_OBJ_FLAG_SCROLL_ELASTIC |
LV_OBJ_FLAG_SCROLL_MOMENTUM | LV_OBJ_FLAG_SCROLL_CHAIN); /// Flags
lv_obj_set_style_radius(ui_pageSDCard_panelReadSDCard, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_pageSDCard_panelReadSDCard, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_pageSDCard_panelReadSDCard, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_border_color(ui_pageSDCard_panelReadSDCard, lv_color_hex(0xB4B4B4), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_border_opa(ui_pageSDCard_panelReadSDCard, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_border_width(ui_pageSDCard_panelReadSDCard, 1, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_border_side(ui_pageSDCard_panelReadSDCard, LV_BORDER_SIDE_BOTTOM, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_pageSDCard_labelReadSDCard = lv_label_create(ui_pageSDCard_panelReadSDCard);
lv_obj_set_width(ui_pageSDCard_labelReadSDCard, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_pageSDCard_labelReadSDCard, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_pageSDCard_labelReadSDCard, 6);
lv_obj_set_y(ui_pageSDCard_labelReadSDCard, 0);
lv_obj_set_align(ui_pageSDCard_labelReadSDCard, LV_ALIGN_LEFT_MID);
lv_label_set_text(ui_pageSDCard_labelReadSDCard, "< < <Read SD Card Infomation > > >");
lv_obj_set_style_text_font(ui_pageSDCard_labelReadSDCard, &ui_font_MiSansM, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_pageSDCard_panelSDCardFree = lv_obj_create(ui_pageSDCard_panelBody);
lv_obj_set_width(ui_pageSDCard_panelSDCardFree, 180);
lv_obj_set_height(ui_pageSDCard_panelSDCardFree, 180);
lv_obj_set_x(ui_pageSDCard_panelSDCardFree, 62);
lv_obj_set_y(ui_pageSDCard_panelSDCardFree, -72);
lv_obj_set_y(ui_pageSDCard_panelSDCardFree, -130);
lv_obj_set_align(ui_pageSDCard_panelSDCardFree, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_pageSDCard_panelSDCardFree, LV_OBJ_FLAG_SCROLLABLE); /// Flags
@ -93,6 +67,7 @@ void ui_pageSDCard_screen_init(void)
lv_obj_set_x(ui_pageSDCard_arcSDCardFree, 3);
lv_obj_set_y(ui_pageSDCard_arcSDCardFree, 4);
lv_obj_set_align(ui_pageSDCard_arcSDCardFree, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_pageSDCard_arcSDCardFree, LV_OBJ_FLAG_CLICKABLE); /// Flags
lv_arc_set_value(ui_pageSDCard_arcSDCardFree, 50);
ui_pageSDCard_labelSDCardFree = lv_label_create(ui_pageSDCard_panelSDCardFree);
@ -105,9 +80,9 @@ void ui_pageSDCard_screen_init(void)
ui_pageSDCard_panelSDCardUse = lv_obj_create(ui_pageSDCard_panelBody);
lv_obj_set_width(ui_pageSDCard_panelSDCardUse, 112);
lv_obj_set_height(ui_pageSDCard_panelSDCardUse, 173);
lv_obj_set_height(ui_pageSDCard_panelSDCardUse, 180);
lv_obj_set_x(ui_pageSDCard_panelSDCardUse, -96);
lv_obj_set_y(ui_pageSDCard_panelSDCardUse, -72);
lv_obj_set_y(ui_pageSDCard_panelSDCardUse, -130);
lv_obj_set_align(ui_pageSDCard_panelSDCardUse, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_pageSDCard_panelSDCardUse, LV_OBJ_FLAG_SCROLLABLE); /// Flags
@ -138,13 +113,29 @@ void ui_pageSDCard_screen_init(void)
ui_pageSDCard_textAreaSDCard = lv_textarea_create(ui_pageSDCard_panelBody);
lv_obj_set_width(ui_pageSDCard_textAreaSDCard, 320);
lv_obj_set_height(ui_pageSDCard_textAreaSDCard, 130);
lv_obj_set_x(ui_pageSDCard_textAreaSDCard, 0);
lv_obj_set_y(ui_pageSDCard_textAreaSDCard, 89);
lv_obj_set_x(ui_pageSDCard_textAreaSDCard, -1);
lv_obj_set_y(ui_pageSDCard_textAreaSDCard, 36);
lv_obj_set_align(ui_pageSDCard_textAreaSDCard, LV_ALIGN_CENTER);
lv_textarea_set_placeholder_text(ui_pageSDCard_textAreaSDCard, "Placeholder...");
ui_pageSDCard_buttonReadSDCard = lv_btn_create(ui_pageSDCard_panelBody);
lv_obj_set_width(ui_pageSDCard_buttonReadSDCard, 300);
lv_obj_set_height(ui_pageSDCard_buttonReadSDCard, 50);
lv_obj_set_x(ui_pageSDCard_buttonReadSDCard, -2);
lv_obj_set_y(ui_pageSDCard_buttonReadSDCard, 137);
lv_obj_set_align(ui_pageSDCard_buttonReadSDCard, LV_ALIGN_CENTER);
ui_pageSDCard_labelReadSDCard = lv_label_create(ui_pageSDCard_buttonReadSDCard);
lv_obj_set_width(ui_pageSDCard_labelReadSDCard, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_pageSDCard_labelReadSDCard, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_pageSDCard_labelReadSDCard, -5);
lv_obj_set_y(ui_pageSDCard_labelReadSDCard, -1);
lv_obj_set_align(ui_pageSDCard_labelReadSDCard, LV_ALIGN_LEFT_MID);
lv_label_set_text(ui_pageSDCard_labelReadSDCard, "< < <Read SD Card Infomation > > >");
lv_obj_set_style_text_font(ui_pageSDCard_labelReadSDCard, &ui_font_MiSansM, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_add_event_cb(ui_pageSDCard_panelHeader, ui_event_pageSDCard_panelHeader, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ui_pageSDCard_panelReadSDCard, ui_event_pageSDCard_panelReadSDCard, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ui_pageSDCard_buttonReadSDCard, ui_event_pageSDCard_buttonReadSDCard, LV_EVENT_ALL, NULL);
uic_pageSDCard_panelSDCardFree = ui_pageSDCard_panelSDCardFree;
}

View File

@ -200,9 +200,6 @@ lv_obj_t * ui_pageSDCard_panelHeader;
lv_obj_t * ui_pageSDCard_labelHeaderTitle;
lv_obj_t * ui_pageSDCard_labelBack;
lv_obj_t * ui_pageSDCard_panelBody;
void ui_event_pageSDCard_panelReadSDCard(lv_event_t * e);
lv_obj_t * ui_pageSDCard_panelReadSDCard;
lv_obj_t * ui_pageSDCard_labelReadSDCard;
lv_obj_t * ui_pageSDCard_panelSDCardFree;
lv_obj_t * ui_pageSDCard_arcSDCardFree;
lv_obj_t * ui_pageSDCard_labelSDCardFree;
@ -211,6 +208,9 @@ lv_obj_t * ui_pageSDCard_labelSDCardUsed;
lv_obj_t * ui_pageSDCard_labelSDCardSize;
lv_obj_t * ui_pageSDCard_lableSDCardMountPoint;
lv_obj_t * ui_pageSDCard_textAreaSDCard;
void ui_event_pageSDCard_buttonReadSDCard(lv_event_t * e);
lv_obj_t * ui_pageSDCard_buttonReadSDCard;
lv_obj_t * ui_pageSDCard_labelReadSDCard;
// CUSTOM VARIABLES
lv_obj_t * uic_pageSDCard_panelSDCardFree;
@ -519,12 +519,12 @@ void ui_event_pageSDCard_panelHeader(lv_event_t * e)
}
}
void ui_event_pageSDCard_panelReadSDCard(lv_event_t * e)
void ui_event_pageSDCard_buttonReadSDCard(lv_event_t * e)
{
lv_event_code_t event_code = lv_event_get_code(e);
if(event_code == LV_EVENT_CLICKED) {
on_panelReadSDCard_clicked(e);
on_buttonReadSDCard_clicked(e);
}
}

View File

@ -208,9 +208,6 @@ extern lv_obj_t * ui_pageSDCard_panelHeader;
extern lv_obj_t * ui_pageSDCard_labelHeaderTitle;
extern lv_obj_t * ui_pageSDCard_labelBack;
extern lv_obj_t * ui_pageSDCard_panelBody;
void ui_event_pageSDCard_panelReadSDCard(lv_event_t * e);
extern lv_obj_t * ui_pageSDCard_panelReadSDCard;
extern lv_obj_t * ui_pageSDCard_labelReadSDCard;
extern lv_obj_t * ui_pageSDCard_panelSDCardFree;
extern lv_obj_t * ui_pageSDCard_arcSDCardFree;
extern lv_obj_t * ui_pageSDCard_labelSDCardFree;
@ -219,6 +216,9 @@ extern lv_obj_t * ui_pageSDCard_labelSDCardUsed;
extern lv_obj_t * ui_pageSDCard_labelSDCardSize;
extern lv_obj_t * ui_pageSDCard_lableSDCardMountPoint;
extern lv_obj_t * ui_pageSDCard_textAreaSDCard;
void ui_event_pageSDCard_buttonReadSDCard(lv_event_t * e);
extern lv_obj_t * ui_pageSDCard_buttonReadSDCard;
extern lv_obj_t * ui_pageSDCard_labelReadSDCard;
// CUSTOM VARIABLES
extern lv_obj_t * uic_pageSDCard_panelSDCardFree;

View File

@ -11,6 +11,11 @@
#include "FluxMod.h"
#include "FluxWifi.h"
#include "FluxUart.h"
#include "FluxSD.h"
#include "esp_vfs_fat.h"
#include "sdmmc_cmd.h"
#include "driver/sdmmc_host.h"
#define LOWERST_LIGHT_LEVEL (7222)
@ -135,3 +140,21 @@ void on_buttonClearTextarea_clicked(lv_event_t * e)
{
lv_textarea_set_text(ui_pageDebug_textAreaContent, "");
}
void on_buttonReadSDCard_clicked(lv_event_t * e)
{
/*Ê×ÏÈÇå¿ÕÏÔÊ¾Ò³Ãæ*/
lv_textarea_set_text(ui_pageSDCard_textAreaSDCard,"");
esp_vfs_fat_info(MOUNT_POINT,&total_bytes,&free_bytes);
free_percent = (float)free_bytes / (float)total_bytes * 100;
printf("total:%llu free:%llu\n",total_bytes,free_bytes);
lv_label_set_text_fmt(ui_pageSDCard_labelSDCardFree,"%.2f free",free_percent);
lv_label_set_text_fmt(ui_pageSDCard_labelSDCardUsed,"used: %.2f GB",(double)(total_bytes-free_bytes)/(1024*1024*1024.0));
lv_label_set_text_fmt(ui_pageSDCard_labelSDCardSize,"size: %.2f GB",(double)total_bytes/(1024*1024*1024.0));
lv_arc_set_value(ui_pageSDCard_arcSDCardFree,free_percent);
}

View File

@ -19,7 +19,7 @@ void on_dropDownWifiName_valueChanged(lv_event_t * e);
void on_buttonClearPassword_clicked(lv_event_t * e);
void on_buttonSearchWifi_clicked(lv_event_t * e);
void on_buttonConnectWifi_clicked(lv_event_t * e);
void on_panelReadSDCard_clicked(lv_event_t * e);
void on_buttonReadSDCard_clicked(lv_event_t * e);
#ifdef __cplusplus
} /*extern "C"*/

View File

@ -153,6 +153,7 @@ void uart2_echoTask(void)
uint8_t *data = (uint8_t *) malloc(BUF_SIZE);
unsigned short crc;
char text[64];
while (1)
{
@ -161,10 +162,13 @@ void uart2_echoTask(void)
// Write data back to the UART
uart_write_bytes(ECHO_UART_PORT_NUM2, (const char *) data, len);
if (len)
{
lv_textarea_add_text(ui_pageDebug_textAreaContent,(char *) data);
lv_textarea_add_text(ui_pageDebug_textAreaContent,"\n");
lv_textarea_add_char(ui_pageDebug_textAreaContent,'\n');
// sprintf(text,"%s",(char *) data);
// lv_textarea_add_text(ui_pageDebug_textAreaContent,(char *) text);
lv_textarea_add_text(ui_pageDebug_textAreaContent, (char *) data);
data[len] = '\0';
ESP_LOGI(TAG, "Recv str: %s", (char *) data);
@ -179,12 +183,8 @@ void uart2_echoTask(void)
esp_err_t ModbusRTU_Send(uart_port_t uart_num, struct ModbusRTU_Frame *frame)
{
unsigned short crc;
crc = CRC16((unsigned char *)frame, sizeof(frame->ADDR) + sizeof(frame->FUNC) + sizeof(frame->DATA));
frame->CRC[1] = (crc & 0xFF);
frame->CRC[0] = (crc >> 8);
char text[64];
/*ÉčÖĂšŚÄÜÂë*/
if (lv_dropdown_get_selected(ui_pageDebug_dropdownFunctionCode) == 0)
{
frame->FUNC = 0x03;
@ -192,11 +192,17 @@ esp_err_t ModbusRTU_Send(uart_port_t uart_num, struct ModbusRTU_Frame *frame)
frame->FUNC = 0x16;
}
crc = CRC16((unsigned char *)frame, sizeof(frame->ADDR) + sizeof(frame->FUNC) + sizeof(frame->DATA));
frame->CRC[1] = (crc & 0xFF);
frame->CRC[0] = (crc >> 8);
uart_write_bytes(uart_num, (const char *)frame, sizeof(struct ModbusRTU_Frame)/sizeof(unsigned char));
sprintf(text,"addr:%02X, func:%02X, data:%02X %02X %02X %02X ,crc:%02X %02X",frame->ADDR,frame->FUNC,frame->DATA[0],frame->DATA[1],frame->DATA[2],frame->DATA[3],frame->CRC[0],frame->CRC[1]);
lv_textarea_add_char(ui_pageDebug_textAreaContent,'\n');
lv_textarea_add_text(ui_pageDebug_textAreaContent,"Send: ");
lv_textarea_add_text(ui_pageDebug_textAreaContent,(char *)frame);
lv_textarea_add_text(ui_pageDebug_textAreaContent,"Send:");
lv_textarea_add_text(ui_pageDebug_textAreaContent,(char*)text);
return ESP_OK;

View File

@ -483,6 +483,16 @@ void app_main(void)
/*初始化wifi扫描环境*/
wifi_scanInit();
// Lock the mutex due to the LVGL APIs are not thread-safe
if (example_lvgl_lock(-1)) {
//example_lvgl_demo_ui(disp);
ui_init();
/*隐藏顶部加载圈圈*/
lv_obj_add_flag(ui_pageHome_spinnerStateBusy, LV_OBJ_FLAG_HIDDEN);
lv_event_send(ui_pageSDCard_buttonReadSDCard, LV_EVENT_CLICKED, NULL);
#if USE_MODBUS_OFFICIAL
/*初始化Modbus*/
ESP_ERROR_CHECK(modbus_master_init());
@ -496,17 +506,6 @@ void app_main(void)
xTaskCreate(uart2_echoTask, "uart2_echo_task", ECHO_TASK_STACK_SIZE, NULL, 10, NULL);
#endif
// Lock the mutex due to the LVGL APIs are not thread-safe
if (example_lvgl_lock(-1)) {
//example_lvgl_demo_ui(disp);
ui_init();
/*隐藏顶部加载圈圈*/
lv_obj_add_flag(ui_pageHome_spinnerStateBusy, LV_OBJ_FLAG_HIDDEN);
// Release the mutex
example_lvgl_unlock();
}