2024年4月8日发(作者:秘昕靓)
使用定时器1实现1秒定时,控制流水灯流水点亮。中断方式
(PR=9)
/****************************************************************************
* 文 件 名:main.c
* 功 能:使用定时器0实现1秒定时,控制蜂鸣器蜂鸣。(中断方式)
* 说 明:短接蜂鸣器跳线JP7。断开CF卡跳线JP13、GPIO接口J17。
****************************************************************************/
#include "config.h"
#define LED1 1<<16 // P1.16
#define LED2 1<<17 // P1.17
#define LED3 1<<18 // P1.18
#define LED4 1<<19 // P1.19
#define LED5 1<<20 // P1.20
#define LED6 1<<21 // P1.21
#define LED7 1<<22 // P1.22
#define LED8 1<<23 // P1.23
#define LEDCON 0x00ff0000
const uint32 DISP_TAB[8] = { 0xff01ffff, 0xff02ffff, 0xff04ffff, 0xff08ffff,
0xff10ffff, 0xff20ffff, 0xff40ffff, 0xff80ffff};
/****************************************************************************
* 名 称:IRQ_Time0()
* 功 能:定时器0中断服务程序,取反BEEPCON控制口。
* 入口参数:无
* 出口参数:无
****************************************************************************/
void __irq IRQ_Time1(void)
2024年4月8日发(作者:秘昕靓)
使用定时器1实现1秒定时,控制流水灯流水点亮。中断方式
(PR=9)
/****************************************************************************
* 文 件 名:main.c
* 功 能:使用定时器0实现1秒定时,控制蜂鸣器蜂鸣。(中断方式)
* 说 明:短接蜂鸣器跳线JP7。断开CF卡跳线JP13、GPIO接口J17。
****************************************************************************/
#include "config.h"
#define LED1 1<<16 // P1.16
#define LED2 1<<17 // P1.17
#define LED3 1<<18 // P1.18
#define LED4 1<<19 // P1.19
#define LED5 1<<20 // P1.20
#define LED6 1<<21 // P1.21
#define LED7 1<<22 // P1.22
#define LED8 1<<23 // P1.23
#define LEDCON 0x00ff0000
const uint32 DISP_TAB[8] = { 0xff01ffff, 0xff02ffff, 0xff04ffff, 0xff08ffff,
0xff10ffff, 0xff20ffff, 0xff40ffff, 0xff80ffff};
/****************************************************************************
* 名 称:IRQ_Time0()
* 功 能:定时器0中断服务程序,取反BEEPCON控制口。
* 入口参数:无
* 出口参数:无
****************************************************************************/
void __irq IRQ_Time1(void)