SysTick中断怎么写啊

[复制链接]
3554|5
 楼主| ddllxxrr 发表于 2011-3-4 16:19 | 显示全部楼层 |阅读模式
各位大侠,我想用SysTick中断点个灯,但中断涵数好像根本没有,高手说下怎么写,中断0-31都不包含它哟
hotpower 发表于 2011-3-4 17:19 | 显示全部楼层
俺的例程里有
 楼主| ddllxxrr 发表于 2011-3-5 10:34 | 显示全部楼层
你的例程在哪里,请给个链接,谢了
北理黒鳍 发表于 2011-4-1 21:25 | 显示全部楼层
2楼大叔分享下吧
新好男孩 发表于 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    */
  }
}
-自己人 发表于 2011-4-9 20:05 | 显示全部楼层
不会写啊!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

2404

主题

7002

帖子

68

粉丝
快速回复 在线客服 返回列表 返回顶部