update sub-project files of stm3210.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@223 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong 2009-12-24 12:38:11 +00:00
parent 8f90e129d3
commit ae58dd84b4
14 changed files with 813 additions and 546 deletions

View File

@ -25,22 +25,12 @@
/*@{*/ /*@{*/
#ifdef RT_USING_LWIP
#ifdef STM32F10X_CL
extern void rt_hw_stm32_eth_init(void);
#else
#include "enc28j60.h"
#endif
#include <netif/ethernetif.h>
#endif
extern int rt_application_init(void); extern int rt_application_init(void);
#ifdef RT_USING_FINSH #ifdef RT_USING_FINSH
extern void finsh_system_init(void); 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__
@ -117,17 +107,6 @@ void rtthread_startup(void)
#else #else
rt_hw_msd_init(); rt_hw_msd_init();
#endif #endif
#endif
#ifdef RT_USING_LWIP
eth_system_device_init();
/* register ethernetif device */
#ifdef STM32F10X_CL
rt_hw_stm32_eth_init();
#else
rt_hw_enc28j60_init();
#endif
#endif #endif
rt_hw_rtc_init(); rt_hw_rtc_init();
@ -144,6 +123,9 @@ void rtthread_startup(void)
finsh_set_device(FINSH_DEVICE_NAME); finsh_set_device(FINSH_DEVICE_NAME);
#endif #endif
/* init timer thread */
rt_system_timer_thread_init();
/* init idle thread */ /* init idle thread */
rt_thread_idle_init(); rt_thread_idle_init();

View File

@ -22,8 +22,8 @@
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "stm32f10x_it.h" #include "stm32f10x_it.h"
#include <board.h>
#include <rtthread.h> #include <rtthread.h>
#include "board.h"
/** @addtogroup Template_Project /** @addtogroup Template_Project
* @{ * @{
@ -225,6 +225,7 @@ void USART3_IRQHandler(void)
#endif #endif
} }
#if defined(RT_USING_DFS) && STM32_USE_SDIO
/******************************************************************************* /*******************************************************************************
* Function Name : SDIO_IRQHandler * Function Name : SDIO_IRQHandler
* Description : This function handles SDIO global interrupt request. * Description : This function handles SDIO global interrupt request.
@ -234,7 +235,6 @@ void USART3_IRQHandler(void)
*******************************************************************************/ *******************************************************************************/
void SDIO_IRQHandler(void) void SDIO_IRQHandler(void)
{ {
#if defined(RT_USING_DFS) && STM32_USE_SDIO
extern int SD_ProcessIRQSrc(void); extern int SD_ProcessIRQSrc(void);
/* enter interrupt */ /* enter interrupt */
@ -245,9 +245,32 @@ void SDIO_IRQHandler(void)
/* leave interrupt */ /* leave interrupt */
rt_interrupt_leave(); rt_interrupt_leave();
#endif
} }
#endif
#ifdef RT_USING_LWIP
#ifdef STM32F10X_CL
/*******************************************************************************
* Function Name : ETH_IRQHandler
* Description : This function handles ETH interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void ETH_IRQHandler(void)
{
extern void rt_hw_stm32_eth_isr(void);
/* enter interrupt */
rt_interrupt_enter();
rt_hw_stm32_eth_isr();
/* leave interrupt */
rt_interrupt_leave();
}
#else
#if (STM32_ETH_IF == 0)
/******************************************************************************* /*******************************************************************************
* Function Name : EXTI0_IRQHandler * Function Name : EXTI0_IRQHandler
* Description : This function handles External interrupt Line 0 request. * Description : This function handles External interrupt Line 0 request.
@ -257,7 +280,6 @@ void SDIO_IRQHandler(void)
*******************************************************************************/ *******************************************************************************/
void EXTI0_IRQHandler(void) void EXTI0_IRQHandler(void)
{ {
#if defined(RT_USING_LWIP) && !defined(STM32F10X_CL)
extern void enc28j60_isr(void); extern void enc28j60_isr(void);
/* enter interrupt */ /* enter interrupt */
@ -270,30 +292,35 @@ void EXTI0_IRQHandler(void)
/* leave interrupt */ /* leave interrupt */
rt_interrupt_leave(); rt_interrupt_leave();
#endif
} }
#endif
#if (STM32_ETH_IF == 1)
/******************************************************************************* /*******************************************************************************
* Function Name : ETH_IRQHandler * Function Name : EXTI9_5_IRQHandler
* Description : This function handles ETH interrupt request. * Description : This function handles External lines 9 to 5 interrupt request.
* Input : None * Input : None
* Output : None * Output : None
* Return : None * Return : None
*******************************************************************************/ *******************************************************************************/
void ETH_IRQHandler(void) void EXTI9_5_IRQHandler(void)
{ {
#if defined(RT_USING_LWIP) && defined(STM32F10X_CL) extern void rt_dm9000_isr(void);
extern void rt_hw_stm32_eth_isr(void);
/* enter interrupt */ /* enter interrupt */
rt_interrupt_enter(); rt_interrupt_enter();
rt_hw_stm32_eth_isr(); rt_dm9000_isr();
/* leave interrupt */ /* Clear the Key Button EXTI line pending bit */
rt_interrupt_leave(); EXTI_ClearITPendingBit(EXTI_Line7);
#endif
/* leave interrupt */
rt_interrupt_leave();
} }
#endif
#endif
#endif /* end of RT_USING_LWIP */
/** /**
* @} * @}

View File

@ -22,8 +22,6 @@
#ifdef RT_USING_DFS #ifdef RT_USING_DFS
/* dfs init */ /* dfs init */
#include <dfs_init.h> #include <dfs_init.h>
/* dfs filesystem:FAT filesystem init */
#include <dfs_fat.h>
/* dfs filesystem:EFS filesystem init */ /* dfs filesystem:EFS filesystem init */
#include <dfs_efs.h> #include <dfs_efs.h>
/* dfs Filesystem APIs */ /* dfs Filesystem APIs */

View File

@ -24,6 +24,12 @@
/* Using Hook */ /* Using Hook */
#define RT_USING_HOOK #define RT_USING_HOOK
/* Using Software Timer */
/* #define RT_USING_TIMER_SOFT */
#define RT_TIMER_THREAD_PRIO 4
#define RT_TIMER_THREAD_STACK_SIZE 512
#define RT_TIMER_TICK_PER_SECOND 10
/* SECTION: IPC */ /* SECTION: IPC */
/* Using Semaphore*/ /* Using Semaphore*/
#define RT_USING_SEMAPHORE #define RT_USING_SEMAPHORE
@ -61,6 +67,9 @@
/* SECTION: device filesystem */ /* SECTION: device filesystem */
#define RT_USING_DFS #define RT_USING_DFS
#define RT_USING_DFS_EFSL
/* #define RT_USING_DFS_ELMFAT */
/* the max number of mounted filesystem */ /* the max number of mounted filesystem */
#define DFS_FILESYSTEMS_MAX 2 #define DFS_FILESYSTEMS_MAX 2
/* the max number of opened files */ /* the max number of opened files */

View File

@ -117,6 +117,9 @@ void rtthread_startup(void)
finsh_set_device("uart1"); finsh_set_device("uart1");
#endif #endif
/* init timer thread */
rt_system_timer_thread_init();
/* init idle thread */ /* init idle thread */
rt_thread_idle_init(); rt_thread_idle_init();

View File

@ -22,6 +22,7 @@
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "stm32f10x_it.h" #include "stm32f10x_it.h"
#include <board.h>
#include <rtthread.h> #include <rtthread.h>
/** @addtogroup Template_Project /** @addtogroup Template_Project
@ -249,6 +250,7 @@ void USART3_IRQHandler(void)
#endif #endif
} }
#if defined(RT_USING_DFS) && STM32_USE_SDIO
/******************************************************************************* /*******************************************************************************
* Function Name : SDIO_IRQHandler * Function Name : SDIO_IRQHandler
* Description : This function handles SDIO global interrupt request. * Description : This function handles SDIO global interrupt request.
@ -258,7 +260,6 @@ void USART3_IRQHandler(void)
*******************************************************************************/ *******************************************************************************/
void SDIO_IRQHandler(void) void SDIO_IRQHandler(void)
{ {
#ifdef RT_USING_DFS
extern int SD_ProcessIRQSrc(void); extern int SD_ProcessIRQSrc(void);
/* enter interrupt */ /* enter interrupt */
@ -269,8 +270,82 @@ void SDIO_IRQHandler(void)
/* leave interrupt */ /* leave interrupt */
rt_interrupt_leave(); rt_interrupt_leave();
#endif
} }
#endif
#ifdef RT_USING_LWIP
#ifdef STM32F10X_CL
/*******************************************************************************
* Function Name : ETH_IRQHandler
* Description : This function handles ETH interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void ETH_IRQHandler(void)
{
extern void rt_hw_stm32_eth_isr(void);
/* enter interrupt */
rt_interrupt_enter();
rt_hw_stm32_eth_isr();
/* leave interrupt */
rt_interrupt_leave();
}
#else
#if (STM32_ETH_IF == 0)
/*******************************************************************************
* Function Name : EXTI0_IRQHandler
* Description : This function handles External interrupt Line 0 request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void EXTI0_IRQHandler(void)
{
extern void enc28j60_isr(void);
/* enter interrupt */
rt_interrupt_enter();
enc28j60_isr();
/* Clear the Key Button EXTI line pending bit */
EXTI_ClearITPendingBit(EXTI_Line0);
/* leave interrupt */
rt_interrupt_leave();
}
#endif
#if (STM32_ETH_IF == 1)
/*******************************************************************************
* Function Name : EXTI9_5_IRQHandler
* Description : This function handles External lines 9 to 5 interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void EXTI9_5_IRQHandler(void)
{
extern void rt_dm9000_isr(void);
/* enter interrupt */
rt_interrupt_enter();
rt_dm9000_isr();
/* Clear the Key Button EXTI line pending bit */
EXTI_ClearITPendingBit(EXTI_Line7);
/* leave interrupt */
rt_interrupt_leave();
}
#endif
#endif
#endif /* end of RT_USING_LWIP */
/** /**
* @} * @}

View File

@ -24,6 +24,12 @@
/* Using Hook */ /* Using Hook */
#define RT_USING_HOOK #define RT_USING_HOOK
/* Using Software Timer */
/* #define RT_USING_TIMER_SOFT */
#define RT_TIMER_THREAD_PRIO 4
#define RT_TIMER_THREAD_STACK_SIZE 512
#define RT_TIMER_TICK_PER_SECOND 10
/* SECTION: IPC */ /* SECTION: IPC */
/* Using Semaphore*/ /* Using Semaphore*/
#define RT_USING_SEMAPHORE #define RT_USING_SEMAPHORE
@ -59,7 +65,7 @@
/* the buffer size of console*/ /* the buffer size of console*/
#define RT_CONSOLEBUF_SIZE 128 #define RT_CONSOLEBUF_SIZE 128
/* SECTION: finsh shell */ /* SECTION: finsh, a C-Express shell */
#define RT_USING_FINSH #define RT_USING_FINSH
/* Using symbol table */ /* Using symbol table */
#define FINSH_USING_SYMTAB #define FINSH_USING_SYMTAB

View File

@ -110,6 +110,9 @@ void rtthread_startup(void)
finsh_set_device("uart1"); finsh_set_device("uart1");
#endif #endif
/* init timer thread */
rt_system_timer_thread_init();
/* init idle thread */ /* init idle thread */
rt_thread_idle_init(); rt_thread_idle_init();

View File

@ -22,6 +22,7 @@
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "stm32f10x_it.h" #include "stm32f10x_it.h"
#include <board.h>
#include <rtthread.h> #include <rtthread.h>
/** @addtogroup Template_Project /** @addtogroup Template_Project
@ -249,6 +250,103 @@ void USART3_IRQHandler(void)
#endif #endif
} }
#if defined(RT_USING_DFS) && STM32_USE_SDIO
/*******************************************************************************
* Function Name : SDIO_IRQHandler
* Description : This function handles SDIO global interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void SDIO_IRQHandler(void)
{
extern int SD_ProcessIRQSrc(void);
/* enter interrupt */
rt_interrupt_enter();
/* Process All SDIO Interrupt Sources */
SD_ProcessIRQSrc();
/* leave interrupt */
rt_interrupt_leave();
}
#endif
#ifdef RT_USING_LWIP
#ifdef STM32F10X_CL
/*******************************************************************************
* Function Name : ETH_IRQHandler
* Description : This function handles ETH interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void ETH_IRQHandler(void)
{
extern void rt_hw_stm32_eth_isr(void);
/* enter interrupt */
rt_interrupt_enter();
rt_hw_stm32_eth_isr();
/* leave interrupt */
rt_interrupt_leave();
}
#else
#if (STM32_ETH_IF == 0)
/*******************************************************************************
* Function Name : EXTI0_IRQHandler
* Description : This function handles External interrupt Line 0 request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void EXTI0_IRQHandler(void)
{
extern void enc28j60_isr(void);
/* enter interrupt */
rt_interrupt_enter();
enc28j60_isr();
/* Clear the Key Button EXTI line pending bit */
EXTI_ClearITPendingBit(EXTI_Line0);
/* leave interrupt */
rt_interrupt_leave();
}
#endif
#if (STM32_ETH_IF == 1)
/*******************************************************************************
* Function Name : EXTI9_5_IRQHandler
* Description : This function handles External lines 9 to 5 interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void EXTI9_5_IRQHandler(void)
{
extern void rt_dm9000_isr(void);
/* enter interrupt */
rt_interrupt_enter();
rt_dm9000_isr();
/* Clear the Key Button EXTI line pending bit */
EXTI_ClearITPendingBit(EXTI_Line7);
/* leave interrupt */
rt_interrupt_leave();
}
#endif
#endif
#endif /* end of RT_USING_LWIP */
/** /**
* @} * @}
*/ */

View File

@ -17,11 +17,13 @@
*/ */
/*@{*/ /*@{*/
#include <board.h>
#include <rtthread.h> #include <rtthread.h>
#ifdef RT_USING_LWIP #ifdef RT_USING_LWIP
#include <lwip/sys.h> #include <lwip/sys.h>
#include <lwip/api.h> #include <lwip/api.h>
#include <netif/ethernetif.h>
#endif #endif
void rt_init_thread_entry(void* parameter) void rt_init_thread_entry(void* parameter)
@ -31,6 +33,23 @@ void rt_init_thread_entry(void* parameter)
{ {
extern void lwip_sys_init(void); extern void lwip_sys_init(void);
/* register ethernetif device */
eth_system_device_init();
#ifdef STM32F10X_CL
rt_hw_stm32_eth_init();
#else
/* STM32F103 */
#if STM32_ETH_IF == 0
rt_hw_enc28j60_init();
#elif STM32_ETH_IF == 1
rt_hw_dm9000_init();
#endif
#endif
/* re-init device driver */
rt_device_init_all();
/* init lwip system */ /* init lwip system */
lwip_sys_init(); lwip_sys_init();
rt_kprintf("TCP/IP initialized!\n"); rt_kprintf("TCP/IP initialized!\n");

View File

@ -24,6 +24,12 @@
/* Using Hook */ /* Using Hook */
#define RT_USING_HOOK #define RT_USING_HOOK
/* Using Software Timer */
/* #define RT_USING_TIMER_SOFT */
#define RT_TIMER_THREAD_PRIO 4
#define RT_TIMER_THREAD_STACK_SIZE 512
#define RT_TIMER_TICK_PER_SECOND 10
/* SECTION: IPC */ /* SECTION: IPC */
/* Using Semaphore*/ /* Using Semaphore*/
#define RT_USING_SEMAPHORE #define RT_USING_SEMAPHORE

View File

@ -24,11 +24,6 @@
/*@{*/ /*@{*/
#ifdef RT_USING_LWIP
#include "enc28j60.h"
#include <netif/ethernetif.h>
#endif
extern int rt_application_init(void); extern int rt_application_init(void);
#ifdef RT_USING_FINSH #ifdef RT_USING_FINSH
extern void finsh_system_init(void); extern void finsh_system_init(void);
@ -104,13 +99,6 @@ void rtthread_startup(void)
/* init hardware serial device */ /* init hardware serial device */
rt_hw_usart_init(); rt_hw_usart_init();
#ifdef RT_USING_LWIP
eth_system_device_init();
/* register ethernetif device */
rt_hw_enc28j60_init();
#endif
/* init all device */ /* init all device */
rt_device_init_all(); rt_device_init_all();
@ -123,6 +111,9 @@ void rtthread_startup(void)
finsh_set_device("uart1"); finsh_set_device("uart1");
#endif #endif
/* init timer thread */
rt_system_timer_thread_init();
/* init idle thread */ /* init idle thread */
rt_thread_idle_init(); rt_thread_idle_init();

View File

@ -22,6 +22,7 @@
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "stm32f10x_it.h" #include "stm32f10x_it.h"
#include <board.h>
#include <rtthread.h> #include <rtthread.h>
/** @addtogroup Template_Project /** @addtogroup Template_Project
@ -249,6 +250,7 @@ void USART3_IRQHandler(void)
#endif #endif
} }
#if defined(RT_USING_DFS) && STM32_USE_SDIO
/******************************************************************************* /*******************************************************************************
* Function Name : SDIO_IRQHandler * Function Name : SDIO_IRQHandler
* Description : This function handles SDIO global interrupt request. * Description : This function handles SDIO global interrupt request.
@ -258,7 +260,6 @@ void USART3_IRQHandler(void)
*******************************************************************************/ *******************************************************************************/
void SDIO_IRQHandler(void) void SDIO_IRQHandler(void)
{ {
#ifdef RT_USING_DFS
extern int SD_ProcessIRQSrc(void); extern int SD_ProcessIRQSrc(void);
/* enter interrupt */ /* enter interrupt */
@ -269,9 +270,32 @@ void SDIO_IRQHandler(void)
/* leave interrupt */ /* leave interrupt */
rt_interrupt_leave(); rt_interrupt_leave();
#endif
} }
#endif
#ifdef RT_USING_LWIP
#ifdef STM32F10X_CL
/*******************************************************************************
* Function Name : ETH_IRQHandler
* Description : This function handles ETH interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void ETH_IRQHandler(void)
{
extern void rt_hw_stm32_eth_isr(void);
/* enter interrupt */
rt_interrupt_enter();
rt_hw_stm32_eth_isr();
/* leave interrupt */
rt_interrupt_leave();
}
#else
#if (STM32_ETH_IF == 0)
/******************************************************************************* /*******************************************************************************
* Function Name : EXTI0_IRQHandler * Function Name : EXTI0_IRQHandler
* Description : This function handles External interrupt Line 0 request. * Description : This function handles External interrupt Line 0 request.
@ -281,7 +305,6 @@ void SDIO_IRQHandler(void)
*******************************************************************************/ *******************************************************************************/
void EXTI0_IRQHandler(void) void EXTI0_IRQHandler(void)
{ {
#ifdef RT_USING_LWIP
extern void enc28j60_isr(void); extern void enc28j60_isr(void);
/* enter interrupt */ /* enter interrupt */
@ -294,8 +317,35 @@ void EXTI0_IRQHandler(void)
/* leave interrupt */ /* leave interrupt */
rt_interrupt_leave(); rt_interrupt_leave();
#endif
} }
#endif
#if (STM32_ETH_IF == 1)
/*******************************************************************************
* Function Name : EXTI9_5_IRQHandler
* Description : This function handles External lines 9 to 5 interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void EXTI9_5_IRQHandler(void)
{
extern void rt_dm9000_isr(void);
/* enter interrupt */
rt_interrupt_enter();
rt_dm9000_isr();
/* Clear the Key Button EXTI line pending bit */
EXTI_ClearITPendingBit(EXTI_Line7);
/* leave interrupt */
rt_interrupt_leave();
}
#endif
#endif
#endif /* end of RT_USING_LWIP */
/** /**
* @} * @}