Skip to content

Commit 65eeeb7

Browse files
committed
1 parent d7f4a5a commit 65eeeb7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/project-editor/lvgl/build.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,12 +1929,14 @@ export class LVGLBuild extends Build {
19291929
build.blockEnd("};");
19301930

19311931
build.blockStart("void tick_screen(int screen_index) {");
1932+
build.blockStart(`if (screen_index >= 0 && screen_index < ${this.userPages.length}) {`)
19321933
build.line("tick_screen_funcs[screen_index]();");
1934+
build.blockEnd(`}`)
19331935
build.blockEnd("}");
19341936

19351937
build.blockStart("void tick_screen_by_id(enum ScreensEnum screenId) {");
1936-
build.line("tick_screen_funcs[screenId - 1]();");
1937-
build.blockEnd("}");
1938+
build.line("tick_screen(screenId - 1);");
1939+
build.blockEnd(`}`)
19381940

19391941
build.line("");
19401942

0 commit comments

Comments
 (0)