diff options
| author | bernard.xiong <[email protected]> | 2011-04-26 09:54:23 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2011-04-26 09:54:23 +0000 |
| commit | 0220cb673a0bc80394417407c97ca025264403e2 (patch) | |
| tree | 417c5763fba8553c67c5caa4c99f92ef885bb4b4 | |
| parent | 89d13cbd3250f7de7dcf57efaac1985472ec1f3c (diff) | |
remove RT_USING_RTGUI and compiling error in Keil MDK.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1386 bbd45198-f89e-11dd-88c7-29a3b14d5316
| -rw-r--r-- | bsp/fm3/adc.c | 3 | ||||
| -rw-r--r-- | bsp/fm3/application.c | 2 | ||||
| -rw-r--r-- | bsp/fm3/font.h | 2 | ||||
| -rw-r--r-- | bsp/fm3/info.c | 5 | ||||
| -rw-r--r-- | bsp/fm3/key.c | 86 | ||||
| -rw-r--r-- | bsp/fm3/key.h | 2 | ||||
| -rw-r--r-- | bsp/fm3/lcd.c | 13 | ||||
| -rw-r--r-- | bsp/fm3/led.h | 2 | ||||
| -rw-r--r-- | bsp/fm3/project.uvproj | 300 |
9 files changed, 66 insertions, 349 deletions
diff --git a/bsp/fm3/adc.c b/bsp/fm3/adc.c index d5a3ece00c..1e36d0b600 100644 --- a/bsp/fm3/adc.c +++ b/bsp/fm3/adc.c @@ -80,7 +80,6 @@ rt_uint16_t adc_value; static void adc_thread_entry(void *parameter)
{
rt_device_t device;
- device = rt_device_find("adc");
#ifdef RT_USING_RTGUI
struct rtgui_event_command ecmd;
@@ -92,6 +91,8 @@ static void adc_thread_entry(void *parameter) struct lcd_msg msg;
#endif
+ device = rt_device_find("adc");
+
while(1)
{
rt_device_control(device, RT_DEVICE_CTRL_ADC_START, RT_NULL);
diff --git a/bsp/fm3/application.c b/bsp/fm3/application.c index 21a0a5e19d..758520b808 100644 --- a/bsp/fm3/application.c +++ b/bsp/fm3/application.c @@ -48,6 +48,7 @@ void rt_init_thread_entry(void *parameter) /* startup rtgui */
rtgui_startup();
#else
+ {
char buf[20] = {'\0'};
struct lcd_msg msg;
rt_device_t device;
@@ -113,6 +114,7 @@ void rt_init_thread_entry(void *parameter) }
}
}
+ }
#endif
}
diff --git a/bsp/fm3/font.h b/bsp/fm3/font.h index 2f02349836..0819a2c22d 100644 --- a/bsp/fm3/font.h +++ b/bsp/fm3/font.h @@ -958,4 +958,4 @@ const unsigned char FONTTYPE8_8[][8] = { };
-#endif /* __FONT_H */
\ No newline at end of file +#endif /* __FONT_H */
diff --git a/bsp/fm3/info.c b/bsp/fm3/info.c index b0b9e56adc..104d02a70f 100644 --- a/bsp/fm3/info.c +++ b/bsp/fm3/info.c @@ -1,3 +1,6 @@ +#include <rtthread.h>
+
+#ifdef RT_USING_RTGUI
#include <rtgui/rtgui.h>
#include <rtgui/rtgui_server.h>
#include <rtgui/rtgui_system.h>
@@ -7,7 +10,6 @@ #include "adc.h"
#include "cpuusage.h"
-#include <rtthread.h>
extern rt_uint16_t adc_value;
static rt_uint8_t index = 0 ;
@@ -209,3 +211,4 @@ void rtgui_startup() info_init();
}
+#endif
diff --git a/bsp/fm3/key.c b/bsp/fm3/key.c index 290e156383..a03b48366a 100644 --- a/bsp/fm3/key.c +++ b/bsp/fm3/key.c @@ -9,7 +9,7 @@ *
* Change Logs:
* Date Author Notes
- * 2011-03-03 lgnq
+ * 2011-03-03 lgnq
*/
#include <rtthread.h>
@@ -109,51 +109,49 @@ static void key_thread_entry(void *parameter) rt_thread_delay(next_delay);
}
#else
-extern struct rt_messagequeue mq;
-rt_time_t next_delay;
-rt_uint8_t i;
-struct lcd_msg msg;
-msg.type = KEY_MSG;
-
-key_io_init();
-
-while (1)
-{
- msg.key = NO_KEY;
-
- next_delay = RT_TICK_PER_SECOND/10;
-
- if (KEY_ENTER_GETVALUE() == 0 )
- {
- msg.key = KEY_ENTER;
- }
-
- if (KEY_DOWN_GETVALUE() == 0)
- {
- msg.key = KEY_DOWN;
- }
-
- if (KEY_UP_GETVALUE() == 0)
+ extern struct rt_messagequeue mq;
+ rt_time_t next_delay;
+ struct lcd_msg msg;
+ msg.type = KEY_MSG;
+
+ key_io_init();
+
+ while (1)
{
- msg.key = KEY_UP;
+ msg.key = NO_KEY;
+
+ next_delay = RT_TICK_PER_SECOND/10;
+
+ if (KEY_ENTER_GETVALUE() == 0 )
+ {
+ msg.key = KEY_ENTER;
+ }
+
+ if (KEY_DOWN_GETVALUE() == 0)
+ {
+ msg.key = KEY_DOWN;
+ }
+
+ if (KEY_UP_GETVALUE() == 0)
+ {
+ msg.key = KEY_UP;
+ }
+
+ if (KEY_RIGHT_GETVALUE() == 0)
+ {
+ msg.key = KEY_RIGHT;
+ }
+
+ if (KEY_LEFT_GETVALUE() == 0)
+ {
+ msg.key = KEY_LEFT;
+ }
+
+ rt_mq_send(&mq, &msg, sizeof(msg));
+
+ /* wait next key press */
+ rt_thread_delay(next_delay);
}
-
- if (KEY_RIGHT_GETVALUE() == 0)
- {
- msg.key = KEY_RIGHT;
- }
-
- if (KEY_LEFT_GETVALUE() == 0)
- {
- msg.key = KEY_LEFT;
- }
-
- rt_mq_send(&mq, &msg, sizeof(msg));
-
- /* wait next key press */
- rt_thread_delay(next_delay);
-}
-
#endif
}
diff --git a/bsp/fm3/key.h b/bsp/fm3/key.h index ab26035e69..3b47c7b1bb 100644 --- a/bsp/fm3/key.h +++ b/bsp/fm3/key.h @@ -44,4 +44,4 @@ void rt_hw_key_init(void);
-#endif
\ No newline at end of file +#endif
diff --git a/bsp/fm3/lcd.c b/bsp/fm3/lcd.c index 9c08d97074..8d661a74a6 100644 --- a/bsp/fm3/lcd.c +++ b/bsp/fm3/lcd.c @@ -333,9 +333,11 @@ void LCD_FillAll(unsigned char* buffer) *******************************************************************************/
void LCD_ClearSCR(void)
{
- for(unsigned char i=0; i<GUI_LCM_PAGE; i++)
+ unsigned char i, j;
+
+ for(i=0; i<GUI_LCM_PAGE; i++)
{
- for(unsigned char j = 0; j < GUI_LCM_XMAX; j++)
+ for(j = 0; j < GUI_LCM_XMAX; j++)
gui_disp_buf[i][j] = 0;
}
LCD_FillAll((unsigned char*)gui_disp_buf);
@@ -377,6 +379,7 @@ void LCD_UpdatePoint(unsigned int x, unsigned int y) unsigned char LCD_PutChar(unsigned long x, unsigned long y, unsigned char ch)
{
unsigned char data;
+ unsigned char i, j;
if( x >=(GUI_LCM_XMAX-8) ) return(0);
if( y >=(GUI_LCM_YMAX-8) ) return(0);
@@ -392,11 +395,11 @@ unsigned char LCD_PutChar(unsigned long x, unsigned long y, unsigned char ch) else
return(0);
- for(unsigned char i = 0; i < 8; i++)
+ for(i = 0; i < 8; i++)
{
data = FONTTYPE8_8[ch][i];
- for(unsigned char j = 0; j < 8; j++)
+ for(j = 0; j < 8; j++)
{
if( (data&BIT_MASK[j]) == 0)
gui_disp_buf[y / 8][x] &= (~(0x01 << ( y % 8)));
@@ -448,7 +451,7 @@ static rt_err_t rt_lcd_control (rt_device_t dev, rt_uint8_t cmd, void *args) LCD_WriteCmd(Display_Off);
break;
case RT_DEVICE_CTRL_LCD_PUT_STRING:
- LCD_PutString(x, y, (rt_uint8_t*)args);
+ LCD_PutString(x, y, (char*)args);
break;
case RT_DEVICE_CTRL_LCD_CLEAR_SCR:
LCD_ClearSCR();
diff --git a/bsp/fm3/led.h b/bsp/fm3/led.h index 5c115f244b..5610a09f71 100644 --- a/bsp/fm3/led.h +++ b/bsp/fm3/led.h @@ -39,4 +39,4 @@ void rt_hw_led_off(rt_uint8_t num); void rt_hw_led_toggle(rt_uint8_t num);
void pwm_update(rt_uint16_t value);
-#endif
\ No newline at end of file +#endif
diff --git a/bsp/fm3/project.uvproj b/bsp/fm3/project.uvproj index 15aa6b8f6e..332a3cd91c 100644 --- a/bsp/fm3/project.uvproj +++ b/bsp/fm3/project.uvproj @@ -412,11 +412,6 @@ <FilePath>.\cpuusage.c</FilePath> </File> <File> - <FileName>info.c</FileName> - <FileType>1</FileType> - <FilePath>.\info.c</FilePath> - </File> - <File> <FileName>key.c</FileName> <FileType>1</FileType> <FilePath>.\key.c</FilePath> @@ -431,6 +426,11 @@ <FileType>1</FileType> <FilePath>.\led.c</FilePath> </File> + <File> + <FileName>info.c</FileName> + <FileType>1</FileType> + <FilePath>.\info.c</FilePath> + </File> </Files> </Group> <Group> @@ -538,296 +538,6 @@ </File> </Files> </Group> - <Group> - <GroupName>Rtgui</GroupName> - <Files> - <File> - <FileName>asc12font.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\asc12font.c</FilePath> - </File> - <File> - <FileName>asc16font.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\asc16font.c</FilePath> - </File> - <File> - <FileName>blit.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\blit.c</FilePath> - </File> - <File> - <FileName>color.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\color.c</FilePath> - </File> - <File> - <FileName>dc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\dc.c</FilePath> - </File> - <File> - <FileName>dc_buffer.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\dc_buffer.c</FilePath> - </File> - <File> - <FileName>dc_client.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\dc_client.c</FilePath> - </File> - <File> - <FileName>dc_hw.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\dc_hw.c</FilePath> - </File> - <File> - <FileName>filerw.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\filerw.c</FilePath> - </File> - <File> - <FileName>font.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\font.c</FilePath> - </File> - <File> - <FileName>font_bmp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\font_bmp.c</FilePath> - </File> - <File> - <FileName>font_freetype.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\font_freetype.c</FilePath> - </File> - <File> - <FileName>font_hz_bmp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\font_hz_bmp.c</FilePath> - </File> - <File> - <FileName>font_hz_file.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\font_hz_file.c</FilePath> - </File> - <File> - <FileName>image.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\image.c</FilePath> - </File> - <File> - <FileName>image_bmp.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\image_bmp.c</FilePath> - </File> - <File> - <FileName>image_container.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\image_container.c</FilePath> - </File> - <File> - <FileName>image_hdc.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\image_hdc.c</FilePath> - </File> - <File> - <FileName>image_jpg.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\image_jpg.c</FilePath> - </File> - <File> - <FileName>image_png.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\image_png.c</FilePath> - </File> - <File> - <FileName>image_xpm.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\image_xpm.c</FilePath> - </File> - <File> - <FileName>region.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\region.c</FilePath> - </File> - <File> - <FileName>rtgui_object.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\rtgui_object.c</FilePath> - </File> - <File> - <FileName>rtgui_system.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\rtgui_system.c</FilePath> - </File> - <File> - <FileName>rtgui_theme.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\rtgui_theme.c</FilePath> - </File> - <File> - <FileName>rtgui_xml.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\common\rtgui_xml.c</FilePath> - </File> - <File> - <FileName>driver.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\server\driver.c</FilePath> - </File> - <File> - <FileName>mouse.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\server\mouse.c</FilePath> - </File> - <File> - <FileName>panel.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\server\panel.c</FilePath> - </File> - <File> - <FileName>server.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\server\server.c</FilePath> - </File> - <File> - <FileName>topwin.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\server\topwin.c</FilePath> - </File> - <File> - <FileName>about_view.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\about_view.c</FilePath> - </File> - <File> - <FileName>box.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\box.c</FilePath> - </File> - <File> - <FileName>button.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\button.c</FilePath> - </File> - <File> - <FileName>checkbox.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\checkbox.c</FilePath> - </File> - <File> - <FileName>combobox.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\combobox.c</FilePath> - </File> - <File> - <FileName>container.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\container.c</FilePath> - </File> - <File> - <FileName>filelist_view.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\filelist_view.c</FilePath> - </File> - <File> - <FileName>iconbox.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\iconbox.c</FilePath> - </File> - <File> - <FileName>label.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\label.c</FilePath> - </File> - <File> - <FileName>list_view.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\list_view.c</FilePath> - </File> - <File> - <FileName>listbox.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\listbox.c</FilePath> - </File> - <File> - <FileName>listctrl.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\listctrl.c</FilePath> - </File> - <File> - <FileName>menu.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\menu.c</FilePath> - </File> - <File> - <FileName>notebook.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\notebook.c</FilePath> - </File> - <File> - <FileName>progressbar.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\progressbar.c</FilePath> - </File> - <File> - <FileName>radiobox.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\radiobox.c</FilePath> - </File> - <File> - <FileName>scrollbar.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\scrollbar.c</FilePath> - </File> - <File> - <FileName>slider.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\slider.c</FilePath> - </File> - <File> - <FileName>staticline.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\staticline.c</FilePath> - </File> - <File> - <FileName>textbox.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\textbox.c</FilePath> - </File> - <File> - <FileName>title.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\title.c</FilePath> - </File> - <File> - <FileName>toplevel.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\toplevel.c</FilePath> - </File> - <File> - <FileName>view.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\view.c</FilePath> - </File> - <File> - <FileName>widget.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\widget.c</FilePath> - </File> - <File> - <FileName>window.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\window.c</FilePath> - </File> - <File> - <FileName>workbench.c</FileName> - <FileType>1</FileType> - <FilePath>..\..\components\rtgui\widgets\workbench.c</FilePath> - </File> - </Files> - </Group> </Groups> </Target> </Targets> |
