mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-22 05:15:23 +08:00
fixed calibration issue in mini2440 BSP
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2167 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
5cf2b9c3a2
commit
0b30e68b10
@ -29,6 +29,7 @@ struct calibration_session
|
|||||||
|
|
||||||
rt_device_t device;
|
rt_device_t device;
|
||||||
rt_thread_t tid;
|
rt_thread_t tid;
|
||||||
|
struct rtgui_win *wid;
|
||||||
};
|
};
|
||||||
static struct calibration_session *calibration_ptr = RT_NULL;
|
static struct calibration_session *calibration_ptr = RT_NULL;
|
||||||
|
|
||||||
@ -66,6 +67,7 @@ static void calibration_data_post(rt_uint16_t x, rt_uint16_t y)
|
|||||||
struct rtgui_event_command ecmd;
|
struct rtgui_event_command ecmd;
|
||||||
RTGUI_EVENT_COMMAND_INIT(&ecmd);
|
RTGUI_EVENT_COMMAND_INIT(&ecmd);
|
||||||
ecmd.command_id = TOUCH_WIN_CLOSE;
|
ecmd.command_id = TOUCH_WIN_CLOSE;
|
||||||
|
ecmd.wid = calibration_ptr->wid;
|
||||||
|
|
||||||
/* calculate calibrated data */
|
/* calculate calibrated data */
|
||||||
if (calibration_ptr->data.max_x > calibration_ptr->data.min_x)
|
if (calibration_ptr->data.max_x > calibration_ptr->data.min_x)
|
||||||
@ -121,6 +123,7 @@ static void calibration_data_post(rt_uint16_t x, rt_uint16_t y)
|
|||||||
struct rtgui_event_command ecmd;
|
struct rtgui_event_command ecmd;
|
||||||
RTGUI_EVENT_COMMAND_INIT(&ecmd);
|
RTGUI_EVENT_COMMAND_INIT(&ecmd);
|
||||||
ecmd.command_id = TOUCH_WIN_UPDATE;
|
ecmd.command_id = TOUCH_WIN_UPDATE;
|
||||||
|
ecmd.wid = calibration_ptr->wid;
|
||||||
|
|
||||||
rtgui_application_send(calibration_ptr->tid, &ecmd.parent, sizeof(struct rtgui_event_command));
|
rtgui_application_send(calibration_ptr->tid, &ecmd.parent, sizeof(struct rtgui_event_command));
|
||||||
}
|
}
|
||||||
@ -246,14 +249,12 @@ void calibration_entry(void *parameter)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
calibration_ptr->wid = win;
|
||||||
|
|
||||||
rtgui_object_set_event_handler(RTGUI_OBJECT(win), calibration_event_handler);
|
rtgui_object_set_event_handler(RTGUI_OBJECT(win), calibration_event_handler);
|
||||||
|
|
||||||
if (win != RT_NULL)
|
rtgui_win_show(win, RT_FALSE);
|
||||||
{
|
rtgui_application_run(app);
|
||||||
rtgui_win_show(win, RT_FALSE);
|
|
||||||
// rtgui_widget_update(RTGUI_WIDGET(win));
|
|
||||||
rtgui_application_run(app);
|
|
||||||
}
|
|
||||||
|
|
||||||
rtgui_application_destroy(app);
|
rtgui_application_destroy(app);
|
||||||
|
|
||||||
|
@ -147,6 +147,7 @@ static void rtgui_event_dump(rt_thread_t tid, rtgui_event_t* event)
|
|||||||
case RTGUI_EVENT_WIN_DEACTIVATE:
|
case RTGUI_EVENT_WIN_DEACTIVATE:
|
||||||
case RTGUI_EVENT_WIN_SHOW:
|
case RTGUI_EVENT_WIN_SHOW:
|
||||||
case RTGUI_EVENT_WIN_MODAL_ENTER:
|
case RTGUI_EVENT_WIN_MODAL_ENTER:
|
||||||
|
case RTGUI_EVENT_WIN_HIDE:
|
||||||
{
|
{
|
||||||
struct rtgui_event_win *win = (struct rtgui_event_win *)event;
|
struct rtgui_event_win *win = (struct rtgui_event_win *)event;
|
||||||
|
|
||||||
@ -212,6 +213,9 @@ static void rtgui_event_dump(rt_thread_t tid, rtgui_event_t* event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
rt_kprintf("\n");
|
rt_kprintf("\n");
|
||||||
@ -603,13 +607,13 @@ rt_bool_t rtgui_application_event_handler(struct rtgui_object* object, rtgui_eve
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RTGUI_EVENT_COMMAND:
|
case RTGUI_EVENT_COMMAND:
|
||||||
{
|
{
|
||||||
struct rtgui_event_command *ecmd = (struct rtgui_event_command*)event;
|
struct rtgui_event_command *ecmd = (struct rtgui_event_command *)event;
|
||||||
|
|
||||||
if (ecmd->wid != RT_NULL)
|
if (ecmd->wid != RT_NULL)
|
||||||
return _rtgui_application_dest_handle(app, event);
|
return _rtgui_application_dest_handle(app, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return rtgui_object_event_handler(object, event);
|
return rtgui_object_event_handler(object, event);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user