time5.c

来自「CH375移植到S3C44B0」· C语言 代码 · 共 53 行

C
53
字号
/* ARM board targetting source file.
   file name: uhal.c
   date: 2001. 2. 14
   made by cho dong-seok
   homepage: www.pusanssm.com/~cthr36/
*/

#include <stdarg.h>
#include <string.h>
#include "../inc/44b.h"



//Initialize timer that is used OS.
void uHALr_InitTimers(void)
{
	rTCFG0=0x00040000;		// prescaler0 = 4
	rTCFG1=0x00300000;		// mux5 = 1/16

	rTCNTB5= 1000;//_CLOCK;
	rTCON=0x2<<24;		//update mode for TCNTB0 and TCMPB0.
	rTCON=0x5<<24;		//timer0 = auto reload, start
}//uHALr_InitTimers


extern void __Tick(void);

void InstallSystemTimer(void)
{
	//Non-vectored,IRQ enable,FIQ disable 
	pISR_TIMER5= (unsigned)__Tick;
        rINTCON=0x5;

	//Non maksed TIMER0 .
	rINTMSK=~(BIT_TIMER5 | BIT_GLOBAL);	//Default value=0x7ffffff
}
                             /* targetInit */
//Initialze interrupts.
void InitInterrupts(void)
{
    //ARMDisableInt();
	
	// Non-vectored,IRQ disable,FIQ disable    
    rINTCON=0x0;	  

	// All=IRQ mode
    rINTMOD=0x0;	  

	// All interrupt is masked.
    uHALr_InitTimers();
    rINTMSK=BIT_GLOBAL;	
}//uHALr_InitInterrupts

⌨️ 快捷键说明

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