seems to me the easiest way to restore correct function for "ticks" when the post scaler is in use is to move the ticks loop inside the post scale loop , no extra vars no extra overhead
Code:ClockCount: @ RELOAD_TIMER ; Reload TIMER1 T1Post = T1Post + 1 IF T1Post = T1PS THEN T1Post = 0 Ticks = Ticks + 1 IF Ticks = 100 THEN Ticks = 0 Seconds = Seconds + 1 SecondsChanged = 1 IF Seconds = 60 THEN Seconds = 0 Minutes = Minutes + 1 MinutesChanged = 1 ENDIF IF Minutes = 60 THEN Minutes = 0 Hours = Hours + 1 HoursChanged = 1 ENDIF IF Hours = 24 THEN Days = Days + 1 DaysChanged = 1 Hours = 0 ENDIF ENDIF ENDIF @ INT_RETURN ; Restore context and return from interrupt




Bookmarks