Read about our upcoming Code of Conduct on this issue

Commit 05d1efb7 authored by a1ex's avatar a1ex
Browse files

Synchronized BMP routines with GUI events; startup/shutdown tweaks.

--HG--
branch : 550d
parent 9788ee1a2612
......@@ -267,6 +267,8 @@ int _hold_your_horses = 1;
// only after this task finished, the others are started
void init_task_read_config()
{
show_logo();
display_clock();
config_parse_file( "B:/magic.cfg" );
debug_init_stuff();
_hold_your_horses = 0;
......@@ -277,11 +279,6 @@ void hold_your_horses(int showlogo)
while (_hold_your_horses)
{
msleep( 500 );
if (showlogo)
{
show_logo();
display_clock();
}
}
}
......@@ -367,6 +364,7 @@ my_init_task(void)
build_user
);*/
BMP_SEM(
// this is better in a separate task (not sure why, but causes instability if called right from here)
// let's try not to open files from here
task_create("config_init", 0x1e, 0x1000, init_task_read_config, 0 );
......@@ -403,6 +401,7 @@ my_init_task(void)
//~ );
msleep(500);
)
redraw();
//~ DebugMsg( DM_MAGIC, 3, "magic lantern init done" );
......
......@@ -936,9 +936,9 @@ void bfnt_puts_utf8(int* s, int x, int y, int fg, int bg)
}
}
static void bmp_init()
void bmp_sem_init()
{
bmp_sem = create_named_semaphore("bmp_sem", 1);
}
INIT_FUNC(__FILE__, bmp_init);
//~ INIT_FUNC(__FILE__, bmp_init);
......@@ -903,11 +903,12 @@ movie_start( void )
//~ TASK_CREATE( "movie_start", movie_start, 0, 0x1f, 0x1000 );
/*PROP_HANDLER(PROP_TERMINATE_SHUT_REQ)
PROP_HANDLER(PROP_TERMINATE_SHUT_REQ)
{
//bmp_printf(FONT_MED, 0, 0, "SHUT REQ %d ", buf[0]);
if (buf[0] == 0) { card_led_on(); msleep(50); }
return prop_cleanup(token, property);
}*/
}
/*
PROP_HANDLER(PROP_APERTURE)
......
......@@ -536,6 +536,7 @@ static int handle_buttons(struct event * event)
static void gui_main_task_550d()
{
bmp_sem_init();
struct event * event = NULL;
int index = 0;
void* funcs[GMT_NFUNCS];
......@@ -557,8 +558,10 @@ static void gui_main_task_550d()
if (handle_buttons(event) == 0)
continue;
void(*f)(struct event *) = funcs[index];
f(event);
BM_SEM(
void(*f)(struct event *) = funcs[index];
f(event);
)
}
}
......
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