forked from len0rd/rockbox
Coldfire: New timer handling on CPU frequency change, adjusting the prescaler on the fly, for both tick and user timer. Precondition is that the higher frequencies are integer multiples of the base: now NORMAL is 45 MHz and MAX is 124 MHz. Removes the need for applications with longer timer periods (>= 10 ms) to boost the CPU all the time, e.g. the grayscale lib. Timer counts are now always based on the base frequency (CPU_FREQ). * Adjusted the RAM refresh timers to the new frequencies (all frequencies for H100) * All: Fixed the tick timer count being off by one.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7576 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7190cf2ed9
commit
cfb073c452
10 changed files with 98 additions and 59 deletions
|
@ -226,38 +226,23 @@ void gray_release(void)
|
|||
lcd_set_invert_display(), lcd_set_flip(), lcd_roll() */
|
||||
void gray_show(bool enable)
|
||||
{
|
||||
#if (CONFIG_CPU == SH7034) && (CONFIG_LCD == LCD_SSD1815)
|
||||
if (enable)
|
||||
{
|
||||
_gray_info.flags |= _GRAY_RUNNING;
|
||||
_gray_rb->timer_register(1, NULL, FREQ / 67, 1, _timer_isr);
|
||||
_gray_rb->screen_dump_set_hook(gray_screendump_hook);
|
||||
}
|
||||
else
|
||||
{
|
||||
_gray_rb->timer_unregister();
|
||||
_gray_info.flags &= ~_GRAY_RUNNING;
|
||||
_gray_rb->screen_dump_set_hook(NULL);
|
||||
_gray_rb->lcd_update(); /* restore whatever there was before */
|
||||
}
|
||||
#elif defined(CPU_COLDFIRE) && (CONFIG_LCD == LCD_S1D15E06)
|
||||
if (enable && !(_gray_info.flags & _GRAY_RUNNING))
|
||||
{
|
||||
_gray_info.flags |= _GRAY_RUNNING;
|
||||
_gray_rb->cpu_boost(true); /* run at 120 MHz to avoid freq changes */
|
||||
_gray_rb->timer_register(1, NULL, *_gray_rb->cpu_frequency / 70, 1,
|
||||
_timer_isr);
|
||||
#if CONFIG_LCD == LCD_SSD1815
|
||||
_gray_rb->timer_register(1, NULL, CPU_FREQ / 67, 1, _timer_isr);
|
||||
#elif CONFIG_LCD == LCD_S1D15E06
|
||||
_gray_rb->timer_register(1, NULL, CPU_FREQ / 70, 1, _timer_isr);
|
||||
#endif
|
||||
_gray_rb->screen_dump_set_hook(gray_screendump_hook);
|
||||
}
|
||||
else if (!enable && (_gray_info.flags & _GRAY_RUNNING))
|
||||
{
|
||||
_gray_rb->timer_unregister();
|
||||
_gray_rb->cpu_boost(false);
|
||||
_gray_info.flags &= ~_GRAY_RUNNING;
|
||||
_gray_rb->screen_dump_set_hook(NULL);
|
||||
_gray_rb->lcd_update(); /* restore whatever there was before */
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Update a rectangular area of the greyscale overlay */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue