?? user_systick.c
字號:
/****************************************Copyright (c)**************************************************
** 思 蛻 盟 豆 皮 開 發 小 組
** stmfans 論壇
**
** QQ 群: 65081316 StmFans思蛻盟 1組
** QQ 群: 68584951 StmFans思蛻盟 2組
** http://www.stmfans.com/bbs/
**
** This program was produced by the
** IAR Embedded Workbench 4.0 Kickstart 442
** Copyright 2008-2009 stmfans
** Chip type : STM32F103VB
** Program type : Application
** Clock frequency : 8.000000 MHz
** Memory model :
** External SRAM size :
** Data Stack size :
**--------------文件信息--------------------------------------------------------------------------------
**文 件 名: user_systick.c
**創 建 人: 陳海
**最后修改日期: 2008年10月23日
**描 述: 豆皮開發板教程
**
**--------------歷史版本信息----------------------------------------------------------------------------
** 創建人: 陳海
** 版 本: v0.01
** 日 期: 2008年10月23日
** 描 述: 原始版本
**
**--------------當前版本信息----------------------------------------------------------------------------
** 創建人: 陳海
** 版 本: v0.01
** 日 期: 2008年10月23日
** 描 述: 當前版本
**
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
/* Includes ------------------------------------------------------------------*/
#include "user_systick.h"
//SysTick設置
/*******************************************************************************
* Function Name : SysTick_Config
* Description : Configures SysTick
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void SysTick_Config(void)
{
/* Disable SysTick Counter */
SysTick_CounterCmd(SysTick_Counter_Disable);
/* Disable the SysTick Interrupt */
SysTick_ITConfig(DISABLE);
/* Configure HCLK clock as SysTick clock source */
SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK_Div8);
/* SysTick interrupt each 1000 Hz with HCLK equal to 72MHz */
SysTick_SetReload(9000);
/* Enable the SysTick Interrupt */
SysTick_ITConfig(ENABLE);
}
/*******************************************************************************
* Function Name : Delay_Ms
* Description : Inserts a delay time.
* Input : nTime: specifies the delay time length, in milliseconds.
* Output : None
* Return : None
*******************************************************************************/
void Delay_Ms(u32 nTime)
{
/* Enable the SysTick Counter */
SysTick_CounterCmd(SysTick_Counter_Enable);
TimingDelay = nTime;
while(TimingDelay != 0);
/* Disable SysTick Counter */
SysTick_CounterCmd(SysTick_Counter_Disable);
/* Clear SysTick Counter */
SysTick_CounterCmd(SysTick_Counter_Clear);
}
/*******************************************************************************
* Function Name : TimingDelayMs_Decrement
* Description : Decrements the TimingDelay variable.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void TimingDelay_Decrement(void)
{
if (TimingDelay != 0x00)
{
TimingDelay--;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -