Browse Source

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
bernard.xiong 14 years ago
parent
commit
0220cb673a
9 changed files with 66 additions and 349 deletions
  1. 2 1
      bsp/fm3/adc.c
  2. 2 0
      bsp/fm3/application.c
  3. 1 1
      bsp/fm3/font.h
  4. 4 1
      bsp/fm3/info.c
  5. 42 44
      bsp/fm3/key.c
  6. 1 1
      bsp/fm3/key.h
  7. 8 5
      bsp/fm3/lcd.c
  8. 1 1
      bsp/fm3/led.h
  9. 5 295
      bsp/fm3/project.uvproj

+ 2 - 1
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);    

+ 2 - 0
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
 }
 

+ 1 - 1
bsp/fm3/font.h

@@ -958,4 +958,4 @@ const unsigned char  FONTTYPE8_8[][8] = {
 
 };
 
-#endif /* __FONT_H */
+#endif /* __FONT_H */

+ 4 - 1
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

+ 42 - 44
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
 }
 

+ 1 - 1
bsp/fm3/key.h

@@ -44,4 +44,4 @@
 
 void rt_hw_key_init(void);
 
-#endif
+#endif

+ 8 - 5
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();

+ 1 - 1
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
+#endif

+ 5 - 295
bsp/fm3/project.uvproj

@@ -411,11 +411,6 @@
               <FileType>1</FileType>
               <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>
@@ -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>