Skip to content

Commit a5dd649

Browse files
committed
codal_port/microbit_display: Stop animations when calling clear().
Following the semantics of micro:bit v1. Fixes issue #150. Signed-off-by: Damien George <damien@micropython.org>
1 parent bbc70b6 commit a5dd649

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/codal_port/drv_display.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ void microbit_display_update(void) {
142142
}
143143

144144
void microbit_display_clear(void) {
145+
// Reset repeat state, cancel animation and clear screen.
146+
// The actual screen clearing will be done by microbit_display_update.
145147
wakeup_event = false;
146148
async_mode = ASYNC_MODE_CLEAR;
147149
async_tick = async_delay - MILLISECONDS_PER_MACRO_TICK;

src/codal_port/microbit_display.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(microbit_display_read_light_level_obj, microbit_displa
163163

164164
mp_obj_t microbit_display_clear_func(mp_obj_t self) {
165165
(void)self;
166-
microbit_hal_display_clear();
166+
microbit_display_clear();
167167
return mp_const_none;
168168
}
169169
MP_DEFINE_CONST_FUN_OBJ_1(microbit_display_clear_obj, microbit_display_clear_func);

0 commit comments

Comments
 (0)