X-Git-Url: http://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/d537298fdd7d39e4cb0e74e8e6d227245d638afe..9f4d9c8e095ee37b411008e81e6a12e7c20cb9c5:/sysinit.c diff --git a/sysinit.c b/sysinit.c index 80d2f5c..a3834b6 100644 --- a/sysinit.c +++ b/sysinit.c @@ -124,7 +124,6 @@ void systemInit() systickInit(CFG_SYSTICK_DELAY_IN_MS); // Start systick timer gpioInit(); // Enable GPIO pmuInit(); // Configure power management - adcInit(); // Config adc pins to save power // Set LED pin as output and turn LED off gpioSetDir(CFG_LED_PORT, CFG_LED_PIN, 1); @@ -144,15 +143,19 @@ void systemInit() // Initialise UART with the default baud rate #ifdef CFG_PRINTF_UART - uint32_t uart = eepromReadU32(CFG_EEPROM_UART_SPEED); - if ((uart == 0xFFFFFFFF) || (uart > 115200)) - { - uartInit(CFG_UART_BAUDRATE); // Use default baud rate - } - else - { - uartInit(uart); // Use baud rate from EEPROM - } + #ifdef CFG_I2CEEPROM + uint32_t uart = eepromReadU32(CFG_EEPROM_UART_SPEED); + if ((uart == 0xFFFFFFFF) || (uart > 115200)) + { + uartInit(CFG_UART_BAUDRATE); // Use default baud rate + } + else + { + uartInit(uart); // Use baud rate from EEPROM + } + #else + uartInit(CFG_UART_BAUDRATE); + #endif #endif // Initialise PWM (requires 16-bit Timer 1 and P1.9) @@ -192,7 +195,7 @@ void systemInit() // Initialise the SSD1306 OLED display #ifdef CFG_SSD1306 - ssd1306Init(SSD1306_SWITCHCAPVCC); + ssd1306Init(SSD1306_INTERNALVCC); ssd1306ClearScreen(); // Clear the screen #endif