diff options
-rw-r--r-- | chip/ish/hwtimer.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chip/ish/hwtimer.c b/chip/ish/hwtimer.c index 6cd4f854bf..d3d78cadd6 100644 --- a/chip/ish/hwtimer.c +++ b/chip/ish/hwtimer.c @@ -191,6 +191,12 @@ uint32_t __hw_clock_event_get(void) void __hw_clock_event_clear(void) { + /* + * we get timer event at every new clksrc_high. + * so when there's no event, last_dealine should be + * the last value within current clksrc_high. + */ + last_deadline = 0xFFFFFFFF; wait_while_settling(HPET_T1_SETTLING); HPET_TIMER_CONF_CAP(1) &= ~HPET_Tn_INT_ENB_CNF; } @@ -281,6 +287,9 @@ int __hw_clock_source_init(uint32_t start_t) timer0_config |= HPET_Tn_INT_TYPE_CNF; timer1_config |= HPET_Tn_INT_TYPE_CNF; + /* no event until next timer 0 IRQ for clksrc_high++ */ + last_deadline = 0xFFFFFFFF; + /* Enable interrupt */ timer0_config |= HPET_Tn_INT_ENB_CNF; |