nrf/boards/microbit/modules: Initialize variable in microbit_sleep.

When compiling for microbit with LTO=0, a compiler error occurs due to
'ms' variable in the microbit_sleep function has not been initialized.

This patch initialize the variable to 0.
This commit is contained in:
Glenn Ruben Bakke 2018-02-26 19:03:49 +01:00 committed by Damien George
parent 3cdecf90e6
commit 62931398d7

View File

@ -43,7 +43,7 @@ STATIC mp_obj_t microbit_reset_(void) {
MP_DEFINE_CONST_FUN_OBJ_0(microbit_reset_obj, microbit_reset_);
STATIC mp_obj_t microbit_sleep(mp_obj_t ms_in) {
mp_int_t ms;
mp_int_t ms = 0;
if (mp_obj_is_integer(ms_in)) {
ms = mp_obj_get_int(ms_in);
#if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT