Rev 247 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 247 | Rev 381 | ||
|---|---|---|---|
| Line 13... | Line 13... | ||
| 13 | *---------------------------------------------------------------------------*/ |
13 | *---------------------------------------------------------------------------*/ |
| 14 | /* Enable timer2 if you want to use as many PWM outputs as possible */ |
14 | /* Enable timer2 if you want to use as many PWM outputs as possible */ |
| 15 | #define TIMER2 |
15 | #define TIMER2 |
| 16 | 16 | ||
| 17 | #define TIMEBASE_PRESCALE (64) |
17 | #define TIMEBASE_PRESCALE (64) |
| 18 | #define TIMEBASE_HITS_PER_1MS ( |
18 | #define TIMEBASE_HITS_PER_1MS (F_CPU/TIMEBASE_PRESCALE/1000) |
| 19 | 19 | ||
| 20 | #if TIMEBASE_HITS_PER_1MS > 255 |
20 | #if TIMEBASE_HITS_PER_1MS > 255 |
| 21 | #undef TIMEBASE_PRESCALE |
21 | #undef TIMEBASE_PRESCALE |
| 22 | #define TIMEBASE_PRESCALE (256) |
22 | #define TIMEBASE_PRESCALE (256) |
| 23 | #undef TIMEBASE_HITS_PER_1MS |
23 | #undef TIMEBASE_HITS_PER_1MS |
| 24 | #define TIMEBASE_HITS_PER_1MS ( |
24 | #define TIMEBASE_HITS_PER_1MS (F_CPU/TIMEBASE_PRESCALE/1000) // behöver denna definieras om ifall prescalern definierats om? |
| 25 | #endif |
25 | #endif |
| 26 | 26 | ||
| 27 | #define TIMEBASE_RELOAD ((uint8_t)(0xff-TIMEBASE_HITS_PER_1MS+1)) |
27 | #define TIMEBASE_RELOAD ((uint8_t)(0xff-TIMEBASE_HITS_PER_1MS+1)) |
| 28 | 28 | ||
| 29 | 29 | ||