From 0220cb673a0bc80394417407c97ca025264403e2 Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Tue, 26 Apr 2011 09:54:23 +0000 Subject: [PATCH] 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 --- bsp/fm3/adc.c | 3 +- bsp/fm3/application.c | 2 + bsp/fm3/font.h | 2 +- bsp/fm3/info.c | 5 +- bsp/fm3/key.c | 86 ++++++------ bsp/fm3/key.h | 2 +- bsp/fm3/lcd.c | 13 +- bsp/fm3/led.h | 2 +- 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 + +#ifdef RT_USING_RTGUI #include #include #include @@ -7,7 +10,6 @@ #include "adc.h" #include "cpuusage.h" -#include 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 @@ -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_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 @@ -411,11 +411,6 @@ 1 .\cpuusage.c - - info.c - 1 - .\info.c - key.c 1 @@ -431,6 +426,11 @@ 1 .\led.c + + info.c + 1 + .\info.c + @@ -538,296 +538,6 @@ - - Rtgui - - - asc12font.c - 1 - ..\..\components\rtgui\common\asc12font.c - - - asc16font.c - 1 - ..\..\components\rtgui\common\asc16font.c - - - blit.c - 1 - ..\..\components\rtgui\common\blit.c - - - color.c - 1 - ..\..\components\rtgui\common\color.c - - - dc.c - 1 - ..\..\components\rtgui\common\dc.c - - - dc_buffer.c - 1 - ..\..\components\rtgui\common\dc_buffer.c - - - dc_client.c - 1 - ..\..\components\rtgui\common\dc_client.c - - - dc_hw.c - 1 - ..\..\components\rtgui\common\dc_hw.c - - - filerw.c - 1 - ..\..\components\rtgui\common\filerw.c - - - font.c - 1 - ..\..\components\rtgui\common\font.c - - - font_bmp.c - 1 - ..\..\components\rtgui\common\font_bmp.c - - - font_freetype.c - 1 - ..\..\components\rtgui\common\font_freetype.c - - - font_hz_bmp.c - 1 - ..\..\components\rtgui\common\font_hz_bmp.c - - - font_hz_file.c - 1 - ..\..\components\rtgui\common\font_hz_file.c - - - image.c - 1 - ..\..\components\rtgui\common\image.c - - - image_bmp.c - 1 - ..\..\components\rtgui\common\image_bmp.c - - - image_container.c - 1 - ..\..\components\rtgui\common\image_container.c - - - image_hdc.c - 1 - ..\..\components\rtgui\common\image_hdc.c - - - image_jpg.c - 1 - ..\..\components\rtgui\common\image_jpg.c - - - image_png.c - 1 - ..\..\components\rtgui\common\image_png.c - - - image_xpm.c - 1 - ..\..\components\rtgui\common\image_xpm.c - - - region.c - 1 - ..\..\components\rtgui\common\region.c - - - rtgui_object.c - 1 - ..\..\components\rtgui\common\rtgui_object.c - - - rtgui_system.c - 1 - ..\..\components\rtgui\common\rtgui_system.c - - - rtgui_theme.c - 1 - ..\..\components\rtgui\common\rtgui_theme.c - - - rtgui_xml.c - 1 - ..\..\components\rtgui\common\rtgui_xml.c - - - driver.c - 1 - ..\..\components\rtgui\server\driver.c - - - mouse.c - 1 - ..\..\components\rtgui\server\mouse.c - - - panel.c - 1 - ..\..\components\rtgui\server\panel.c - - - server.c - 1 - ..\..\components\rtgui\server\server.c - - - topwin.c - 1 - ..\..\components\rtgui\server\topwin.c - - - about_view.c - 1 - ..\..\components\rtgui\widgets\about_view.c - - - box.c - 1 - ..\..\components\rtgui\widgets\box.c - - - button.c - 1 - ..\..\components\rtgui\widgets\button.c - - - checkbox.c - 1 - ..\..\components\rtgui\widgets\checkbox.c - - - combobox.c - 1 - ..\..\components\rtgui\widgets\combobox.c - - - container.c - 1 - ..\..\components\rtgui\widgets\container.c - - - filelist_view.c - 1 - ..\..\components\rtgui\widgets\filelist_view.c - - - iconbox.c - 1 - ..\..\components\rtgui\widgets\iconbox.c - - - label.c - 1 - ..\..\components\rtgui\widgets\label.c - - - list_view.c - 1 - ..\..\components\rtgui\widgets\list_view.c - - - listbox.c - 1 - ..\..\components\rtgui\widgets\listbox.c - - - listctrl.c - 1 - ..\..\components\rtgui\widgets\listctrl.c - - - menu.c - 1 - ..\..\components\rtgui\widgets\menu.c - - - notebook.c - 1 - ..\..\components\rtgui\widgets\notebook.c - - - progressbar.c - 1 - ..\..\components\rtgui\widgets\progressbar.c - - - radiobox.c - 1 - ..\..\components\rtgui\widgets\radiobox.c - - - scrollbar.c - 1 - ..\..\components\rtgui\widgets\scrollbar.c - - - slider.c - 1 - ..\..\components\rtgui\widgets\slider.c - - - staticline.c - 1 - ..\..\components\rtgui\widgets\staticline.c - - - textbox.c - 1 - ..\..\components\rtgui\widgets\textbox.c - - - title.c - 1 - ..\..\components\rtgui\widgets\title.c - - - toplevel.c - 1 - ..\..\components\rtgui\widgets\toplevel.c - - - view.c - 1 - ..\..\components\rtgui\widgets\view.c - - - widget.c - 1 - ..\..\components\rtgui\widgets\widget.c - - - window.c - 1 - ..\..\components\rtgui\widgets\window.c - - - workbench.c - 1 - ..\..\components\rtgui\widgets\workbench.c - - - -- GitLab