diff options
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -5,6 +5,7 @@ #include <util/delay.h> #include "fpm.h" +#include "uart.h" #define SERVO_PIN PB1 #define SERVO_DDR DDRB @@ -95,21 +96,12 @@ int main(void) WDTCSR |= (1 << WDCE) | (1 << WDE); WDTCSR = 0x00; - /* power on peripherals */ + uart_init(); + + /* power on the FPM and the servo */ PWR_DDR |= (1 << PWR_FPM) | (1 << PWR_SERVO); pwr_fpm_servo_on(); - /* UART for FPM */ - UBRR0H = UBRRH_VALUE; - UBRR0L = UBRRL_VALUE; -#if USE_2X - UCSR0A |= (1 << U2X0); -#else - UCSR0A &= ~(1 << U2X0); -#endif - UCSR0B = (1 << TXEN0) | (1 << RXEN0); - UCSR0C = (1 << UCSZ01) | (1 << UCSZ00); - /* servo */ TCCR1A |= (1 << WGM11); TCCR1B |= (1 << WGM12) | (1 << WGM13); |
