Skip to content

Commit 2bef4a8

Browse files
example: medie: watch: do not deinit current wf
Previously, pausing the clock application set all watch face to the deinit state. This was not ideal. This change prevents pausing the clock application from setting the current watch face to the deinit state. This will prevent re-entering the wf init function when the clock application is re-entered. Instead, the system will resume from the resume state. This commit will works if this issue (#182) is fixed. Signed-off-by: Troy Mitchell <troymitchell988@gmail.com>
1 parent 968fa16 commit 2bef4a8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

example/multimedia/lvgl/watch/src/gui_apps/clock/app_clock_main.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,9 +618,12 @@ static void on_pause(void)
618618

619619
rt_list_for_each(pos, (&p_app_clock_main->list))
620620
{
621-
app_clock_desc_t *clk_desc;
622-
clk_desc = rt_list_entry(pos, app_clock_desc_t, node);
623-
app_clock_change_state(clk_desc, STATE_DEINIT);
621+
if (i != last_active_clock) {
622+
app_clock_desc_t *clk_desc;
623+
clk_desc = rt_list_entry(pos, app_clock_desc_t, node);
624+
app_clock_change_state(clk_desc, STATE_DEINIT);
625+
}
626+
i++;
624627
}
625628
}
626629

0 commit comments

Comments
 (0)