add stm32 cl
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@32 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
4cd031e39f
commit
65b4117cfe
|
@ -23,14 +23,14 @@ void rt_init_thread_entry001(void *parameter)
|
|||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_Init(LEDG_PORT,&GPIO_InitStructure);
|
||||
|
||||
while(1)
|
||||
while (1)
|
||||
{
|
||||
rt_kprintf("thread001:%d\r\n",count++);
|
||||
GPIO_ResetBits(LEDG_PORT,LEDG_PIN);
|
||||
rt_thread_delay(64);
|
||||
rt_thread_delay(RT_TICK_PER_SECOND);
|
||||
rt_kprintf("thread001:%d\r\n",count++);
|
||||
GPIO_SetBits(LEDG_PORT,LEDG_PIN);
|
||||
rt_thread_delay(64);
|
||||
rt_thread_delay(RT_TICK_PER_SECOND);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,14 +48,14 @@ void rt_init_thread_entry002(void *parameter)
|
|||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_Init(LEDR_PORT,&GPIO_InitStructure);
|
||||
|
||||
while(1)
|
||||
while (1)
|
||||
{
|
||||
rt_kprintf("thread001:%d\r\n",count++);
|
||||
GPIO_ResetBits(LEDR_PORT,LEDR_PIN);
|
||||
rt_thread_delay(32);
|
||||
rt_thread_delay(RT_TICK_PER_SECOND*2);
|
||||
rt_kprintf("thread001:%d\r\n",count++);
|
||||
GPIO_SetBits(LEDR_PORT,LEDR_PIN);
|
||||
rt_thread_delay(32);
|
||||
rt_thread_delay(RT_TICK_PER_SECOND*2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,59 +1,6 @@
|
|||
#include <rtthread.h>
|
||||
#include "stm32f10x.h"
|
||||
|
||||
|
||||
ErrorStatus HSEStartUpStatus;
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : RCC_Configuration
|
||||
* Description : Configures the different system clocks.
|
||||
* Input : None
|
||||
* Output : None
|
||||
* Return : None
|
||||
*******************************************************************************/
|
||||
void RCC_Configuration(void)
|
||||
{
|
||||
/* RCC system reset(for debug purpose) */
|
||||
RCC_DeInit();
|
||||
|
||||
/* Enable HSE */
|
||||
RCC_HSEConfig(RCC_HSE_ON);
|
||||
|
||||
/* Wait till HSE is ready */
|
||||
HSEStartUpStatus = RCC_WaitForHSEStartUp();
|
||||
|
||||
if (HSEStartUpStatus == SUCCESS)
|
||||
{
|
||||
/* HCLK = SYSCLK */
|
||||
RCC_HCLKConfig(RCC_SYSCLK_Div1);
|
||||
|
||||
/* PCLK2 = HCLK */
|
||||
RCC_PCLK2Config(RCC_HCLK_Div1);
|
||||
/* PCLK1 = HCLK/2 */
|
||||
RCC_PCLK1Config(RCC_HCLK_Div2);
|
||||
|
||||
/* Flash 2 wait state */
|
||||
FLASH_SetLatency(FLASH_Latency_2);
|
||||
/* Enable Prefetch Buffer */
|
||||
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
|
||||
|
||||
/* PLLCLK = 8MHz * 9 = 72 MHz */
|
||||
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_6);
|
||||
|
||||
/* Enable PLL */
|
||||
RCC_PLLCmd(ENABLE);
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while (RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET) ;
|
||||
|
||||
/* Select PLL as system clock source */
|
||||
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
|
||||
|
||||
/* Wait till PLL is used as system clock source */
|
||||
while (RCC_GetSYSCLKSource() != 0x08) ;
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : NVIC_Configuration
|
||||
* Description : Configures the nested vectored interrupt controller.
|
||||
|
@ -90,8 +37,6 @@ void SysTick_Configuration(void)
|
|||
|
||||
SysTick_Config(cnts);
|
||||
SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK);
|
||||
//SysTick_CounterCmd(SysTick_Counter_Enable);
|
||||
//SysTick_ITConfig(ENABLE);
|
||||
}
|
||||
|
||||
/* init console to support rt_kprintf */
|
||||
|
@ -173,8 +118,6 @@ void rt_hw_console_output(const char* str)
|
|||
|
||||
void board_init(void)
|
||||
{
|
||||
RCC_Configuration();
|
||||
|
||||
/* NVIC Configuration */
|
||||
NVIC_Configuration();
|
||||
|
||||
|
|
|
@ -15,8 +15,6 @@ extern int __bss_end;
|
|||
|
||||
void rtthread_startup(void)
|
||||
{
|
||||
board_init();
|
||||
|
||||
/* show version */
|
||||
rt_show_version();
|
||||
|
||||
|
@ -64,6 +62,9 @@ int main(void)
|
|||
/* disable interrupt first */
|
||||
level = rt_hw_interrupt_disable();
|
||||
|
||||
SystemInit();
|
||||
board_init();
|
||||
|
||||
rtthread_startup();
|
||||
while (1);
|
||||
}
|
||||
|
|
|
@ -912,7 +912,37 @@ void SDIO_IRQHandler(void)
|
|||
{
|
||||
}
|
||||
|
||||
void DMA2_Channel5_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
|
||||
void ETH_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
|
||||
void ETH_WKUP_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
|
||||
void CAN2_TX_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
|
||||
void CAN2_RX0_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
|
||||
void CAN2_RX1_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
|
||||
void CAN2_SCE_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
|
||||
void OTG_FS_IRQHandler(void)
|
||||
{
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* STM32F10x Peripherals Interrupt Handlers */
|
||||
|
|
|
@ -97,6 +97,7 @@ extern "C"
|
|||
void EXTI15_10_IRQHandler(void);
|
||||
void RTCAlarm_IRQHandler(void);
|
||||
void USBWakeUp_IRQHandler(void);
|
||||
/****** HD ******/
|
||||
void TIM8_BRK_IRQHandler(void);
|
||||
void TIM8_UP_IRQHandler(void);
|
||||
void TIM8_TRG_COM_IRQHandler(void);
|
||||
|
@ -114,6 +115,15 @@ extern "C"
|
|||
void DMA2_Channel2_IRQHandler(void);
|
||||
void DMA2_Channel3_IRQHandler(void);
|
||||
void DMA2_Channel4_5_IRQHandler(void);
|
||||
/********* CL **********/
|
||||
void DMA2_Channel5_IRQHandler(void);
|
||||
void ETH_IRQHandler(void);
|
||||
void ETH_WKUP_IRQHandler(void);
|
||||
void CAN2_TX_IRQHandler(void);
|
||||
void CAN2_RX0_IRQHandler(void);
|
||||
void CAN2_RX1_IRQHandler(void);
|
||||
void CAN2_SCE_IRQHandler(void);
|
||||
void OTG_FS_IRQHandler(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue