⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uhal.c.bak

📁 ucosIItest1添加信号).rar 初学者交流
💻 BAK
字号:
#include <stdarg.h>
#include <string.h>
#include <stdio.h>


#include "2410addr.h"
#include "2410lib.h"
//#include "uhal.h"
#include "Def.h"

#include "includes.h"


//InitTimers
void InitTimers(void)
{
	rTCFG0= 0x00000000;              	// prescaler0 = 0
	rTCFG1= 0x00000000;              	// mux0 = 1/2   
//timetick is 1000,	FCLK=200MHZ   
	rTCNTB0= PCLK/OS_TICKS_PER_SEC/2; //tick=1000;
	rTCMPB0= 0x0;
	rTCON=0x2;		//update mode for TCNTB0 and TCMPB0.
	rTCON=0x9;		//timer0 = auto reload, start	
}


void do_irq(void)
{
	rSRCPND &= BIT_TIMER0;
    rINTPND |= BIT_TIMER0;
    OSTimeTick();
}

void InitInterrupts(void)
{
	rINTMOD     = 0x0;                     //All=IRQ mode
	rINTMSK     = BIT_ALLMSK;              //All interrupt is masked.
	pISR_TIMER0    = (unsigned) UCOS_IRQHandler;
 
}

void OpenIRQ(void)
{
   rINTPND=0x00000000;
   	rINTMSK&=(~(BIT_TIMER0 ));	//Default value=0x7ffffff
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -