[BSP] stm32f7-disco cleanup
This commit is contained in:
parent
33b95be42a
commit
fc54a74abb
|
@ -13,8 +13,9 @@
|
||||||
* 2014-04-27 Bernard make code cleanup.
|
* 2014-04-27 Bernard make code cleanup.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <board.h>
|
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
#include <components.h>
|
||||||
|
|
||||||
#include "drv_led.h"
|
#include "drv_led.h"
|
||||||
|
|
||||||
static void led_thread_entry(void *parameter)
|
static void led_thread_entry(void *parameter)
|
||||||
|
@ -36,6 +37,8 @@ void rt_init_thread_entry(void* parameter)
|
||||||
|
|
||||||
rt_thread_t tid;
|
rt_thread_t tid;
|
||||||
|
|
||||||
|
rt_components_init();
|
||||||
|
|
||||||
tid = rt_thread_create("led",
|
tid = rt_thread_create("led",
|
||||||
led_thread_entry, RT_NULL,
|
led_thread_entry, RT_NULL,
|
||||||
512, 12, 5);
|
512, 12, 5);
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "drv_sdram.h"
|
#include "drv_sdram.h"
|
||||||
#include "sram.h"
|
#include "sram.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @addtogroup STM32
|
* @addtogroup STM32
|
||||||
*/
|
*/
|
||||||
|
@ -27,11 +28,6 @@
|
||||||
/*@{*/
|
/*@{*/
|
||||||
|
|
||||||
extern int rt_application_init(void);
|
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
|
#ifdef USE_FULL_ASSERT
|
||||||
/**
|
/**
|
||||||
|
@ -91,12 +87,6 @@ void rtthread_startup(void)
|
||||||
/* init application */
|
/* init application */
|
||||||
rt_application_init();
|
rt_application_init();
|
||||||
|
|
||||||
#ifdef RT_USING_FINSH
|
|
||||||
/* init finsh */
|
|
||||||
finsh_system_init();
|
|
||||||
finsh_set_device(RT_CONSOLE_DEVICE_NAME);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* init timer thread */
|
/* init timer thread */
|
||||||
rt_system_timer_thread_init();
|
rt_system_timer_thread_init();
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,12 @@
|
||||||
|
|
||||||
#include <rthw.h>
|
#include <rthw.h>
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
#include <components.h>
|
||||||
|
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
#include "drv_usart.h"
|
#include "drv_usart.h"
|
||||||
#include "drv_mpu.h"
|
#include "drv_mpu.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @addtogroup STM32
|
* @addtogroup STM32
|
||||||
*/
|
*/
|
||||||
|
@ -63,7 +65,10 @@ static void SystemClock_Config(void)
|
||||||
|
|
||||||
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
|
/* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
|
||||||
|
@ -137,7 +142,7 @@ void rt_hw_board_init()
|
||||||
/* set pend exception priority */
|
/* set pend exception priority */
|
||||||
NVIC_SetPriority(PendSV_IRQn, (1 << __NVIC_PRIO_BITS) - 1);
|
NVIC_SetPriority(PendSV_IRQn, (1 << __NVIC_PRIO_BITS) - 1);
|
||||||
|
|
||||||
stm32_hw_usart_init();
|
rt_components_board_init();
|
||||||
|
|
||||||
#ifdef RT_USING_CONSOLE
|
#ifdef RT_USING_CONSOLE
|
||||||
rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
|
rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
#ifndef __DRV_LED_H
|
#ifndef __DRV_LED_H
|
||||||
#define __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_on() HAL_GPIO_WritePin(GPIOI, GPIO_PIN_1, GPIO_PIN_SET)
|
||||||
#define led_off() HAL_GPIO_WritePin(GPIOI, GPIO_PIN_1, GPIO_PIN_RESET)
|
#define led_off() HAL_GPIO_WritePin(GPIOI, GPIO_PIN_1, GPIO_PIN_RESET)
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@
|
||||||
// </section>
|
// </section>
|
||||||
|
|
||||||
// <bool name="RT_USING_COMPONENTS_INIT" description="Using RT-Thread components initialization" default="true" />
|
// <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" >
|
// <section name="RT_USING_FINSH" description="Using finsh as shell, which is a C-Express shell" default="true" >
|
||||||
#define RT_USING_FINSH
|
#define RT_USING_FINSH
|
||||||
#define FINSH_THREAD_PRIORITY 0xa
|
#define FINSH_THREAD_PRIORITY 0xa
|
||||||
|
@ -113,8 +113,8 @@
|
||||||
// </section>
|
// </section>
|
||||||
|
|
||||||
// <section name="LIBC" description="C Runtime library setting" default="always" >
|
// <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" />
|
// <bool name="RT_USING_LIBC" description="Using libc library" default="true" />
|
||||||
//#define RT_USING_NEWLIB
|
#define RT_USING_NEWLIB
|
||||||
// <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" />
|
// <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" />
|
||||||
//#define RT_USING_PTHREADS
|
//#define RT_USING_PTHREADS
|
||||||
// </section>
|
// </section>
|
||||||
|
|
|
@ -41,7 +41,7 @@ if PLATFORM == 'gcc':
|
||||||
OBJCPY = PREFIX + 'objcopy'
|
OBJCPY = PREFIX + 'objcopy'
|
||||||
|
|
||||||
DEVICE = ' -mcpu=cortex-m7 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
|
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 '
|
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'
|
LFLAGS = DEVICE + ' -lm -lgcc -lc' + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread_stm32f7xx.map,-cref,-u,Reset_Handler -T rtthread-stm32f7xx.ld'
|
||||||
|
|
||||||
|
|
|
@ -94,8 +94,8 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
|
||||||
#ifdef __CC_ARM /* ARM Compiler */
|
#ifdef __CC_ARM /* ARM Compiler */
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#define SECTION(x) __attribute__((section(x)))
|
#define SECTION(x) __attribute__((section(x)))
|
||||||
#define UNUSED __attribute__((unused))
|
#define RT_UNUSED __attribute__((unused))
|
||||||
#define USED __attribute__((used))
|
#define RT_USED __attribute__((used))
|
||||||
#define ALIGN(n) __attribute__((aligned(n)))
|
#define ALIGN(n) __attribute__((aligned(n)))
|
||||||
#define WEAK __weak
|
#define WEAK __weak
|
||||||
#define rt_inline static __inline
|
#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 */
|
#elif defined (__IAR_SYSTEMS_ICC__) /* for IAR Compiler */
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#define SECTION(x) @ x
|
#define SECTION(x) @ x
|
||||||
#define UNUSED
|
#define RT_UNUSED
|
||||||
#define USED
|
#define RT_USED
|
||||||
#define PRAGMA(x) _Pragma(#x)
|
#define PRAGMA(x) _Pragma(#x)
|
||||||
#define ALIGN(n) PRAGMA(data_alignment=n)
|
#define ALIGN(n) PRAGMA(data_alignment=n)
|
||||||
#define WEAK __weak
|
#define WEAK __weak
|
||||||
|
@ -130,8 +130,8 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SECTION(x) __attribute__((section(x)))
|
#define SECTION(x) __attribute__((section(x)))
|
||||||
#define UNUSED __attribute__((unused))
|
#define RT_UNUSED __attribute__((unused))
|
||||||
#define USED __attribute__((used))
|
#define RT_USED __attribute__((used))
|
||||||
#define ALIGN(n) __attribute__((aligned(n)))
|
#define ALIGN(n) __attribute__((aligned(n)))
|
||||||
#define WEAK __attribute__((weak))
|
#define WEAK __attribute__((weak))
|
||||||
#define rt_inline static __inline
|
#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 */
|
#elif defined (__ADSPBLACKFIN__) /* for VisualDSP++ Compiler */
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#define SECTION(x) __attribute__((section(x)))
|
#define SECTION(x) __attribute__((section(x)))
|
||||||
#define UNUSED __attribute__((unused))
|
#define RT_UNUSED __attribute__((unused))
|
||||||
#define USED __attribute__((used))
|
#define RT_USED __attribute__((used))
|
||||||
#define ALIGN(n) __attribute__((aligned(n)))
|
#define ALIGN(n) __attribute__((aligned(n)))
|
||||||
#define WEAK __attribute__((weak))
|
#define WEAK __attribute__((weak))
|
||||||
#define rt_inline static inline
|
#define rt_inline static inline
|
||||||
|
@ -148,8 +148,8 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
|
||||||
#elif defined (_MSC_VER)
|
#elif defined (_MSC_VER)
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#define SECTION(x)
|
#define SECTION(x)
|
||||||
#define UNUSED
|
#define RT_UNUSED
|
||||||
#define USED
|
#define RT_USED
|
||||||
#define ALIGN(n) __declspec(align(n))
|
#define ALIGN(n) __declspec(align(n))
|
||||||
#define WEAK
|
#define WEAK
|
||||||
#define rt_inline static __inline
|
#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
|
* GCC and MDK) compilers. See ARM Optimizing C/C++ Compiler 5.9.3 for more
|
||||||
* details. */
|
* details. */
|
||||||
#define SECTION(x)
|
#define SECTION(x)
|
||||||
#define UNUSED
|
#define RT_UNUSED
|
||||||
#define USED
|
#define RT_USED
|
||||||
#define PRAGMA(x) _Pragma(#x)
|
#define PRAGMA(x) _Pragma(#x)
|
||||||
#define ALIGN(n)
|
#define ALIGN(n)
|
||||||
#define WEAK
|
#define WEAK
|
||||||
|
|
|
@ -224,7 +224,7 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
|
||||||
AddOption('--verbose',
|
AddOption('--verbose',
|
||||||
dest='verbose',
|
dest='verbose',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
default=True,
|
default=False,
|
||||||
help='print verbose information during build')
|
help='print verbose information during build')
|
||||||
|
|
||||||
if not GetOption('verbose'):
|
if not GetOption('verbose'):
|
||||||
|
|
Loading…
Reference in New Issue