Rev 142 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 142 | Rev 208 | ||
|---|---|---|---|
| Line 22... | Line 22... | ||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | /*----------------------------------------------------------------------------- |
24 | /*----------------------------------------------------------------------------- |
| 25 | * Public Functions |
25 | * Public Functions |
| 26 | *---------------------------------------------------------------------------*/ |
26 | *---------------------------------------------------------------------------*/ |
| - | 27 | ||
| - | 28 | /** |
|
| - | 29 | * Initialize MCU. If the MCU is mega88, the internal clock frequency will be |
|
| - | 30 | * set to 8MHz. Interrupts must not be enabled when calling this function! |
|
| - | 31 | */ |
|
| - | 32 | void Mcu_Init() { |
|
| - | 33 | #if defined(__AVR_ATmega88__) |
|
| - | 34 | // set the clock speed to 8MHz |
|
| - | 35 | // set the clock prescaler. First write CLKPCE to enable setting of clock the |
|
| - | 36 | // next four instructions. |
|
| - | 37 | CLKPR=(1<<CLKPCE); |
|
| - | 38 | CLKPR=0; // 8 MHZ |
|
| - | 39 | #endif |
|
| - | 40 | } |
|
| 27 | 41 | ||
| 28 | /** |
42 | /** |
| 29 | * Enable interrupts. |
43 | * Enable interrupts. |
| 30 | */ |
44 | */ |
| 31 | void Mcu_EnableIRQ() { |
45 | void Mcu_EnableIRQ() { |