Browse Source

update stm3210 branch according to stm32f107.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@168 bbd45198-f89e-11dd-88c7-29a3b14d5316
bernard.xiong 15 years ago
parent
commit
b4f84d0e72
2 changed files with 27 additions and 2 deletions
  1. 13 0
      bsp/stm3210/project_107/application.c
  2. 14 2
      bsp/stm3210/startup.c

+ 13 - 0
bsp/stm3210/project_107/application.c

@@ -42,6 +42,8 @@ void rt_init_thread_entry(void* parameter)
 	{
 	{
 		/* init the device filesystem */
 		/* init the device filesystem */
 		dfs_init();
 		dfs_init();
+
+#ifdef RT_USING_DFS_EFSL
 		/* init the efsl filesystam*/
 		/* init the efsl filesystam*/
 		efsl_init();
 		efsl_init();
 
 
@@ -52,7 +54,18 @@ void rt_init_thread_entry(void* parameter)
 		}
 		}
 		else
 		else
 			rt_kprintf("File System initialzation failed!\n");
 			rt_kprintf("File System initialzation failed!\n");
+#elif defined(RT_USING_DFS_ELMFAT)
+		/* init the elm chan FatFs filesystam*/
+		elm_init();
 
 
+		/* mount sd card fat partition 1 as root directory */
+		if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
+		{
+			rt_kprintf("File System initialized!\n");
+		}
+		else
+			rt_kprintf("File System initialzation failed!\n");
+#endif
 	}
 	}
 #endif
 #endif
 
 

+ 14 - 2
bsp/stm3210/startup.c

@@ -26,7 +26,11 @@
 /*@{*/
 /*@{*/
 
 
 #ifdef RT_USING_LWIP
 #ifdef RT_USING_LWIP
-#include "enc28j60.h"
+#ifdef STM32F10X_CL
+	extern void rt_hw_stm32_eth_init(void);
+#else
+	#include "enc28j60.h"
+#endif
 #include <netif/ethernetif.h>
 #include <netif/ethernetif.h>
 #endif
 #endif
 
 
@@ -36,6 +40,7 @@ extern void finsh_system_init(void);
 extern void finsh_set_device(const char* device);
 extern void finsh_set_device(const char* device);
 #endif
 #endif
 
 
+/* bss end definitions for heap init */
 #ifdef __CC_ARM
 #ifdef __CC_ARM
 extern int Image$$RW_IRAM1$$ZI$$Limit;
 extern int Image$$RW_IRAM1$$ZI$$Limit;
 #elif __ICCARM__
 #elif __ICCARM__
@@ -104,18 +109,25 @@ void rtthread_startup(void)
 
 
 	/* init hardware serial device */
 	/* init hardware serial device */
 	rt_hw_usart_init();
 	rt_hw_usart_init();
+
+#ifdef RT_USING_DFS
 	/* init sdcard driver */
 	/* init sdcard driver */
 #if STM32_USE_SDIO
 #if STM32_USE_SDIO
 	rt_hw_sdcard_init();
 	rt_hw_sdcard_init();
 #else
 #else
 	rt_hw_msd_init();
 	rt_hw_msd_init();
 #endif
 #endif
+#endif
 
 
 #ifdef RT_USING_LWIP
 #ifdef RT_USING_LWIP
 	eth_system_device_init();
 	eth_system_device_init();
 
 
 	/* register ethernetif device */
 	/* register ethernetif device */
+#ifdef STM32F10X_CL
+	rt_hw_stm32_eth_init();
+#else
 	rt_hw_enc28j60_init();
 	rt_hw_enc28j60_init();
+#endif
 #endif
 #endif
 
 
     rt_hw_rtc_init();
     rt_hw_rtc_init();
@@ -129,7 +141,7 @@ void rtthread_startup(void)
 #ifdef RT_USING_FINSH
 #ifdef RT_USING_FINSH
 	/* init finsh */
 	/* init finsh */
 	finsh_system_init();
 	finsh_system_init();
-	finsh_set_device("uart1");
+	finsh_set_device(FINSH_DEVICE_NAME);
 #endif
 #endif
 
 
 	/* init idle thread */
 	/* init idle thread */