Added 128x32 support
[hackover2013-badge-firmware.git] / sysinit.c
index 60b4d3b..4ce74dd 100644 (file)
--- a/sysinit.c
+++ b/sysinit.c
@@ -124,12 +124,18 @@ 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);
   gpioSetValue(CFG_LED_PORT, CFG_LED_PIN, CFG_LED_OFF);
 
+  // Config alt reset pin if requested (really only relevant to LPC1343 LCD Board)
+  #ifdef CFG_ALTRESET
+    gpioSetDir (CFG_ALTRESET_PORT, CFG_ALTRESET_PIN, gpioDirection_Input);
+    gpioSetInterrupt (CFG_ALTRESET_PORT, CFG_ALTRESET_PIN, gpioInterruptSense_Level, gpioInterruptEdge_Single, gpioInterruptEvent_ActiveHigh);
+    gpioIntEnable (CFG_ALTRESET_PORT, CFG_ALTRESET_PIN); 
+  #endif
+
   // Initialise EEPROM
   #ifdef CFG_I2CEEPROM
     mcp24aaInit();
@@ -137,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)
This page took 0.020605 seconds and 4 git commands to generate.