Read about our upcoming Code of Conduct on this issue

Commit 1e255722 authored by a1ex's avatar a1ex
Browse files

Ported 60D fake_simple_button

--HG--
branch : 550d
parent e65d2ce08d04
......@@ -188,6 +188,7 @@ void toggle_mirror_display()
//~ zebra_resume();
}
/*
void fake_simple_button(int bgmt_code)
{
struct event e = {
......@@ -197,7 +198,7 @@ void fake_simple_button(int bgmt_code)
.arg = 0,
};
GUI_CONTROL(&e);
}
}*/
#if CONFIG_DEBUGMSG
......
......@@ -55,6 +55,10 @@ int get_set_pressed() { return set_pressed; }
struct semaphore * gui_sem;
int handle_buttons_active = 0;
struct event fake_event;
struct semaphore * fake_sem;
struct gui_main_struct {
void * obj; // off_0x00;
uint32_t counter; // off_0x04;
......@@ -535,6 +539,18 @@ static int handle_buttons(struct event * event)
return 1;
}
// if called from handle_buttons, only last fake button will be executed
// if called from some other task, the function waits until the previous fake button was handled
void fake_simple_button(int bgmt_code)
{
if (!handle_buttons_active) take_semaphore(fake_sem, 0);
fake_event.type = 0,
fake_event.param = bgmt_code,
fake_event.obj = 0,
fake_event.arg = 0,
msg_queue_post(gui_main_struct.msg_queue_550d, &fake_event, 0, 0);
}
static void gui_main_task_550d()
{
bmp_sem_init();
......
......@@ -212,3 +212,5 @@ NSTUB( 0xFF0364A0, LVCAF_LensDriveStart )
NSTUB(0xFF2FECB0, ChangeHDMIOutputSizeToVGA)
NSTUB(0xFF2FEA48, ChangeHDMIOutputSizeToFULLHD)
NSTUB(0xFF1D2D5C, msg_queue_post)
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