]> git.donarmstrong.com Git - kiibohd-controller.git/commitdiff
Updating Debug Modules to new abstracted hierarchy
authorJacob Alexander <triplehaata@gmail.com>
Sat, 26 Jan 2013 20:43:59 +0000 (15:43 -0500)
committerJacob Alexander <triplehaata@gmail.com>
Sat, 26 Jan 2013 20:43:59 +0000 (15:43 -0500)
- Also added some extra CMake build messages for indicating the Compiler family and chip being built for

CMakeLists.txt
Debug/led/led.c
Debug/led/led.h
Debug/print/print.h
arm.cmake
avr.cmake

index 8f51c8accbf572abbf2b554b469cdb5e02f6cc38..e1f2e4ba7b1e1e7f5f2fec3f75f26d8b50c6910a 100644 (file)
@@ -30,6 +30,9 @@ include( AddFileDependencies )
 #set( COMPILER_FAMILY "arm" )
 set( COMPILER_FAMILY "avr" )
 
+message( STATUS "Compiler Family:" )
+message( "${COMPILER_FAMILY}" )
+
 
 
 #| Load the compiler family specific configurations
index 3b2dd914717fc76b73777a845cb84719eaca595e..e8a28cc0771d17c19ec2452782420ceb16f41802 100644 (file)
@@ -21,7 +21,9 @@
 
 // ----- Includes -----
 
-// AVR Includes
+// Compiler Includes
+#include <Lib/MainLib.h>
+
 
 // Project Includes
 #include "led.h"
 // Error LED Setup
 inline void init_errorLED()
 {
+// AVR
+#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_)
+
        // Use pin D6 as an output (LED)
        DDRD |= (1<<6);
+
+// ARM
+#elif defined(_mk20dx128_)
+
+       // Setup pin - Pin 11 -> C5 - See Lib/pin_map.teensy3 for more details on pins
+       PORTC_PCR5 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
+       // Enable pin
+       GPIO_BITBAND_MODREG( GPIOC_PDOR, 5 ) = 1;
+
+#endif
 }
 
 // Error LED Control
 inline void errorLED( uint8_t on )
 {
+// AVR
+#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_)
+
        // Error LED On (D6)
        if ( on ) {
                PORTD |= (1<<6);
@@ -48,5 +66,19 @@ inline void errorLED( uint8_t on )
        else {
                PORTD &= ~(1<<6);
        }
+
+// ARM
+#elif defined(_mk20dx128_)
+
+       // Error LED On (C5)
+       if ( on ) {
+               GPIOC_PSOR |= (1<<5);
+       }
+       // Error LED Off
+       else {
+               GPIOC_PCOR |= (1<<5);
+       }
+
+#endif
 }
 
index 48337335164bc41fb7a391b7ef7a2b252324ae23..107fbc361b331aab07ec5b986e3561353e439e12 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 by Jacob Alexander
+/* Copyright (C) 2011-2013 by Jacob Alexander
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,6 @@
 
 // ----- Includes -----
 
-// AVR Includes
-#include <avr/io.h>
-
 
 
 // ----- Functions -----
index 73744a35ce1f5fabdfb7d6da6b3cd602e93055ef..e5ba872f991540cbe4e557ec5c50d7e199894358 100644 (file)
 
 // ----- Includes -----
 
-// AVR Includes
-#include <avr/pgmspace.h>
-
-// USB Includes
+// Compiler Includes
 #if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_)
+
+#include <avr/pgmspace.h>
 #include "avr/usb_keyboard_debug.h"
+
 #elif defined(_mk20dx128_)
+
 #include "arm/usb_keyboard.h"
+
 #endif
 
 
index e5469b0e13dc74b361fae22c88aa9f5897d4aab8..176d906f3d89600752aa3ccfe9a352065b7d6ce2 100644 (file)
--- a/arm.cmake
+++ b/arm.cmake
@@ -36,6 +36,9 @@ set( SIZE    "arm-none-eabi-size"    )
 #| "mk20dx128"        # Teensy   3.0
 set( CHIP "mk20dx128" )
 
+message( STATUS "Chip Selected:" )
+message( "${CHIP}" )
+
 
 #| CPU Type
 #| You _MUST_ set this to match the board you are using
@@ -44,6 +47,9 @@ set( CHIP "mk20dx128" )
 #| "cortex-m4"        # Teensy   3.0
 set( CPU "cortex-m4" )
 
+message( STATUS "CPU Selected:" )
+message( "${CPU}" )
+
 
 #| Extra Compiler Sources
 #| Mostly for convenience functions like interrupt handlers
index 1c508031a1a8bcc4db4f4e4bc870de78e47202fc..43e1880aee71496ac625fded6738705f84032130 100644 (file)
--- a/avr.cmake
+++ b/avr.cmake
@@ -40,6 +40,9 @@ set( SIZE    "avr-size"    )
 #set( MCU "atmega32u4" )
 set( MCU "at90usb1286" )
 
+message( STATUS "MCU Selected:" )
+message( "${MCU}" )
+
 
 #| Extra Compiler Sources
 #| Mostly for convenience functions like interrupt handlers