mirror of
https://github.com/drasko/codezero.git
synced 2026-01-14 20:03:16 +01:00
Timer service enhanced for sleep
This commit is contained in:
@@ -56,10 +56,6 @@
|
||||
#define SP804_TIMERMIS 0x14
|
||||
#define SP804_TIMERBGLOAD 0x18
|
||||
|
||||
struct sp804_timer {
|
||||
unsigned int base;
|
||||
};
|
||||
|
||||
void sp804_init(unsigned int timer_base, int runmode, int wrapmode, \
|
||||
int width, int irq_enable);
|
||||
void sp804_irq_handler(unsigned int timer_base);
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#define setbit(bit, a) write(read(a) | bit, a)
|
||||
#define clrbit(bit, a) write(read(a) & ~bit, a)
|
||||
|
||||
extern void timer_irq_handler(void);
|
||||
|
||||
void sp804_irq_handler(unsigned int timer_base)
|
||||
{
|
||||
/*
|
||||
@@ -17,6 +19,7 @@ void sp804_irq_handler(unsigned int timer_base)
|
||||
* as it automatically reloads and wraps
|
||||
*/
|
||||
write(1, (timer_base + SP804_TIMERINTCLR));
|
||||
timer_irq_handler();
|
||||
}
|
||||
|
||||
static inline void sp804_control(unsigned int timer_base, int bit, int setclr)
|
||||
|
||||
Reference in New Issue
Block a user