Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1030 | - | 1 | #ifndef _MEGAxx4_H_ |
2 | #define _MEGAxx4_H_ |
||
3 | |||
4 | #ifndef UART_USE_SECOND |
||
5 | /* UART 0 */ |
||
6 | #define UART_BAUD_HIGH UBRR0H |
||
7 | #define UART_BAUD_LOW UBRR0L |
||
8 | #define UART_STATUS UCSR0A |
||
9 | #define UART_TXREADY UDRE0 |
||
10 | #define UART_RXREADY RXC0 |
||
11 | #define UART_DOUBLE U2X0 |
||
12 | #define UART_CTRL UCSR0B |
||
13 | #define UART_CTRL_DATA ((1<<TXEN0) | (1<<RXEN0)) |
||
14 | #define UART_CTRL2 UCSR0C |
||
15 | #define UART_CTRL2_DATA ( (1<<UCSZ01) | (1<<UCSZ00)) |
||
16 | #define UART_DATA UDR0 |
||
17 | #else |
||
18 | /* UART 1 */ |
||
19 | #define UART_BAUD_HIGH UBRR1H |
||
20 | #define UART_BAUD_LOW UBRR1L |
||
21 | #define UART_STATUS UCSR1A |
||
22 | #define UART_TXREADY UDRE1 |
||
23 | #define UART_RXREADY RXC1 |
||
24 | #define UART_DOUBLE U2X1 |
||
25 | #define UART_CTRL UCSR1B |
||
26 | #define UART_CTRL_DATA ((1<<TXEN1) | (1<<RXEN1)) |
||
27 | #define UART_CTRL2 UCSR1C |
||
28 | #define UART_CTRL2_DATA ( (1<<UCSZ11) | (1<<UCSZ10)) |
||
29 | #define UART_DATA UDR1 |
||
30 | #endif |
||
31 | |||
32 | #define WDT_OFF_SPECIAL |
||
33 | |||
34 | static inline void bootloader_wdt_off(void) |
||
35 | { |
||
36 | cli(); |
||
37 | wdt_reset(); |
||
38 | /* Clear WDRF in MCUSR */ |
||
39 | MCUSR &= ~(1<<WDRF); |
||
40 | /* Write logical one to WDCE and WDE */ |
||
41 | /* Keep old prescaler setting to prevent unintentional time-out */ |
||
42 | WDTCSR |= (1<<WDCE) | (1<<WDE); |
||
43 | /* Turn off WDT */ |
||
44 | WDTCSR = 0x00; |
||
45 | } |
||
46 | |||
47 | #endif // #ifndef _MEGA644_H_ |