/***************************************************************
	timer.h
    (C) 2013 Suwa-Koubou
***************************************************************/

#ifndef	_TIMER_H
#define	_TIMER_H

#include <xc.h>

#define lock_timer()    IEC0CLR=_IEC0_T1IE_MASK   
#define unlock_timer()  IEC0SET=_IEC0_T1IE_MASK

#define MAX_TIMER       10

void    timer_init(void);
int     timer_entry(unsigned int tm_val);
void 	timer_update(int tm_id, unsigned int tm_val);
void 	timer_delete(int tm_id);
int 	timer_check(int tm_id);
int 	timer_Up(int tm_id);
unsigned int gettick(void);

#endif
/*** end of timer.h ******************************************/
