File tree 1 file changed +27
-3
lines changed
packages/project-editor/lvgl
1 file changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -361,6 +361,8 @@ export class LVGLBuild extends Build {
361
361
build . line ( "" ) ;
362
362
build . line ( `extern groups_t groups;` ) ;
363
363
build . line ( "" ) ;
364
+ build . line ( `void ui_create_groups();` ) ;
365
+ build . line ( "" ) ;
364
366
}
365
367
366
368
// objects
@@ -435,6 +437,8 @@ export class LVGLBuild extends Build {
435
437
436
438
if ( this . project . lvglGroups . groups . length > 0 ) {
437
439
build . line ( `groups_t groups;` ) ;
440
+ build . line ( "static bool groups_created = false;" ) ;
441
+ build . line ( "" ) ;
438
442
}
439
443
440
444
build . line ( `objects_t objects;` ) ;
@@ -722,10 +726,13 @@ export class LVGLBuild extends Build {
722
726
build . line ( "" ) ;
723
727
}
724
728
725
- build . line ( "void create_screens() {" ) ;
726
- build . indent ( ) ;
727
-
728
729
if ( this . project . lvglGroups . groups . length > 0 ) {
730
+ build . line ( "void ui_create_groups() {" ) ;
731
+ build . indent ( ) ;
732
+
733
+ build . line ( "if (!groups_created) {" ) ;
734
+ build . indent ( ) ;
735
+
729
736
this . project . lvglGroups . groups . forEach ( group => {
730
737
build . line (
731
738
`${ build . getGroupVariableName ( group ) } = lv_group_create();`
@@ -734,6 +741,23 @@ export class LVGLBuild extends Build {
734
741
build . line (
735
742
"eez_flow_init_groups((lv_group_t **)&groups, sizeof(groups) / sizeof(lv_group_t *));"
736
743
) ;
744
+
745
+ build . line ( "groups_created = true;" ) ;
746
+
747
+ build . unindent ( ) ;
748
+ build . line ( "}" ) ;
749
+
750
+ build . unindent ( ) ;
751
+ build . line ( "}" ) ;
752
+
753
+ build . line ( "" ) ;
754
+ }
755
+
756
+ build . line ( "void create_screens() {" ) ;
757
+ build . indent ( ) ;
758
+
759
+ if ( this . project . lvglGroups . groups . length > 0 ) {
760
+ build . line ( "ui_create_groups();" ) ;
737
761
build . line ( "" ) ;
738
762
}
739
763
You can’t perform that action at this time.
0 commit comments