Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
逆着光、寻觅
rt-thread
提交
fc54a74a
R
rt-thread
项目概览
逆着光、寻觅
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
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,发现更多精彩内容 >>
提交
fc54a74a
编写于
8月 09, 2015
作者:
B
Bernard Xiong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[BSP] stm32f7-disco cleanup
上级
33b95be4
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
224 addition
and
224 deletion
+224
-224
bsp/stm32f7-disco/applications/application.c
bsp/stm32f7-disco/applications/application.c
+20
-17
bsp/stm32f7-disco/applications/startup.c
bsp/stm32f7-disco/applications/startup.c
+1
-11
bsp/stm32f7-disco/drivers/board.c
bsp/stm32f7-disco/drivers/board.c
+65
-60
bsp/stm32f7-disco/drivers/board.h
bsp/stm32f7-disco/drivers/board.h
+5
-5
bsp/stm32f7-disco/drivers/drv_led.h
bsp/stm32f7-disco/drivers/drv_led.h
+2
-0
bsp/stm32f7-disco/drivers/drv_usart.c
bsp/stm32f7-disco/drivers/drv_usart.c
+111
-111
bsp/stm32f7-disco/rtconfig.h
bsp/stm32f7-disco/rtconfig.h
+3
-3
bsp/stm32f7-disco/rtconfig.py
bsp/stm32f7-disco/rtconfig.py
+1
-1
include/rtdef.h
include/rtdef.h
+15
-15
tools/building.py
tools/building.py
+1
-1
未找到文件。
bsp/stm32f7-disco/applications/application.c
浏览文件 @
fc54a74a
...
...
@@ -13,16 +13,17 @@
* 2014-04-27 Bernard make code cleanup.
*/
#include <board.h>
#include <rtthread.h>
#include <components.h>
#include "drv_led.h"
static
void
led_thread_entry
(
void
*
parameter
)
static
void
led_thread_entry
(
void
*
parameter
)
{
led_hw_init
();
while
(
1
)
while
(
1
)
{
led_on
();
rt_thread_delay
(
RT_TICK_PER_SECOND
);
...
...
@@ -31,11 +32,13 @@ static void led_thread_entry(void* parameter)
}
}
void
rt_init_thread_entry
(
void
*
parameter
)
void
rt_init_thread_entry
(
void
*
parameter
)
{
rt_thread_t
tid
;
rt_components_init
();
tid
=
rt_thread_create
(
"led"
,
led_thread_entry
,
RT_NULL
,
512
,
12
,
5
);
...
...
@@ -50,7 +53,7 @@ int rt_application_init()
tid
=
rt_thread_create
(
"init"
,
rt_init_thread_entry
,
RT_NULL
,
2048
,
RT_THREAD_PRIORITY_MAX
/
3
,
20
);
2048
,
RT_THREAD_PRIORITY_MAX
/
3
,
20
);
if
(
tid
!=
RT_NULL
)
rt_thread_startup
(
tid
);
...
...
bsp/stm32f7-disco/applications/startup.c
浏览文件 @
fc54a74a
...
...
@@ -20,6 +20,7 @@
#include "drv_sdram.h"
#include "sram.h"
#endif
/**
* @addtogroup STM32
*/
...
...
@@ -27,11 +28,6 @@
/*@{*/
extern
int
rt_application_init
(
void
);
#ifdef RT_USING_FINSH
extern
void
finsh_system_init
(
void
);
extern
void
finsh_set_device
(
const
char
*
device
);
#endif
#ifdef USE_FULL_ASSERT
/**
...
...
@@ -91,12 +87,6 @@ void rtthread_startup(void)
/* init application */
rt_application_init
();
#ifdef RT_USING_FINSH
/* init finsh */
finsh_system_init
();
finsh_set_device
(
RT_CONSOLE_DEVICE_NAME
);
#endif
/* init timer thread */
rt_system_timer_thread_init
();
...
...
bsp/stm32f7-disco/drivers/board.c
浏览文件 @
fc54a74a
...
...
@@ -14,10 +14,12 @@
#include <rthw.h>
#include <rtthread.h>
#include <components.h>
#include "board.h"
#include "drv_usart.h"
#include "drv_mpu.h"
/**
* @addtogroup STM32
*/
...
...
@@ -61,9 +63,12 @@ static void SystemClock_Config(void)
ret
=
HAL_PWREx_EnableOverDrive
();
if
(
ret
!=
HAL_OK
)
if
(
ret
!=
HAL_OK
)
{
while
(
1
)
{
while
(
1
)
{
;
}
;
}
}
/* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
...
...
@@ -84,7 +89,7 @@ static void SystemClock_Config(void)
static
void
CPU_CACHE_Enable
(
void
)
{
/* Enable branch prediction */
SCB
->
CCR
|=
(
1
<<
18
);
SCB
->
CCR
|=
(
1
<<
18
);
__DSB
();
/* Enable I-Cache */
...
...
@@ -137,7 +142,7 @@ void rt_hw_board_init()
/* set pend exception priority */
NVIC_SetPriority
(
PendSV_IRQn
,
(
1
<<
__NVIC_PRIO_BITS
)
-
1
);
stm32_hw_usart
_init
();
rt_components_board
_init
();
#ifdef RT_USING_CONSOLE
rt_console_set_device
(
RT_CONSOLE_DEVICE_NAME
);
...
...
bsp/stm32f7-disco/drivers/board.h
浏览文件 @
fc54a74a
bsp/stm32f7-disco/drivers/drv_led.h
浏览文件 @
fc54a74a
...
...
@@ -14,6 +14,8 @@
#ifndef __DRV_LED_H
#define __DRV_LED_H
#include "board.h"
#define led_on() HAL_GPIO_WritePin(GPIOI, GPIO_PIN_1, GPIO_PIN_SET)
#define led_off() HAL_GPIO_WritePin(GPIOI, GPIO_PIN_1, GPIO_PIN_RESET)
...
...
bsp/stm32f7-disco/drivers/drv_usart.c
浏览文件 @
fc54a74a
...
...
@@ -57,7 +57,7 @@ static rt_err_t stm32_configure(struct rt_serial_device *serial, struct serial_c
uart
->
UartHandle
.
Init
.
Mode
=
UART_MODE_TX_RX
;
uart
->
UartHandle
.
AdvancedInit
.
AdvFeatureInit
=
UART_ADVFEATURE_NO_INIT
;
switch
(
cfg
->
data_bits
)
switch
(
cfg
->
data_bits
)
{
case
DATA_BITS_7
:
uart
->
UartHandle
.
Init
.
WordLength
=
UART_WORDLENGTH_7B
;
...
...
@@ -72,7 +72,7 @@ static rt_err_t stm32_configure(struct rt_serial_device *serial, struct serial_c
uart
->
UartHandle
.
Init
.
WordLength
=
UART_WORDLENGTH_8B
;
break
;
}
switch
(
cfg
->
stop_bits
)
switch
(
cfg
->
stop_bits
)
{
case
STOP_BITS_1
:
uart
->
UartHandle
.
Init
.
StopBits
=
UART_STOPBITS_1
;
...
...
@@ -84,7 +84,7 @@ static rt_err_t stm32_configure(struct rt_serial_device *serial, struct serial_c
uart
->
UartHandle
.
Init
.
StopBits
=
UART_STOPBITS_1
;
break
;
}
switch
(
cfg
->
parity
)
switch
(
cfg
->
parity
)
{
case
PARITY_NONE
:
uart
->
UartHandle
.
Init
.
Parity
=
UART_PARITY_NONE
;
...
...
@@ -99,11 +99,11 @@ static rt_err_t stm32_configure(struct rt_serial_device *serial, struct serial_c
uart
->
UartHandle
.
Init
.
Parity
=
UART_PARITY_NONE
;
break
;
}
if
(
HAL_UART_DeInit
(
&
uart
->
UartHandle
)
!=
HAL_OK
)
if
(
HAL_UART_DeInit
(
&
uart
->
UartHandle
)
!=
HAL_OK
)
{
return
RT_ERROR
;
}
if
(
HAL_UART_Init
(
&
uart
->
UartHandle
)
!=
HAL_OK
)
if
(
HAL_UART_Init
(
&
uart
->
UartHandle
)
!=
HAL_OK
)
{
return
RT_ERROR
;
}
...
...
@@ -191,9 +191,9 @@ void USART1_IRQHandler(void)
rt_interrupt_enter
();
/* UART in mode Receiver ---------------------------------------------------*/
if
((
__HAL_UART_GET_IT
(
&
uart
->
UartHandle
,
UART_IT_RXNE
)
!=
RESET
)
&&
(
__HAL_UART_GET_IT_SOURCE
(
&
uart
->
UartHandle
,
UART_IT_RXNE
)
!=
RESET
))
if
((
__HAL_UART_GET_IT
(
&
uart
->
UartHandle
,
UART_IT_RXNE
)
!=
RESET
)
&&
(
__HAL_UART_GET_IT_SOURCE
(
&
uart
->
UartHandle
,
UART_IT_RXNE
)
!=
RESET
))
{
rt_hw_serial_isr
(
&
serial1
,
RT_SERIAL_EVENT_RX_IND
);
rt_hw_serial_isr
(
&
serial1
,
RT_SERIAL_EVENT_RX_IND
);
/* Clear RXNE interrupt flag */
__HAL_UART_SEND_REQ
(
&
uart
->
UartHandle
,
UART_RXDATA_FLUSH_REQUEST
);
}
...
...
@@ -214,7 +214,7 @@ void USART1_IRQHandler(void)
void
HAL_UART_MspInit
(
UART_HandleTypeDef
*
huart
)
{
GPIO_InitTypeDef
GPIO_InitStruct
;
if
(
huart
->
Instance
==
USART1
)
if
(
huart
->
Instance
==
USART1
)
{
/* Enable GPIO TX/RX clock */
USART1_TX_GPIO_CLK_ENABLE
();
...
...
@@ -251,7 +251,7 @@ void HAL_UART_MspInit(UART_HandleTypeDef *huart)
*/
void
HAL_UART_MspDeInit
(
UART_HandleTypeDef
*
huart
)
{
if
(
huart
->
Instance
==
USART1
)
if
(
huart
->
Instance
==
USART1
)
{
/* Reset peripherals */
USART1_FORCE_RESET
();
...
...
bsp/stm32f7-disco/rtconfig.h
浏览文件 @
fc54a74a
...
...
@@ -97,7 +97,7 @@
// </section>
// <bool name="RT_USING_COMPONENTS_INIT" description="Using RT-Thread components initialization" default="true" />
//
#define RT_USING_COMPONENTS_INIT
#define RT_USING_COMPONENTS_INIT
// <section name="RT_USING_FINSH" description="Using finsh as shell, which is a C-Express shell" default="true" >
#define RT_USING_FINSH
#define FINSH_THREAD_PRIORITY 0xa
...
...
@@ -113,8 +113,8 @@
// </section>
// <section name="LIBC" description="C Runtime library setting" default="always" >
// <bool name="RT_USING_
NEWLIB" description="Using newlib library, only available under GNU GCC
" default="true" />
//
#define RT_USING_NEWLIB
// <bool name="RT_USING_
LIBC" description="Using libc library
" default="true" />
#define RT_USING_NEWLIB
// <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" />
//#define RT_USING_PTHREADS
// </section>
...
...
bsp/stm32f7-disco/rtconfig.py
浏览文件 @
fc54a74a
...
...
@@ -41,7 +41,7 @@ if PLATFORM == 'gcc':
OBJCPY
=
PREFIX
+
'objcopy'
DEVICE
=
' -mcpu=cortex-m7 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
CFLAGS
=
DEVICE
+
' -g -Wall
G
-DSTM32F756xx -DUSE_HAL_DRIVER -D__ASSEMBLY__ -D__FPU_USED'
CFLAGS
=
DEVICE
+
' -g -Wall -DSTM32F756xx -DUSE_HAL_DRIVER -D__ASSEMBLY__ -D__FPU_USED'
AFLAGS
=
' -c'
+
DEVICE
+
' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
LFLAGS
=
DEVICE
+
' -lm -lgcc -lc'
+
' -nostartfiles -Wl,--gc-sections,-Map=rtthread_stm32f7xx.map,-cref,-u,Reset_Handler -T rtthread-stm32f7xx.ld'
...
...
include/rtdef.h
浏览文件 @
fc54a74a
...
...
@@ -94,8 +94,8 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#ifdef __CC_ARM
/* ARM Compiler */
#include <stdarg.h>
#define SECTION(x) __attribute__((section(x)))
#define
UNUSED
__attribute__((unused))
#define
USED
__attribute__((used))
#define
RT_UNUSED
__attribute__((unused))
#define
RT_USED
__attribute__((used))
#define ALIGN(n) __attribute__((aligned(n)))
#define WEAK __weak
#define rt_inline static __inline
...
...
@@ -109,8 +109,8 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#elif defined (__IAR_SYSTEMS_ICC__)
/* for IAR Compiler */
#include <stdarg.h>
#define SECTION(x) @ x
#define UNUSED
#define USED
#define
RT_
UNUSED
#define
RT_
USED
#define PRAGMA(x) _Pragma(#x)
#define ALIGN(n) PRAGMA(data_alignment=n)
#define WEAK __weak
...
...
@@ -130,8 +130,8 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#endif
#define SECTION(x) __attribute__((section(x)))
#define
UNUSED
__attribute__((unused))
#define
USED
__attribute__((used))
#define
RT_UNUSED
__attribute__((unused))
#define
RT_USED
__attribute__((used))
#define ALIGN(n) __attribute__((aligned(n)))
#define WEAK __attribute__((weak))
#define rt_inline static __inline
...
...
@@ -139,8 +139,8 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#elif defined (__ADSPBLACKFIN__)
/* for VisualDSP++ Compiler */
#include <stdarg.h>
#define SECTION(x) __attribute__((section(x)))
#define
UNUSED
__attribute__((unused))
#define
USED
__attribute__((used))
#define
RT_UNUSED
__attribute__((unused))
#define
RT_USED
__attribute__((used))
#define ALIGN(n) __attribute__((aligned(n)))
#define WEAK __attribute__((weak))
#define rt_inline static inline
...
...
@@ -148,8 +148,8 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#elif defined (_MSC_VER)
#include <stdarg.h>
#define SECTION(x)
#define UNUSED
#define USED
#define
RT_
UNUSED
#define
RT_
USED
#define ALIGN(n) __declspec(align(n))
#define WEAK
#define rt_inline static __inline
...
...
@@ -160,8 +160,8 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
* GCC and MDK) compilers. See ARM Optimizing C/C++ Compiler 5.9.3 for more
* details. */
#define SECTION(x)
#define UNUSED
#define USED
#define
RT_
UNUSED
#define
RT_
USED
#define PRAGMA(x) _Pragma(#x)
#define ALIGN(n)
#define WEAK
...
...
tools/building.py
浏览文件 @
fc54a74a
...
...
@@ -224,7 +224,7 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
AddOption
(
'--verbose'
,
dest
=
'verbose'
,
action
=
'store_true'
,
default
=
Tru
e
,
default
=
Fals
e
,
help
=
'print verbose information during build'
)
if
not
GetOption
(
'verbose'
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录