Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
e749fb6e
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e749fb6e
编写于
7月 12, 2013
作者:
wuyangyong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cleanup code.
上级
a183f1fb
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
54 addition
and
165 deletion
+54
-165
bsp/stm32f10x/applications/startup.c
bsp/stm32f10x/applications/startup.c
+5
-24
bsp/stm32f10x/drivers/board.c
bsp/stm32f10x/drivers/board.c
+3
-3
bsp/stm32f10x/drivers/board.h
bsp/stm32f10x/drivers/board.h
+3
-36
bsp/stm32f10x/drivers/sdcard.c
bsp/stm32f10x/drivers/sdcard.c
+14
-0
bsp/stm32f10x/drivers/stm32f10x_it.c
bsp/stm32f10x/drivers/stm32f10x_it.c
+29
-102
未找到文件。
bsp/stm32f10x/applications/startup.c
浏览文件 @
e749fb6e
...
...
@@ -15,9 +15,7 @@
#include <rthw.h>
#include <rtthread.h>
#include "stm32f10x.h"
#include "board.h"
#include "rtc.h"
/**
* @addtogroup STM32
...
...
@@ -68,9 +66,6 @@ void rtthread_startup(void)
/* show version */
rt_show_version
();
/* init tick */
rt_system_tick_init
();
/* init kernel object */
rt_system_object_init
();
...
...
@@ -89,25 +84,14 @@ void rtthread_startup(void)
/* init memory system */
rt_system_heap_init
((
void
*
)
&
__bss_end
,
(
void
*
)
STM32_SRAM_END
);
#endif
#endif
#endif
#endif
/* STM32_EXT_SRAM */
#endif
/* RT_USING_HEAP */
/* init scheduler system */
rt_system_scheduler_init
();
#ifdef RT_USING_DFS
/* init sdcard driver */
#if STM32_USE_SDIO
rt_hw_sdcard_init
();
#else
rt_hw_msd_init
();
#endif
#endif
rt_hw_rtc_init
();
/* init all device */
rt_device_init_all
();
/* init timer thread */
rt_system_timer_thread_init
();
/* init application */
rt_application_init
();
...
...
@@ -115,12 +99,9 @@ void rtthread_startup(void)
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init
();
finsh_set_device
(
"uart1"
);
finsh_set_device
(
RT_CONSOLE_DEVICE_NAME
);
#endif
/* init timer thread */
rt_system_timer_thread_init
();
/* init idle thread */
rt_thread_idle_init
();
...
...
bsp/stm32f10x/drivers/board.c
浏览文件 @
e749fb6e
...
...
@@ -153,7 +153,7 @@ void EXT_SRAM_Configuration(void)
* This is the timer interrupt service routine.
*
*/
void
rt_hw_timer_h
andler
(
void
)
void
SysTick_H
andler
(
void
)
{
/* enter interrupt */
rt_interrupt_enter
();
...
...
@@ -167,7 +167,7 @@ void rt_hw_timer_handler(void)
/**
* This function will initial STM32 board.
*/
void
rt_hw_board_init
()
void
rt_hw_board_init
(
void
)
{
/* NVIC Configuration */
NVIC_Configuration
();
...
...
@@ -180,7 +180,7 @@ void rt_hw_board_init()
#endif
rt_hw_usart_init
();
rt_console_set_device
(
CONSOLE_DEVIC
E
);
rt_console_set_device
(
RT_CONSOLE_DEVICE_NAM
E
);
}
/*@}*/
bsp/stm32f10x/drivers/board.h
浏览文件 @
e749fb6e
...
...
@@ -16,10 +16,9 @@
#ifndef __BOARD_H__
#define __BOARD_H__
#include "stm32f10x.h"
/* board configuration */
// <o> SDCard Driver <1=>SDIO sdcard <0=>SPI MMC card
// <i>Default: 1
#define STM32_USE_SDIO 1
/* whether use board external SRAM memory */
// <e>Use external SRAM memory on the board
...
...
@@ -38,38 +37,6 @@
#define STM32_SRAM_SIZE 64
#define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
// <o> Console on USART: <0=> no console <1=>USART 1 <2=>USART 2 <3=> USART 3
// <i>Default: 1
#define STM32_CONSOLE_USART 1
// <o> Ethernet Interface: <0=> Microchip ENC28J60 <1=> Davicom DM9000A
// <i>Default: 0
#define STM32_ETH_IF 1
void
rt_hw_board_led_on
(
int
n
);
void
rt_hw_board_led_off
(
int
n
);
void
rt_hw_board_init
(
void
);
#if STM32_CONSOLE_USART == 0
#define CONSOLE_DEVICE "no"
#elif STM32_CONSOLE_USART == 1
#define CONSOLE_DEVICE "uart1"
#elif STM32_CONSOLE_USART == 2
#define CONSOLE_DEVICE "uart2"
#elif STM32_CONSOLE_USART == 3
#define CONSOLE_DEVICE "uart3"
#endif
void
rt_hw_usart_init
(
void
);
/* SD Card init function */
void
rt_hw_sdcard_init
(
void
);
void
rt_hw_msd_init
(
void
);
/* ETH interface init function */
void
rt_hw_enc28j60_init
(
void
);
void
rt_hw_dm9000_init
(
void
);
#endif
#endif
/* __BOARD_H__ */
// <<< Use Configuration Wizard in Context Menu >>>
bsp/stm32f10x/drivers/sdcard.c
浏览文件 @
e749fb6e
...
...
@@ -3236,3 +3236,17 @@ __return:
rt_kprintf
(
"sdcard init failed
\n
"
);
GPIO_SetBits
(
GPIOC
,
GPIO_Pin_6
);
/* SD card power down */
}
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
();
}
bsp/stm32f10x/drivers/stm32f10x_it.c
浏览文件 @
e749fb6e
...
...
@@ -57,10 +57,10 @@ void NMI_Handler(void)
*/
void
MemManage_Handler
(
void
)
{
/* Go to infinite loop when Memory Manage exception occurs */
while
(
1
)
{
}
/* Go to infinite loop when Memory Manage exception occurs */
while
(
1
)
{
}
}
/**
...
...
@@ -70,10 +70,10 @@ void MemManage_Handler(void)
*/
void
BusFault_Handler
(
void
)
{
/* Go to infinite loop when Bus Fault exception occurs */
while
(
1
)
{
}
/* Go to infinite loop when Bus Fault exception occurs */
while
(
1
)
{
}
}
/**
...
...
@@ -83,10 +83,10 @@ void BusFault_Handler(void)
*/
void
UsageFault_Handler
(
void
)
{
/* Go to infinite loop when Usage Fault exception occurs */
while
(
1
)
{
}
/* Go to infinite loop when Usage Fault exception occurs */
while
(
1
)
{
}
}
/**
...
...
@@ -107,11 +107,10 @@ void DebugMon_Handler(void)
{
}
void
SysTick_Handler
(
void
)
{
extern
void
rt_hw_timer_handler
(
void
);
rt_hw_timer_handler
();
}
//void SysTick_Handler(void)
//{
// // definition in boarc.c
//}
/******************************************************************************/
/* STM32F10x Peripherals Interrupt Handlers */
...
...
@@ -131,7 +130,7 @@ void DMA1_Channel2_IRQHandler(void)
{
#ifdef RT_USING_UART3
extern
struct
rt_device
uart3_device
;
extern
void
rt_hw_serial_dma_tx_isr
(
struct
rt_device
*
device
);
extern
void
rt_hw_serial_dma_tx_isr
(
struct
rt_device
*
device
);
/* enter interrupt */
rt_interrupt_enter
();
...
...
@@ -161,7 +160,7 @@ void USART1_IRQHandler(void)
{
#ifdef RT_USING_UART1
extern
struct
rt_device
uart1_device
;
extern
void
rt_hw_serial_isr
(
struct
rt_device
*
device
);
extern
void
rt_hw_serial_isr
(
struct
rt_device
*
device
);
/* enter interrupt */
rt_interrupt_enter
();
...
...
@@ -184,7 +183,7 @@ void USART2_IRQHandler(void)
{
#ifdef RT_USING_UART2
extern
struct
rt_device
uart2_device
;
extern
void
rt_hw_serial_isr
(
struct
rt_device
*
device
);
extern
void
rt_hw_serial_isr
(
struct
rt_device
*
device
);
/* enter interrupt */
rt_interrupt_enter
();
...
...
@@ -207,7 +206,7 @@ void USART3_IRQHandler(void)
{
#ifdef RT_USING_UART3
extern
struct
rt_device
uart3_device
;
extern
void
rt_hw_serial_isr
(
struct
rt_device
*
device
);
extern
void
rt_hw_serial_isr
(
struct
rt_device
*
device
);
/* enter interrupt */
rt_interrupt_enter
();
...
...
@@ -219,102 +218,30 @@ void USART3_IRQHandler(void)
#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
#ifdef RT_USING_LWIP
/*******************************************************************************
* 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.
* Function Name : EXTI4_IRQHandler
* Description : This function handles External lines 9 to 5 interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void
EXTI
2
_IRQHandler
(
void
)
void
EXTI
4
_IRQHandler
(
void
)
{
extern
void
enc28j6
0_isr
(
void
);
extern
void
rt_dm900
0_isr
(
void
);
/* enter interrupt */
rt_interrupt_enter
();
enc28j60_isr
();
/* Clear the DM9000A EXTI line pending bit */
EXTI_ClearITPendingBit
(
EXTI_Line4
);
/* Clear the Key Button EXTI line pending bit */
EXTI_ClearITPendingBit
(
EXTI_Line2
);
rt_dm9000_isr
();
/* leave interrupt */
rt_interrupt_leave
();
}
#endif
#if (STM32_ETH_IF == 1)
/*******************************************************************************
* Function Name : EXTI4_IRQHandler
* Description : This function handles External lines 9 to 5 interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void
EXTI4_IRQHandler
(
void
)
{
extern
void
rt_dm9000_isr
(
void
);
/* enter interrupt */
rt_interrupt_enter
();
/* Clear the DM9000A EXTI line pending bit */
EXTI_ClearITPendingBit
(
EXTI_Line4
);
rt_dm9000_isr
();
/* leave interrupt */
rt_interrupt_leave
();
}
#endif
#endif
#endif
/* end of RT_USING_LWIP */
#endif
/* RT_USING_LWIP */
/**
* @}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录