Pārlūkot izejas kodu

Updating Debug Modules to new abstracted hierarchy

- Also added some extra CMake build messages for indicating the Compiler family and chip being built for
simple
Jacob Alexander pirms 11 gadiem
vecāks
revīzija
a31f0e064a
6 mainītis faili ar 52 papildinājumiem un 9 dzēšanām
  1. 3
    0
      CMakeLists.txt
  2. 33
    1
      Debug/led/led.c
  3. 1
    4
      Debug/led/led.h
  4. 6
    4
      Debug/print/print.h
  5. 6
    0
      arm.cmake
  6. 3
    0
      avr.cmake

+ 3
- 0
CMakeLists.txt Parādīt failu

#set( COMPILER_FAMILY "arm" ) #set( COMPILER_FAMILY "arm" )
set( COMPILER_FAMILY "avr" ) set( COMPILER_FAMILY "avr" )


message( STATUS "Compiler Family:" )
message( "${COMPILER_FAMILY}" )





#| Load the compiler family specific configurations #| Load the compiler family specific configurations

+ 33
- 1
Debug/led/led.c Parādīt failu



// ----- Includes ----- // ----- Includes -----


// AVR Includes
// Compiler Includes
#include <Lib/MainLib.h>



// Project Includes // Project Includes
#include "led.h" #include "led.h"
// Error LED Setup // Error LED Setup
inline void init_errorLED() inline void init_errorLED()
{ {
// AVR
#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_)

// Use pin D6 as an output (LED) // Use pin D6 as an output (LED)
DDRD |= (1<<6); 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 // Error LED Control
inline void errorLED( uint8_t on ) inline void errorLED( uint8_t on )
{ {
// AVR
#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_)

// Error LED On (D6) // Error LED On (D6)
if ( on ) { if ( on ) {
PORTD |= (1<<6); PORTD |= (1<<6);
else { else {
PORTD &= ~(1<<6); 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
} }



+ 1
- 4
Debug/led/led.h Parādīt failu

/* 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal


// ----- Includes ----- // ----- Includes -----


// AVR Includes
#include <avr/io.h>





// ----- Functions ----- // ----- Functions -----

+ 6
- 4
Debug/print/print.h Parādīt failu



// ----- Includes ----- // ----- Includes -----


// AVR Includes
#include <avr/pgmspace.h>

// USB Includes
// Compiler Includes
#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) #if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_)

#include <avr/pgmspace.h>
#include "avr/usb_keyboard_debug.h" #include "avr/usb_keyboard_debug.h"

#elif defined(_mk20dx128_) #elif defined(_mk20dx128_)

#include "arm/usb_keyboard.h" #include "arm/usb_keyboard.h"

#endif #endif





+ 6
- 0
arm.cmake Parādīt failu

#| "mk20dx128" # Teensy 3.0 #| "mk20dx128" # Teensy 3.0
set( CHIP "mk20dx128" ) set( CHIP "mk20dx128" )


message( STATUS "Chip Selected:" )
message( "${CHIP}" )



#| CPU Type #| CPU Type
#| You _MUST_ set this to match the board you are using #| You _MUST_ set this to match the board you are using
#| "cortex-m4" # Teensy 3.0 #| "cortex-m4" # Teensy 3.0
set( CPU "cortex-m4" ) set( CPU "cortex-m4" )


message( STATUS "CPU Selected:" )
message( "${CPU}" )



#| Extra Compiler Sources #| Extra Compiler Sources
#| Mostly for convenience functions like interrupt handlers #| Mostly for convenience functions like interrupt handlers

+ 3
- 0
avr.cmake Parādīt failu

#set( MCU "atmega32u4" ) #set( MCU "atmega32u4" )
set( MCU "at90usb1286" ) set( MCU "at90usb1286" )


message( STATUS "MCU Selected:" )
message( "${MCU}" )



#| Extra Compiler Sources #| Extra Compiler Sources
#| Mostly for convenience functions like interrupt handlers #| Mostly for convenience functions like interrupt handlers