From 83bcec4b0006f11fefac451924b8cc0b7e3cb2e5 Mon Sep 17 00:00:00 2001 From: gitknilch Date: Thu, 24 Mar 2011 18:39:11 +0100 Subject: [PATCH] fix config show thingy --- firmware/fnordlicht-firmware/static_programs.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/firmware/fnordlicht-firmware/static_programs.c b/firmware/fnordlicht-firmware/static_programs.c index 911e379..5dc7c2d 100644 --- a/firmware/fnordlicht-firmware/static_programs.c +++ b/firmware/fnordlicht-firmware/static_programs.c @@ -29,6 +29,7 @@ #include "remote.h" #include "../common/common.h" #include "storage.h" +#include "script.h" #if CONFIG_SCRIPT @@ -54,7 +55,7 @@ PT_THREAD(program_showcfg(struct process_t *process)) c.green = (remote_address() & 0x02u) ? DEBUG_COLORLEVEL : 0; c.blue = (remote_address() & 0x04u) ? DEBUG_COLORLEVEL : 0; - d.red = d.green = d.blue = DEBUG_COLORLEVEL; + d.red = d.green = d.blue = 0; global_pwm.target.rgb = c; @@ -65,15 +66,17 @@ PT_THREAD(program_showcfg(struct process_t *process)) while (sleep--) PT_YIELD(&process->pt); - global_pwm.target.rgb = d; + global_pwm.target.rgb = c; sleep = 5; while (sleep--) PT_YIELD(&process->pt); - global_pwm.target.rgb = c; + global_pwm.target.rgb = d; } + script_stop(); + /* now start default script */ if (storage_valid_config() && (startup_config.params.mode == STARTUP_PROGRAM)) { script_start(0, startup_config.params.program, (union program_params_t *)startup_config.params.program_parameters); @@ -81,6 +84,10 @@ PT_THREAD(program_showcfg(struct process_t *process)) script_start_default(); } + /* hack: script_start() stuff above will reinitialize PT structures, so we + can't call any PT stuff any more and quit directly */ + return 0; + PT_END(&process->pt); } -- 2.39.2