X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/fnordlicht-mini/blobdiff_plain/ec1bef8e19888e982ffc53129f74d58868e8d203..71bf23cb3cb29253587b4d91bf947a81b008beb2:/firmware/fnordlicht-firmware/fnordlicht.c?ds=inline diff --git a/firmware/fnordlicht-firmware/fnordlicht.c b/firmware/fnordlicht-firmware/fnordlicht.c index b5e2ffe..f98c490 100644 --- a/firmware/fnordlicht-firmware/fnordlicht.c +++ b/firmware/fnordlicht-firmware/fnordlicht.c @@ -42,21 +42,17 @@ static void startup(void) { /* if configuration is valid */ if (storage_valid_config()) { + /* set global address to stored value */ + global_remote.address = startup_config.startup_addr; + } - /* read default mode from storage (do nothing if mode is invalid) */ - if (startup_config.params.mode == STARTUP_PROGRAM) { - /* start program */ - script_start(0, startup_config.params.program, (union program_params_t *)startup_config.params.program_parameters); - } - } else { - /* start default program */ - script_start_default(); - -#if !CONFIG_SCRIPT - /* or set some default color */ - global_pwm.target.red = 50; +#if CONFIG_SCRIPT + /* start default program: showcfg FIXME cleanup magic values */ + script_start(0u, 3u, (union program_params_t *)startup_config.params.program_parameters); +#else + /* or set some default color */ + global_pwm.target.red = 50u; #endif - } } /* NEVER CALL DIRECTLY! */