|
/*********************************************
标题:MyDebugger
软件平台:IAR for ARM6.21
硬件平台:stm32f4-discovery
主频:168M
描述:实现一个调试工具
author:小船
data:2012-02-04
**********************************************/
#include <stm32f4xx.h>
#include <MyDebugger.h>
uint32_t Gb_TimingDelay;
void Delay(uint32_t nTime);
void main ()
{
SysTick_Config(SystemCoreClock / 1000); //设置systemtick一毫秒中断
//char test[15] = {0, 1, 2, 3, 4, 10, 11, 12, 13, 14, 15, 0xfe, 0xf0, 0x07, 0x09};
SCB->AIRCR = 0x05AF0000 | 0x400; //中断优先级分组 抢占:响应=3:1
MyDebugger_Init();
while(1)
{
MyDebugger_Message("My name is Xian Yongwen\n\r",
sizeof("My name is Xian Yongwen\n\r")/sizeof(char));
MyDebugger_LEDs(blue, on);
Delay(1);
MyDebugger_Message("广东石油化工学院\n\r",
sizeof("广东石油化工学院\n\r")/sizeof(char));
MyDebugger_LEDs(blue, off);
Delay(1);
}
}
void Delay(uint32_t nTime)
{
Gb_TimingDelay = nTime;
while(Gb_TimingDelay != 0);
}
void SysTick_Handler(void)
{
if (Gb_TimingDelay != 0x00)
{
Gb_TimingDelay--;
}
}
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|