diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ce0210..177ee14 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,7 @@ set( SRCS ${COMPILER_SRCS} ${SCAN_SRCS} ${MACRO_SRCS} - ${USB_SRCS} + ${OUTPUT_SRCS} ${DEBUG_SRCS} ) @@ -84,10 +84,10 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) # #| Check for whether the set modules are compatible with the specified compiler family -ModuleCompatibility( ${ScanModulePath} ${ScanModuleCompatibility} ) -ModuleCompatibility( ${MacroModulePath} ${MacroModuleCompatibility} ) -ModuleCompatibility( ${USBModulePath} ${USBModuleCompatibility} ) -ModuleCompatibility( ${DebugModulePath} ${DebugModuleCompatibility} ) +ModuleCompatibility( ${ScanModulePath} ${ScanModuleCompatibility} ) +ModuleCompatibility( ${MacroModulePath} ${MacroModuleCompatibility} ) +ModuleCompatibility( ${OutputModulePath} ${OutputModuleCompatibility} ) +ModuleCompatibility( ${DebugModulePath} ${DebugModuleCompatibility} ) diff --git a/Debug/cli/cli.c b/Debug/cli/cli.c new file mode 100644 index 0000000..0e81893 --- /dev/null +++ b/Debug/cli/cli.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2014 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// ----- Includes ----- + +// Compiler Includes +//#include + +// Project Includes +#include "cli.h" + + + +// ----- Functions ----- + +void initCLI() +{ +} + diff --git a/Debug/cli/cli.h b/Debug/cli/cli.h new file mode 100644 index 0000000..50f7a3b --- /dev/null +++ b/Debug/cli/cli.h @@ -0,0 +1,49 @@ +/* Copyright (C) 2014 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef cli_h__ +#define cli_h__ + +// ----- Includes ----- + +// Compiler Includes +#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) + +#elif defined(_mk20dx128_) + +#include "arm/usb_serial.h" + +#endif + + + +// ----- Defines ----- + + + +// ----- Functions and Corresponding Function Aliases ----- + +void initCLI(); + + + +#endif + diff --git a/Debug/cli/setup.cmake b/Debug/cli/setup.cmake new file mode 100644 index 0000000..82ec440 --- /dev/null +++ b/Debug/cli/setup.cmake @@ -0,0 +1,42 @@ +###| CMake Kiibohd Controller Debug Module |### +# +# Written by Jacob Alexander in 2014 for the Kiibohd Controller +# +# Released into the Public Domain +# +### + + +### +# Module C files +# + +set( DEBUG_SRCS + cli.c +) + + +### +# Setup File Dependencies +# + + +### +# Module Specific Options +# + + +### +# Just in case, you only want this module and are using others as well +# +add_definitions( -I${HEAD_DIR}/Debug/off ) + + +### +# Compiler Family Compatibility +# +set( DebugModuleCompatibility + arm + avr +) + diff --git a/Debug/full/setup.cmake b/Debug/full/setup.cmake index a270941..ab280ff 100644 --- a/Debug/full/setup.cmake +++ b/Debug/full/setup.cmake @@ -1,6 +1,6 @@ ###| CMake Kiibohd Controller Debug Module |### # -# Written by Jacob Alexander in 2011 for the Kiibohd Controller +# Written by Jacob Alexander in 2011-2014 for the Kiibohd Controller # # Released into the Public Domain # @@ -13,6 +13,7 @@ #| XXX Requires the ../ due to how the paths are constructed set( DEBUG_SRCS + ../cli/cli.c ../led/led.c ../print/print.c ) @@ -22,13 +23,14 @@ set( DEBUG_SRCS # Setup File Dependencies # add_file_dependencies( ../led/led.c ../led/led.h ) -add_file_dependencies( ../led/print.c ../led/print.h ) +add_file_dependencies( ../print/print.c ../print/print.h ) ### # Module Specific Options # add_definitions( + -I${HEAD_DIR}/Debug/cli -I${HEAD_DIR}/Debug/led -I${HEAD_DIR}/Debug/print ) diff --git a/Debug/print/print.c b/Debug/print/print.c index 7c4f2ed..bb97d3f 100644 --- a/Debug/print/print.c +++ b/Debug/print/print.c @@ -1,15 +1,15 @@ /* 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 * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/Debug/print/print.h b/Debug/print/print.h index 7b87004..18fad6d 100644 --- a/Debug/print/print.h +++ b/Debug/print/print.h @@ -1,15 +1,15 @@ /* 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 * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/USB/pjrc/arm/usb_desc.c b/Output/pjrcUSB/arm/usb_desc.c similarity index 100% rename from USB/pjrc/arm/usb_desc.c rename to Output/pjrcUSB/arm/usb_desc.c diff --git a/USB/pjrc/arm/usb_desc.h b/Output/pjrcUSB/arm/usb_desc.h similarity index 100% rename from USB/pjrc/arm/usb_desc.h rename to Output/pjrcUSB/arm/usb_desc.h diff --git a/USB/pjrc/arm/usb_dev.c b/Output/pjrcUSB/arm/usb_dev.c similarity index 100% rename from USB/pjrc/arm/usb_dev.c rename to Output/pjrcUSB/arm/usb_dev.c diff --git a/USB/pjrc/arm/usb_dev.h b/Output/pjrcUSB/arm/usb_dev.h similarity index 100% rename from USB/pjrc/arm/usb_dev.h rename to Output/pjrcUSB/arm/usb_dev.h diff --git a/USB/pjrc/arm/usb_keyboard.c b/Output/pjrcUSB/arm/usb_keyboard.c similarity index 100% rename from USB/pjrc/arm/usb_keyboard.c rename to Output/pjrcUSB/arm/usb_keyboard.c diff --git a/USB/pjrc/arm/usb_keyboard.h b/Output/pjrcUSB/arm/usb_keyboard.h similarity index 100% rename from USB/pjrc/arm/usb_keyboard.h rename to Output/pjrcUSB/arm/usb_keyboard.h diff --git a/USB/pjrc/arm/usb_mem.c b/Output/pjrcUSB/arm/usb_mem.c similarity index 100% rename from USB/pjrc/arm/usb_mem.c rename to Output/pjrcUSB/arm/usb_mem.c diff --git a/USB/pjrc/arm/usb_mem.h b/Output/pjrcUSB/arm/usb_mem.h similarity index 100% rename from USB/pjrc/arm/usb_mem.h rename to Output/pjrcUSB/arm/usb_mem.h diff --git a/USB/pjrc/arm/usb_serial.c b/Output/pjrcUSB/arm/usb_serial.c similarity index 100% rename from USB/pjrc/arm/usb_serial.c rename to Output/pjrcUSB/arm/usb_serial.c diff --git a/USB/pjrc/arm/usb_serial.h b/Output/pjrcUSB/arm/usb_serial.h similarity index 100% rename from USB/pjrc/arm/usb_serial.h rename to Output/pjrcUSB/arm/usb_serial.h diff --git a/USB/pjrc/avr/usb_keyboard_debug.c b/Output/pjrcUSB/avr/usb_keyboard_debug.c similarity index 100% rename from USB/pjrc/avr/usb_keyboard_debug.c rename to Output/pjrcUSB/avr/usb_keyboard_debug.c diff --git a/USB/pjrc/avr/usb_keyboard_debug.h b/Output/pjrcUSB/avr/usb_keyboard_debug.h similarity index 100% rename from USB/pjrc/avr/usb_keyboard_debug.h rename to Output/pjrcUSB/avr/usb_keyboard_debug.h diff --git a/USB/pjrc/usb_com.c b/Output/pjrcUSB/output_com.c similarity index 99% rename from USB/pjrc/usb_com.c rename to Output/pjrcUSB/output_com.c index dad641d..96fb0f7 100644 --- a/USB/pjrc/usb_com.c +++ b/Output/pjrcUSB/output_com.c @@ -36,7 +36,7 @@ #endif // Local Includes -#include "usb_com.h" +#include "output_com.h" diff --git a/USB/pjrc/usb_com.h b/Output/pjrcUSB/output_com.h similarity index 97% rename from USB/pjrc/usb_com.h rename to Output/pjrcUSB/output_com.h index f62e90c..07f81f5 100644 --- a/USB/pjrc/usb_com.h +++ b/Output/pjrcUSB/output_com.h @@ -19,8 +19,8 @@ * THE SOFTWARE. */ -#ifndef __usb_com_h -#define __usb_com_h +#ifndef __output_com_h +#define __output_com_h // ----- Includes ----- diff --git a/USB/pjrc/setup.cmake b/Output/pjrcUSB/setup.cmake similarity index 85% rename from USB/pjrc/setup.cmake rename to Output/pjrcUSB/setup.cmake index b1be1d4..157dfc2 100644 --- a/USB/pjrc/setup.cmake +++ b/Output/pjrcUSB/setup.cmake @@ -15,16 +15,16 @@ #| AVR Compiler if ( ${COMPILER_FAMILY} MATCHES "avr" ) - set( USB_SRCS - usb_com.c + set( OUTPUT_SRCS + output_com.c avr/usb_keyboard_debug.c ) #| ARM Compiler elseif ( ${COMPILER_FAMILY} MATCHES "arm" ) - set( USB_SRCS - usb_com.c + set( OUTPUT_SRCS + output_com.c arm/usb_desc.c arm/usb_dev.c arm/usb_keyboard.c @@ -42,7 +42,7 @@ endif ( ${COMPILER_FAMILY} MATCHES "avr" ) ### # Compiler Family Compatibility # -set( USBModuleCompatibility +set( OutputModuleCompatibility arm avr ) diff --git a/setup.cmake b/setup.cmake index aad3690..8041b08 100644 --- a/setup.cmake +++ b/setup.cmake @@ -26,10 +26,10 @@ set( ScanModule "MBC-55X" ) set( MacroModule "buffer" ) ##| Sends the current list of usb key codes through USB HID -set( USBModule "pjrc" ) +set( OutputModule "pjrcUSB" ) ##| Debugging source to use, each module has it's own set of defines that it sets -set( DebugModule "full" ) +set( DebugModule "full" ) @@ -45,11 +45,12 @@ endif () ### # Path Setup -# -set( ScanModulePath "Scan/${ScanModule}" ) -set( MacroModulePath "Macro/${MacroModule}" ) -set( USBModulePath "USB/${USBModule}" ) -set( DebugModulePath "Debug/${DebugModule}" ) +# +set( ScanModulePath "Scan/${ScanModule}" ) +set( MacroModulePath "Macro/${MacroModule}" ) +set( OutputModulePath "Output/${OutputModule}" ) +set( USBModulePath "USB/${USBModule}" ) +set( DebugModulePath "Debug/${DebugModule}" ) #| Top-level directory adjustment set( HEAD_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ) @@ -87,7 +88,7 @@ add_definitions() add_definitions( -I${HEAD_DIR}/${ScanModulePath} -I${HEAD_DIR}/${MacroModulePath} - -I${HEAD_DIR}/${USBModulePath} + -I${HEAD_DIR}/${OutputModulePath} -I${HEAD_DIR}/${DebugModulePath} ) @@ -123,9 +124,9 @@ PathPrepend( SCAN_SRCS ${ScanModulePath} ${SCAN_SRCS} ) include ( "${MacroModulePath}/setup.cmake" ) PathPrepend( MACRO_SRCS ${MacroModulePath} ${MACRO_SRCS} ) -#| USB Module -include ( "${USBModulePath}/setup.cmake" ) -PathPrepend( USB_SRCS ${USBModulePath} ${USB_SRCS} ) +#| Output Module +include ( "${OutputModulePath}/setup.cmake" ) +PathPrepend( OUTPUT_SRCS ${OutputModulePath} ${OUTPUT_SRCS} ) #| Debugging Module include ( "${DebugModulePath}/setup.cmake" ) @@ -138,7 +139,7 @@ message( "${SCAN_SRCS}" ) message( STATUS "Detected Macro Module Source Files:" ) message( "${MACRO_SRCS}" ) message( STATUS "Detected USB Module Source Files:" ) -message( "${USB_SRCS}" ) +message( "${OUTPUT_SRCS}" ) message( STATUS "Detected Debug Module Source Files:" ) message( "${DEBUG_SRCS}" )