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

📄 timer.c

📁 实现了ucos在s3c2440上的移植
💻 C
字号:
//重写  Zhao mingfei 2008.1.16
#include "2440addr.h"
#include "snds.h"
#include "isr.h"
void Timer1_setup()
//This timer is initialized for ucos's timetick
//Pclk will be used in timer and the value of pclk is :Fclk=CPUclk=400000000
//Pclk=50000000,Hclk=100000000,UPLL=UCLK=48000000
//timetick= one stop /5ms => tcnt=250000=>rTCFG0=250 &&rTCFG1=1/8 =>tcnt=125
{
	rTCFG0=0xFA;
	rTCFG1=0x20;
	rTCNTB1=125;
	rTCNTO1=125;
	rTCON|=0xa00;
	pISR_TIMER1=(int)Timer1_inter;  // added timer1 interrupt vector here will be moved to another place ZHAO mingfei 2008.1.16
	rINTMOD&=~0x800;  //IRQ mode
	rINTMSK&=~0X800;  //Eable timer1 interrupt
}
__irq void Timer1_inter()
{
   OSTimeTick();
}

⌨️ 快捷键说明

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