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.
pull/3137/merge
Glenn Ruben Bakke 2018-02-26 19:03:49 +01:00 zatwierdzone przez Damien George
rodzic 3cdecf90e6
commit 62931398d7
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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