freemyipod r638 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r637‎ | r638 | r639 >
Date:19:12, 21 February 2011
Author:theseven
Status:new
Tags:
Comment:
emCORE: Fix iPod Classic timer constants
Modified paths:
  • /emcore/trunk/target/ipodnano3g/timer.c (modified) (history)

Diff [purge]

Index: emcore/trunk/target/ipodnano3g/timer.c
@@ -39,20 +39,20 @@
4040
4141 void timer_schedule_wakeup(uint32_t usecs)
4242 {
43 - if (usecs > 9942053)
 43+ if (usecs > 28256363)
4444 {
4545 TBPRE = 511;
4646 TBDATA1 = 65535;
4747 }
48 - else if (usecs > 19417)
 48+ else if (usecs > 55188)
4949 {
5050 TBPRE = 511;
51 - TBDATA1 = (usecs * 216) >> 15;
 51+ TBDATA1 = (usecs * 152) >> 16;
5252 }
5353 else
5454 {
5555 TBPRE = 0;
56 - TBDATA1 = (usecs * 216) >> 6;
 56+ TBDATA1 = (usecs * 152) >> 7;
5757 }
5858 TBCON = (1 << 13) | /* TB_INT1_EN */
5959 (0 << 12) | /* TB_INT0_EN */