This instance will be upgraded to Heptapod 0.31.0 (final) on 2022-05-24 at 14:00 UTC+2 (a few minutes of down time)

Commit 943775db authored by alex@thinkpad's avatar alex@thinkpad
Browse files

boot-hack: fade-out LED feedback when bypassing ML at startup

(by pressing or not pressing SET, depending on how it's configured)

Should also fix https://www.magiclantern.fm/forum/index.php?topic=21765.msg198829#msg198829

--HG--
branch : lua_fix
parent eeb12511d8ce
......@@ -453,6 +453,19 @@ static void dumper_bootflag()
}
#endif
static void led_fade(int arg1, void * on)
{
/* emulate a fade-out PWM using a HPTimer */
static int k = 16000;
if (k > 0)
{
if (on) _card_led_on(); else _card_led_off();
int next_delay = (on ? k : 16000 - k); /* cycle: 16000 us => 62.5 Hz */
SetHPTimerNextTick(arg1, next_delay, led_fade, led_fade, (void *) !on);
k -= MAX(16, k/32); /* adjust fading speed and shape here */
}
}
/* This runs ML initialization routines and starts user tasks.
* Unlike init_task, from here we can do file I/O and others.
*/
......@@ -485,6 +498,9 @@ static void my_big_init_task()
additional_version[7] = '\0';
#endif
/* some very basic feedback - fade out the SD led */
SetHPTimerAfterNow(1000, led_fade, led_fade, 0);
/* do not continue loading ML */
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment