diff options
| author | Glenn Ruben Bakke <glennbakke@gmail.com> | 2018-02-26 19:03:49 +0100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2018-07-18 17:12:25 +1000 |
| commit | 62931398d76063f25e0c51de60a4fb42a0f9aa03 (patch) | |
| tree | ab3750de79538ef55296ea0ddf37ea54795870e0 | |
| parent | 3cdecf90e685d08ae2239fc80591fd96aa55610a (diff) | |
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.
| -rw-r--r-- | ports/nrf/boards/microbit/modules/modmicrobit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ports/nrf/boards/microbit/modules/modmicrobit.c b/ports/nrf/boards/microbit/modules/modmicrobit.c index 3ab688c5b..8fa1fd8f2 100644 --- a/ports/nrf/boards/microbit/modules/modmicrobit.c +++ b/ports/nrf/boards/microbit/modules/modmicrobit.c @@ -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 |
