打印

SysTick中断怎么写啊

[复制链接]
1933|5
手机看帖
扫描二维码
随时随地手机跟帖
沙发
hotpower| | 2011-3-4 17:19 | 只看该作者
俺的例程里有

使用特权

评论回复
板凳
ddllxxrr|  楼主 | 2011-3-5 10:34 | 只看该作者
你的例程在哪里,请给个链接,谢了

使用特权

评论回复
地板
北理黒鳍| | 2011-4-1 21:25 | 只看该作者
2楼大叔分享下吧

使用特权

评论回复
5
新好男孩| | 2011-4-5 13:21 | 只看该作者
CMSIS Example
The following section shows a typical example for using the CMSIS layer in user applications. The example is based on a STM32F10x Device.

#include "stm32f10x.h"

volatile uint32_t msTicks;                       /* timeTicks counter */

void SysTick_Handler(void) {
  msTicks++;                                     /* increment timeTicks counter */
}

__INLINE static void Delay (uint32_t dlyTicks) {
  uint32_t curTicks = msTicks;

  while ((msTicks - curTicks) < dlyTicks);
}

__INLINE static void LED_Config(void) {
  ;                                              /* Configure the LEDs */
}

__INLINE static void LED_On (uint32_t led) {
  ;                                              /* Turn On  LED */
}

__INLINE static void LED_Off (uint32_t led) {
  ;                                              /* Turn Off LED */
}

int main (void) {
  if (SysTick_Config (SystemCoreClock / 1000)) { /* Setup SysTick for 1 msec interrupts */
    ;                                            /* Handle Error */
    while (1);
  }
  
  LED_Config();                                  /* configure the LEDs */                           

  while(1) {
    LED_On (0x100);                              /* Turn  on the LED   */
    Delay (100);                                 /* delay  100 Msec    */
    LED_Off (0x100);                             /* Turn off the LED   */
    Delay (100);                                 /* delay  100 Msec    */
  }
}

使用特权

评论回复
6
-自己人| | 2011-4-9 20:05 | 只看该作者
不会写啊!

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:http://shop34182318.taobao.com/ http://shop562064536.taobao.com

2398

主题

6945

帖子

66

粉丝