summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author[email protected] <[email protected]>2011-11-16 03:12:04 +0000
committer[email protected] <[email protected]>2011-11-16 03:12:04 +0000
commit22a9d6f309f1714c36ca68ee584589d559604e57 (patch)
treee183d51a3ba38ec4e1a2162c2c00b854c7b7dbaa
parentf8bbcf9aef8d82fa802fbb0b06e6453cb435c768 (diff)
revert commit 1791
That commit broke bsp/stm3210x. The cause is that we calls rtgui_system_init in rtgui_startup. But the calibration starts before rtgui_startup and rtgui_system_init. This lead to crash. One way to deal with it is move rtgui_system_init out of rtgui_startup and call it manually. But it will affect other bsps. So just revert the "bad" commit. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1793 bbd45198-f89e-11dd-88c7-29a3b14d5316
-rw-r--r--bsp/stm32f10x/application.c13
-rw-r--r--bsp/stm32f10x/calibration.c15
2 files changed, 2 insertions, 26 deletions
diff --git a/bsp/stm32f10x/application.c b/bsp/stm32f10x/application.c
index 5da04d8830..2518cb26f9 100644
--- a/bsp/stm32f10x/application.c
+++ b/bsp/stm32f10x/application.c
@@ -45,8 +45,6 @@
#include "led.h"
-extern rt_sem_t touch_screen_calibrated;
-
ALIGN(RT_ALIGN_SIZE)
static rt_uint8_t led_stack[ 512 ];
static struct rt_thread led_thread;
@@ -153,17 +151,6 @@ void rt_init_thread_entry(void* parameter)
/* set lcd device as rtgui graphic driver */
rtgui_graphic_set_device(lcd);
- /* without calibration, the position we got from the touch screen is
- * useless raw value and the GUI is unusable. */
- calibration_init();
- if (touch_screen_calibrated != RT_NULL)
- {
- rt_sem_take(touch_screen_calibrated, RT_WAITING_FOREVER);
- /* NOTE: no other thread use this semaphore, so we can delete it.
- * If this is not your case, comment this line. */
- rt_sem_delete(touch_screen_calibrated);
- }
-
/* startup rtgui */
rtgui_startup();
}
diff --git a/bsp/stm32f10x/calibration.c b/bsp/stm32f10x/calibration.c
index 544866f3f0..92bd10fe44 100644
--- a/bsp/stm32f10x/calibration.c
+++ b/bsp/stm32f10x/calibration.c
@@ -30,9 +30,6 @@ struct calibration_session
};
static struct calibration_session* calibration_ptr = RT_NULL;
-/* a semaphore that will become avaible when calibration finished. */
-rt_sem_t touch_screen_calibrated = RT_NULL;
-
static void calibration_data_post(rt_uint16_t x, rt_uint16_t y)
{
if (calibration_ptr != RT_NULL)
@@ -257,8 +254,6 @@ void calibration_entry(void* parameter)
/* release memory */
rt_free(calibration_ptr);
calibration_ptr = RT_NULL;
- /* tell other thread that we finished calibration */
- rt_sem_release(touch_screen_calibrated);
}
void calibration_init()
@@ -266,12 +261,7 @@ void calibration_init()
rt_device_t device;
device = rt_device_find("touch");
- if (device == RT_NULL)
- return; /* no such device */
-
- touch_screen_calibrated = rt_sem_create("tc_cali", 0, RT_IPC_FLAG_FIFO);
- if (touch_screen_calibrated == RT_NULL)
- return;
+ if (device == RT_NULL) return; /* no this device */
calibration_ptr = (struct calibration_session*)rt_malloc(sizeof(struct calibration_session));
rt_memset(calibration_ptr, 0, sizeof(struct calibration_data));
@@ -281,8 +271,7 @@ void calibration_init()
calibration_ptr->tid = rt_thread_create("cali", calibration_entry, RT_NULL,
2048, 20, 5);
- if (calibration_ptr->tid != RT_NULL)
- rt_thread_startup(calibration_ptr->tid);
+ if (calibration_ptr->tid != RT_NULL) rt_thread_startup(calibration_ptr->tid);
}
#ifdef RT_USING_FINSH