Archived
1
0

Moving USB to Output in preparation for additional Output types.

* Initial cli code
This commit is contained in:
Jacob Alexander 2014-01-19 16:40:36 -08:00
parent e9aa3880a6
commit 59f13f8f4f
23 changed files with 164 additions and 33 deletions

View File

@ -70,7 +70,7 @@ set( SRCS
${COMPILER_SRCS}
${SCAN_SRCS}
${MACRO_SRCS}
${USB_SRCS}
${OUTPUT_SRCS}
${DEBUG_SRCS}
)
@ -86,7 +86,7 @@ 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( ${OutputModulePath} ${OutputModuleCompatibility} )
ModuleCompatibility( ${DebugModulePath} ${DebugModuleCompatibility} )

37
Debug/cli/cli.c Normal file
View File

@ -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 <stdarg.h>
// Project Includes
#include "cli.h"
// ----- Functions -----
void initCLI()
{
}

49
Debug/cli/cli.h Normal file
View File

@ -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

42
Debug/cli/setup.cmake Normal file
View File

@ -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
)

View File

@ -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
)

View File

@ -36,7 +36,7 @@
#endif
// Local Includes
#include "usb_com.h"
#include "output_com.h"

View File

@ -19,8 +19,8 @@
* THE SOFTWARE.
*/
#ifndef __usb_com_h
#define __usb_com_h
#ifndef __output_com_h
#define __output_com_h
// ----- Includes -----

View File

@ -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
)

View File

@ -26,7 +26,7 @@ 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" )
@ -48,6 +48,7 @@ endif ()
#
set( ScanModulePath "Scan/${ScanModule}" )
set( MacroModulePath "Macro/${MacroModule}" )
set( OutputModulePath "Output/${OutputModule}" )
set( USBModulePath "USB/${USBModule}" )
set( DebugModulePath "Debug/${DebugModule}" )
@ -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}" )