Browse Source

Adding CMake build support for the KLL compiler

- Automatically downloads the kll compiler if not found
- Added capability files to each of the module that currently have them
- Split modules.cmake so kll.cmake could influence build targets (also needs info from modules.cmake)
- Updated .gitignore for kll compiler directory
- Added documentation on how to manipulate layouts using CMakeLists.txt
- Cleanup of old layout files
simple
Jacob Alexander 9 years ago
parent
commit
e0a2a4806b

+ 4
- 0
.gitignore View File

@@ -56,3 +56,7 @@ CMakeFiles
CMakeCache.txt
cmake_install.cmake

# External Repos #
##################
kll


+ 32
- 9
CMakeLists.txt View File

@@ -62,20 +62,41 @@ set( DebugModule "full" )


###
# Keymap Configuration (XXX - Not worky yet, currently ignored)
# Keymap Configuration (do not include the .kll extension)
#

##| If there are multiple DefaultMaps, it is defined here. If, the specified DefaultMap is not found, defaultMap.h is used.
set( DefaultMap "kishsaver" )
#| Do not include the .kll extension
#| * BaseMap maps the native keyboard scan codes to USB Codes so the layout is compatible with all other layouts
#| * DefaultMap allows the default keymap to be modified from the BaseMap
#| * PartialMaps is a set of dynamically set layers (there is no limit, but too many may use up too much RAM...)
#| BaseMap generally does not need to be changed from "defaultMap"
#|
#| Syntax:
#| myMap
#| * defines a single .kll layout file, double-quotes are needed to distinguish between layers
#| "myMap specialLayer"
#| * defines myMap to be the main layout, then replace specialLayers on top of it
#|
#| - Only for PartialMaps -
#| "myMap specialLayer" "myMap colemak" dvorak
#| * As before, but also generates a second layer at index 2 and third at index 3
#|
#| NOTE: Remember to add key(s) to enable each Partial Layer
#| NOTE2: Layers are always based up the BaseMap (which should be an ANSI-like mapping)
#| NOTE3: Compiler looks in kll/layouts and the build directory for layout files (precedence on build directory)

##| PartialMap combined keymap layering. The first keymap has the "least" precedence.
set( CombinedMap colemak capslock2ctrl )
##| Set the base keyboard .kll map, defaults to "defaultMap" if not found
##| Looks in Scan/<Module Name> for the available BaseMaps
##| TODO Support layering in basemap
set( BaseMap "defaultMap" )

##| ParitalMaps available on top of the CombinedMap. If there are input conflicts, the last PartialMap takes precedence.
set( PartialMaps hhkbnav kbdctrl )
##| Layer additonal .kll maps on the BaseMap, layers are in order from 1st to nth
##| Can be set to ""
set( DefaultMap "colemak stdFuncMap" )

##| MacroSets define extra capabilities that are not provided by the Scan or Output modules. Last MacroSet takes precedence.
set( MacroSets retype )
##| ParitalMaps available on top of the BaseMap. See above for syntax on specifying multiple layers vs. layering
##| Can be set to ""
set( PartialMaps "hhkbpro2" )



@@ -107,4 +128,6 @@ cmake_minimum_required( VERSION 2.8 )
# Module Initialization / Compilation / Targets
#
include( Lib/CMake/modules.cmake )
include( Lib/CMake/kll.cmake ) # Generate kll layouts if necessary
include( Lib/CMake/build.cmake )


+ 81
- 0
Lib/CMake/build.cmake View File

@@ -0,0 +1,81 @@
###| CMAKE Kiibohd Controller Source Configurator |###
#
# Written by Jacob Alexander in 2011-2014 for the Kiibohd Controller
#
# Released into the Public Domain
#
###



###
# Build Targets
#

#| Create the .ELF file
set( TARGET_ELF ${TARGET}.elf )
add_executable( ${TARGET_ELF} ${SRCS} generatedKeymap.h )


#| .ELF Properties
set_target_properties( ${TARGET_ELF} PROPERTIES
LINK_FLAGS ${LINKER_FLAGS}
SUFFIX "" # XXX Force Windows to keep the .exe off
)


#| Convert the .ELF into a .bin to load onto the McHCK
if( DEFINED DFU )
set( TARGET_BIN ${TARGET}.dfu.bin )
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
COMMAND ${CMAKE_OBJCOPY} ${BIN_FLAGS} ${TARGET_ELF} ${TARGET_BIN}
COMMENT "Creating dfu binary file: ${TARGET_BIN}"
)
endif()


#| Convert the .ELF into a .HEX to load onto the Teensy
if ( DEFINED TEENSY )
set( TARGET_HEX ${TARGET}.teensy.hex )
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
COMMAND ${CMAKE_OBJCOPY} ${HEX_FLAGS} ${TARGET_ELF} ${TARGET_HEX}
COMMENT "Creating iHex file to load: ${TARGET_HEX}"
)
endif()


#| Generate the Extended .LSS
set( TARGET_LSS ${TARGET}.lss )
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
COMMAND ${CMAKE_OBJDUMP} ${LSS_FLAGS} ${TARGET_ELF} > ${TARGET_LSS}
COMMENT "Creating Extended Listing: ${TARGET_LSS}"
)


#| Generate the Symbol Table .SYM
set( TARGET_SYM ${TARGET}.sym )
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
COMMAND ${CMAKE_NM} -n ${TARGET_ELF} > ${TARGET_SYM}
COMMENT "Creating Symbol Table: ${TARGET_SYM}"
)


#| Compiler Selection Record
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
COMMAND ${CMAKE_SOURCE_DIR}/Lib/CMake/writer compiler ${COMPILER_FAMILY}
)



###
# Size Information
#

#| After Changes Size Information
add_custom_target( SizeAfter ALL
COMMAND ${CMAKE_SOURCE_DIR}/Lib/CMake/sizeCalculator ${CMAKE_SIZE} ram ${TARGET_ELF} ${SIZE_RAM} " SRAM"
COMMAND ${CMAKE_SOURCE_DIR}/Lib/CMake/sizeCalculator ${CMAKE_SIZE} flash ${TARGET_ELF} ${SIZE_FLASH} "Flash"
DEPENDS ${TARGET_ELF}
COMMENT "Chip usage for ${CHIP}"
)


+ 124
- 0
Lib/CMake/kll.cmake View File

@@ -0,0 +1,124 @@
###| CMAKE Kiibohd Controller KLL Configurator |###
#
# Written by Jacob Alexander in 2014 for the Kiibohd Controller
#
# Released into the Public Domain
#
###


###
# Check if KLL compiler is needed
#

if ( "${MacroModule}" STREQUAL "PartialMap" )



###
# KLL Installation (Make sure repo has been cloned)
#

if ( NOT EXISTS "${PROJECT_SOURCE_DIR}/kll/kll.py" )
# Make sure git is available
find_package ( Git REQUIRED )

# Clone kll git repo
execute_process ( COMMAND ${GIT_EXECUTABLE} clone https://github.com/kiibohd/kll.git
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
endif () # kll/kll.py exists



###
# Prepare KLL layout arguments
#

#| KLL_DEPENDS is used to build a dependency tree for kll.py, this way when files are changed, kll.py gets re-run

#| Search for capabilities.kll in each module directory
foreach ( DIR ${ScanModulePath} ${MacroModulePath} ${OutputModulePath} ${DebugModulePath} )
# capabilities.kll exists, add to BaseMap
set ( filename "${PROJECT_SOURCE_DIR}/${DIR}/capabilities.kll" )
if ( EXISTS ${filename} )
set ( BaseMap_Args ${BaseMap_Args} ${filename} )
set ( KLL_DEPENDS ${KLL_DEPENDS} ${filename} )
endif ()
endforeach ()

#| If set BaseMap cannot be found, use default map
set ( pathname "${PROJECT_SOURCE_DIR}/${ScanModulePath}" )
if ( NOT EXISTS "${filename}/${BaseMap}.kll" )
set ( BaseMap_Args ${BaseMap_Args} ${pathname}/defaultMap.kll )
set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/defaultMap.kll )
else ()
set ( BaseMap_Args ${BaseMap_Args} ${pathname}/${BaseMap}.kll )
set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/${BaseMap}.kll )
endif ()

#| Configure DefaultMap if specified
if ( NOT "${DefaultMap}" STREQUAL "" )
set ( DefaultMap_Args -d )

string ( REPLACE " " ";" MAP_LIST ${DefaultMap} ) # Change spaces to semicolons
foreach ( MAP ${MAP_LIST} )
# Check if kll file is in build directory, otherwise default to layout directory
if ( EXISTS "${PROJECT_BINARY_DIR}/${MAP}.kll" )
set ( DefaultMap_Args ${DefaultMap_Args} ${MAP}.kll )
set ( KLL_DEPENDS ${KLL_DEPENDS} ${MAP}.kll )
else ()
set ( DefaultMap_Args ${DefaultMap_Args} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll )
set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll )
endif ()
endforeach ()
endif ()

#| Configure PartialMaps if specified
if ( NOT "${PartialMaps}" STREQUAL "" )
# For each partial layer
foreach ( MAP ${PartialMaps} )
set ( PartialMap_Args ${PartialMap_Args} -p )

# Combine each layer
string ( REPLACE " " ";" MAP_LIST ${MAP} ) # Change spaces to semicolons
foreach ( MAP_PART ${MAP_LIST} )
# Check if kll file is in build directory, otherwise default to layout directory
if ( EXISTS "${PROJECT_BINARY_DIR}/${MAP_PART}.kll" )
set ( PartialMap_Args ${PartialMap_Args} ${MAP_PART}.kll )
set ( KLL_DEPENDS ${KLL_DEPENDS} ${MAP_PART}.kll )
else ()
set ( PartialMap_Args ${PartialMap_Args} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll )
set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll )
endif ()
endforeach ()
endforeach ()
endif ()



###
# Run KLL Compiler
#

#| KLL Options
set ( kll_backend -b kiibohd )
set ( kll_template -t ${PROJECT_SOURCE_DIR}/kll/templates/kiibohdKeymap.h )
set ( kll_outputname generatedKeymap.h )
set ( kll_output -o ${kll_outputname} )

#| KLL Cmd
set ( kll_cmd ${PROJECT_SOURCE_DIR}/kll/kll.py ${BaseMap_Args} ${DefaultMap_Args} ${PartialMap_Args} ${kll_backend} ${kll_template} ${kll_output} )
add_custom_command ( OUTPUT ${kll_outputname}
COMMAND ${kll_cmd}
DEPENDS ${KLL_DEPENDS}
COMMENT "Generating KLL Layout"
)

#| Append generated file to required sources so it becomes a dependency in the main build
set ( SRCS ${SRCS} ${kll_outputname} )



endif () # PartialMap


+ 6
- 85
Lib/CMake/modules.cmake View File

@@ -112,11 +112,6 @@ include ( "${DebugModulePath}/setup.cmake" )
PathPrepend( DEBUG_SRCS ${DebugModulePath} ${DEBUG_SRCS} )


#| Default Map
# TODO Add support for different defaultMaps
configure_file( "${ScanModulePath}/defaultMap.h" defaultMap.h )


#| Print list of all module sources
message( STATUS "Detected Scan Module Source Files:" )
message( "${SCAN_SRCS}" )
@@ -150,7 +145,7 @@ set( MANUFACTURER "Kiibohd" )

#| Modified
#| Takes a bit of work to extract the "M " using CMake, and not using it if there are no modifications
execute_process( COMMAND git status -s -uno --porcelain
execute_process( COMMAND ${GIT_EXECUTABLE} status -s -uno --porcelain
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE Git_Modified_INFO
ERROR_QUIET
@@ -164,7 +159,7 @@ if ( ${Git_Modified_LENGTH} GREATER 2 )
endif ()

#| Branch
execute_process( COMMAND git rev-parse --abbrev-ref HEAD
execute_process( COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE Git_Branch_INFO
ERROR_QUIET
@@ -172,7 +167,7 @@ execute_process( COMMAND git rev-parse --abbrev-ref HEAD
)

#| Date
execute_process( COMMAND git show -s --format=%ci
execute_process( COMMAND ${GIT_EXECUTABLE} show -s --format=%ci
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE Git_Date_INFO
ERROR_QUIET
@@ -180,7 +175,7 @@ execute_process( COMMAND git show -s --format=%ci
)

#| Commit Author and Email
execute_process( COMMAND git show -s --format="%cn <%ce>"
execute_process( COMMAND ${GIT_EXECUTABLE} show -s --format="%cn <%ce>"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE Git_Commit_Author
ERROR_QUIET
@@ -188,7 +183,7 @@ execute_process( COMMAND git show -s --format="%cn <%ce>"
)

#| Commit Revision
execute_process( COMMAND git show -s --format=%H
execute_process( COMMAND ${GIT_EXECUTABLE} show -s --format=%H
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE Git_Commit_Revision
ERROR_QUIET
@@ -196,7 +191,7 @@ execute_process( COMMAND git show -s --format=%H
)

#| Origin URL
execute_process( COMMAND git config --get remote.origin.url
execute_process( COMMAND ${GIT_EXECUTABLE} config --get remote.origin.url
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE Git_Origin_URL
ERROR_QUIET
@@ -271,84 +266,10 @@ endif()



###
# Build Targets
#

#| Create the .ELF file
set( TARGET_ELF ${TARGET}.elf )
add_executable( ${TARGET_ELF} ${SRCS} )


#| .ELF Properties
set_target_properties( ${TARGET_ELF} PROPERTIES
LINK_FLAGS ${LINKER_FLAGS}
SUFFIX "" # XXX Force Windows to keep the .exe off
)


#| Convert the .ELF into a .bin to load onto the McHCK
if( DEFINED DFU )
set( TARGET_BIN ${TARGET}.dfu.bin )
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
COMMAND ${CMAKE_OBJCOPY} ${BIN_FLAGS} ${TARGET_ELF} ${TARGET_BIN}
COMMENT "Creating dfu binary file: ${TARGET_BIN}"
)
endif()


#| Convert the .ELF into a .HEX to load onto the Teensy
if ( DEFINED TEENSY )
set( TARGET_HEX ${TARGET}.teensy.hex )
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
COMMAND ${CMAKE_OBJCOPY} ${HEX_FLAGS} ${TARGET_ELF} ${TARGET_HEX}
COMMENT "Creating iHex file to load: ${TARGET_HEX}"
)
endif()


#| Generate the Extended .LSS
set( TARGET_LSS ${TARGET}.lss )
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
COMMAND ${CMAKE_OBJDUMP} ${LSS_FLAGS} ${TARGET_ELF} > ${TARGET_LSS}
COMMENT "Creating Extended Listing: ${TARGET_LSS}"
)


#| Generate the Symbol Table .SYM
set( TARGET_SYM ${TARGET}.sym )
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
COMMAND ${CMAKE_NM} -n ${TARGET_ELF} > ${TARGET_SYM}
COMMENT "Creating Symbol Table: ${TARGET_SYM}"
)


#| Compiler Selection Record
add_custom_command( TARGET ${TARGET_ELF} POST_BUILD
COMMAND ${CMAKE_SOURCE_DIR}/Lib/CMake/writer compiler ${COMPILER_FAMILY}
)



###
# Size Information
#

#| After Changes Size Information
add_custom_target( SizeAfter ALL
COMMAND ${CMAKE_SOURCE_DIR}/Lib/CMake/sizeCalculator ${CMAKE_SIZE} ram ${TARGET_ELF} ${SIZE_RAM} " SRAM"
COMMAND ${CMAKE_SOURCE_DIR}/Lib/CMake/sizeCalculator ${CMAKE_SIZE} flash ${TARGET_ELF} ${SIZE_FLASH} "Flash"
DEPENDS ${TARGET_ELF}
COMMENT "Chip usage for ${CHIP}"
)



###
# Setup Loader Script and Program
#


#| Provides the user with the correct teensy-loader-cli command for the built .HEX file
#| Windows
if( CMAKE_SYSTEM_NAME MATCHES "Windows" )

+ 15
- 0
Macro/PartialMap/capabilities.kll View File

@@ -0,0 +1,15 @@
Name = PartialMapCapabilities;
Version = 0.1;
Author = "HaaTa (Jacob Alexander) 2014";
KLL = 0.3;

# Modified Date
Date = 2014-09-14;


# Capabilties available to the PartialMap module
layerState => Macro_layerState_capability( layer : 2, state : 1 );
layerLatch => Macro_layerLatch_capability( layer : 2 );
layerLock => Macro_layerLock_capability( layer : 2 );
layerShift => Macro_layerShift_capability( layer : 2 );


+ 0
- 466
Macro/PartialMap/generatedKeymap.h View File

@@ -1,466 +0,0 @@
/* Copyright (C) 2014 by Jacob Alexander
*
* This file is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this file. If not, see <http://www.gnu.org/licenses/>.
*/

// Generated MSG /w timestamp and compiler information

#ifndef __generatedKeymap_h
#define __generatedKeymap_h

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

// KLL Include
#include <kll.h>



// ----- Capabilities -----

void debugPrint_capability( uint8_t state, uint8_t stateType, uint8_t *args )
{
// Display capability name
if ( stateType == 0xFF && state == 0xFF )
{
print("debugPrint(arg)");
return;
}

dbug_msg("Capability Print: ");
print(" statetype( ");
printHex( stateType );
print(" ) state ( ");
printHex( state );
print(" ) arg ( ");
printHex( args[0] );
print(" )");
}

void debugPrint2_capability( uint8_t state, uint8_t stateType, uint8_t *args )
{
// Display capability name
if ( stateType == 0xFF && state == 0xFF )
{
print("debugPrint2(arg1,arg2)");
return;
}

dbug_msg("Capability Print: ");
print(" statetype( ");
printHex( stateType );
print(" ) state ( ");
printHex( state );
print(" ) arg1 ( ");
printHex( args[0] );
print(" ) arg2 ( ");
printHex( args[1] );
print(" )");
}

// Indexed Capabilities Table
// TODO Generated from .kll files in each module
const Capability CapabilitiesList[] = {
{ debugPrint_capability, 1 },
{ debugPrint2_capability, 2 },
{ Macro_layerStateToggle_capability, sizeof(unsigned int) + 1 },
{ Output_usbCodeSend_capability, 1 },
};


// -- Result Macros

Guide_RM( 0 ) = { 1, 0, 0xDA, 0 };
Guide_RM( 1 ) = { 1, 0, 0xBE, 1, 0, 0xEF, 0 };
Guide_RM( 2 ) = { 2, 0, 0xFA, 0, 0xAD, 0 };
Guide_RM( 3 ) = { 1, 1, 0xCA, 0xFE, 0 };
Guide_RM( 4 ) = { 1, 0, 0xDA, 0 };


// -- Result Macro List

// Indexed Table of Result Macros
ResultMacro ResultMacroList[] = {
Define_RM( 0 ),
Define_RM( 1 ),
Define_RM( 2 ),
Define_RM( 3 ),
Define_RM( 4 ),
};


// -- Trigger Macros

Guide_TM( 0 ) = { 1, 0x00, 0x01, 0x73, 0 };
Guide_TM( 1 ) = { 1, 0x00, 0x01, 0x73, 1, 0x00, 0x01, 0x75, 0 };
Guide_TM( 2 ) = { 2, 0x00, 0x01, 0x73, 0x00, 0x01, 0x74, 0 };
Guide_TM( 3 ) = { 1, 0x00, 0x01, 0x76, 0 };
Guide_TM( 4 ) = { 1, 0x00, 0x01, 0x77, 0 };
Guide_TM( 5 ) = { 1, 0x00, 0x01, 0x2E, 0 };
Guide_TM( 6 ) = { 1, 0x00, 0x01, 0x2D, 0 };
Guide_TM( 7 ) = { 1, 0x00, 0x01, 0x2C, 0 };
Guide_TM( 8 ) = { 2, 0x00, 0x01, 0x20, 0x00, 0x01, 0x21, 0 };
Guide_TM( 9 ) = { 1, 0x00, 0x01, 0x20, 1, 0x00, 0x01, 0x22, 0 };
Guide_TM( 10 ) = { 1, 0x00, 0x01, 0x2B, 0 };


// -- Trigger Macro List

// Indexed Table of Trigger Macros
TriggerMacro TriggerMacroList[] = {
Define_TM( 0, 0 ),
Define_TM( 1, 1 ),
Define_TM( 2, 2 ),
Define_TM( 3, 3 ),
Define_TM( 4, 0 ),
Define_TM( 5, 0 ),
Define_TM( 6, 1 ),
Define_TM( 7, 2 ),
Define_TM( 8, 0 ),
Define_TM( 9, 0 ),
Define_TM( 10, 4 ),
};



// ----- Trigger Maps -----

// MaxScanCode
// - This is retrieved from the KLL configuration
// - Should be corollated with the max scan code in the scan module
// - Maximum value is 0x100 (0x0 to 0xFF)
// - Increasing it beyond the keyboard's capabilities is just a waste of ram...
#define MaxScanCode 0x100

// -- Trigger Lists
//
// Index 0: # of triggers in list
// Index n: pointer to trigger macro - use tm() macro

// Default Layer
Define_TL( default, 0x00 ) = { 0 };
Define_TL( default, 0x01 ) = { 0 };
Define_TL( default, 0x02 ) = { 0 };
Define_TL( default, 0x03 ) = { 0 };
Define_TL( default, 0x04 ) = { 0 };
Define_TL( default, 0x05 ) = { 0 };
Define_TL( default, 0x06 ) = { 0 };
Define_TL( default, 0x07 ) = { 0 };
Define_TL( default, 0x08 ) = { 0 };
Define_TL( default, 0x09 ) = { 0 };
Define_TL( default, 0x0A ) = { 0 };
Define_TL( default, 0x0B ) = { 0 };
Define_TL( default, 0x0C ) = { 0 };
Define_TL( default, 0x0D ) = { 0 };
Define_TL( default, 0x0E ) = { 0 };
Define_TL( default, 0x0F ) = { 0 };
Define_TL( default, 0x10 ) = { 0 };
Define_TL( default, 0x11 ) = { 0 };
Define_TL( default, 0x12 ) = { 0 };
Define_TL( default, 0x13 ) = { 0 };
Define_TL( default, 0x14 ) = { 0 };
Define_TL( default, 0x15 ) = { 0 };
Define_TL( default, 0x16 ) = { 0 };
Define_TL( default, 0x17 ) = { 0 };
Define_TL( default, 0x18 ) = { 0 };
Define_TL( default, 0x19 ) = { 0 };
Define_TL( default, 0x1A ) = { 0 };
Define_TL( default, 0x1B ) = { 0 };
Define_TL( default, 0x1C ) = { 0 };
Define_TL( default, 0x1D ) = { 0 };
Define_TL( default, 0x1E ) = { 0 };
Define_TL( default, 0x1F ) = { 0 };
Define_TL( default, 0x20 ) = { 2, 8, 9 };
Define_TL( default, 0x21 ) = { 1, 8 };
Define_TL( default, 0x22 ) = { 1, 9 };
Define_TL( default, 0x23 ) = { 0 };
Define_TL( default, 0x24 ) = { 0 };
Define_TL( default, 0x25 ) = { 0 };
Define_TL( default, 0x26 ) = { 0 };
Define_TL( default, 0x27 ) = { 0 };
Define_TL( default, 0x28 ) = { 0 };
Define_TL( default, 0x29 ) = { 0 };
Define_TL( default, 0x2A ) = { 0 };
Define_TL( default, 0x2B ) = { 1, 10 };
Define_TL( default, 0x2C ) = { 1, 7 };
Define_TL( default, 0x2D ) = { 1, 6 };
Define_TL( default, 0x2E ) = { 1, 5 };
Define_TL( default, 0x2F ) = { 0 };
Define_TL( default, 0x30 ) = { 0 };
Define_TL( default, 0x31 ) = { 0 };
Define_TL( default, 0x32 ) = { 0 };
Define_TL( default, 0x33 ) = { 0 };
Define_TL( default, 0x34 ) = { 0 };
Define_TL( default, 0x35 ) = { 0 };
Define_TL( default, 0x36 ) = { 0 };
Define_TL( default, 0x37 ) = { 0 };
Define_TL( default, 0x38 ) = { 0 };
Define_TL( default, 0x39 ) = { 0 };
Define_TL( default, 0x3A ) = { 0 };
Define_TL( default, 0x3B ) = { 0 };
Define_TL( default, 0x3C ) = { 0 };
Define_TL( default, 0x3D ) = { 0 };
Define_TL( default, 0x3E ) = { 0 };
Define_TL( default, 0x3F ) = { 0 };
Define_TL( default, 0x40 ) = { 0 };
Define_TL( default, 0x41 ) = { 0 };
Define_TL( default, 0x42 ) = { 0 };
Define_TL( default, 0x43 ) = { 0 };
Define_TL( default, 0x44 ) = { 0 };
Define_TL( default, 0x45 ) = { 0 };
Define_TL( default, 0x46 ) = { 0 };
Define_TL( default, 0x47 ) = { 0 };
Define_TL( default, 0x48 ) = { 0 };
Define_TL( default, 0x49 ) = { 0 };
Define_TL( default, 0x4A ) = { 0 };
Define_TL( default, 0x4B ) = { 0 };
Define_TL( default, 0x4C ) = { 0 };
Define_TL( default, 0x4D ) = { 0 };
Define_TL( default, 0x4E ) = { 0 };
Define_TL( default, 0x4F ) = { 0 };
Define_TL( default, 0x50 ) = { 0 };
Define_TL( default, 0x51 ) = { 0 };
Define_TL( default, 0x52 ) = { 0 };
Define_TL( default, 0x53 ) = { 0 };
Define_TL( default, 0x54 ) = { 0 };
Define_TL( default, 0x55 ) = { 0 };
Define_TL( default, 0x56 ) = { 0 };
Define_TL( default, 0x57 ) = { 0 };
Define_TL( default, 0x58 ) = { 0 };
Define_TL( default, 0x59 ) = { 0 };
Define_TL( default, 0x5A ) = { 0 };
Define_TL( default, 0x5B ) = { 0 };
Define_TL( default, 0x5C ) = { 0 };
Define_TL( default, 0x5D ) = { 0 };
Define_TL( default, 0x5E ) = { 0 };
Define_TL( default, 0x5F ) = { 0 };
Define_TL( default, 0x60 ) = { 0 };
Define_TL( default, 0x61 ) = { 0 };
Define_TL( default, 0x62 ) = { 0 };
Define_TL( default, 0x63 ) = { 0 };
Define_TL( default, 0x64 ) = { 0 };
Define_TL( default, 0x65 ) = { 0 };
Define_TL( default, 0x66 ) = { 0 };
Define_TL( default, 0x67 ) = { 0 };
Define_TL( default, 0x68 ) = { 0 };
Define_TL( default, 0x69 ) = { 0 };
Define_TL( default, 0x6A ) = { 0 };
Define_TL( default, 0x6B ) = { 0 };
Define_TL( default, 0x6C ) = { 0 };
Define_TL( default, 0x6D ) = { 0 };
Define_TL( default, 0x6E ) = { 0 };
Define_TL( default, 0x6F ) = { 0 };
Define_TL( default, 0x70 ) = { 0 };
Define_TL( default, 0x71 ) = { 0 };
Define_TL( default, 0x72 ) = { 0 };
Define_TL( default, 0x73 ) = { 3, 0, 1, 2 };
Define_TL( default, 0x74 ) = { 1, 2 };
Define_TL( default, 0x75 ) = { 1, 1 };
Define_TL( default, 0x76 ) = { 1, 3 };
Define_TL( default, 0x77 ) = { 1, 4 };
Define_TL( default, 0x78 ) = { 0 };
Define_TL( default, 0x79 ) = { 0 };
Define_TL( default, 0x7A ) = { 0 };
Define_TL( default, 0x7B ) = { 0 };
Define_TL( default, 0x7C ) = { 0 };
Define_TL( default, 0x7D ) = { 0 };
Define_TL( default, 0x7E ) = { 0 };
Define_TL( default, 0x7F ) = { 0 };
Define_TL( default, 0x80 ) = { 0 };
Define_TL( default, 0x81 ) = { 0 };
Define_TL( default, 0x82 ) = { 0 };
Define_TL( default, 0x83 ) = { 0 };
Define_TL( default, 0x84 ) = { 0 };
Define_TL( default, 0x85 ) = { 0 };
Define_TL( default, 0x86 ) = { 0 };
Define_TL( default, 0x87 ) = { 0 };
Define_TL( default, 0x88 ) = { 0 };
Define_TL( default, 0x89 ) = { 0 };
Define_TL( default, 0x8A ) = { 0 };
Define_TL( default, 0x8B ) = { 0 };
Define_TL( default, 0x8C ) = { 0 };
Define_TL( default, 0x8D ) = { 0 };
Define_TL( default, 0x8E ) = { 0 };
Define_TL( default, 0x8F ) = { 0 };
Define_TL( default, 0x90 ) = { 0 };
Define_TL( default, 0x91 ) = { 0 };
Define_TL( default, 0x92 ) = { 0 };
Define_TL( default, 0x93 ) = { 0 };
Define_TL( default, 0x94 ) = { 0 };
Define_TL( default, 0x95 ) = { 0 };
Define_TL( default, 0x96 ) = { 0 };
Define_TL( default, 0x97 ) = { 0 };
Define_TL( default, 0x98 ) = { 0 };
Define_TL( default, 0x99 ) = { 0 };
Define_TL( default, 0x9A ) = { 0 };
Define_TL( default, 0x9B ) = { 0 };
Define_TL( default, 0x9C ) = { 0 };
Define_TL( default, 0x9D ) = { 0 };
Define_TL( default, 0x9E ) = { 0 };
Define_TL( default, 0x9F ) = { 0 };
Define_TL( default, 0xA0 ) = { 0 };
Define_TL( default, 0xA1 ) = { 0 };
Define_TL( default, 0xA2 ) = { 0 };
Define_TL( default, 0xA3 ) = { 0 };
Define_TL( default, 0xA4 ) = { 0 };
Define_TL( default, 0xA5 ) = { 0 };
Define_TL( default, 0xA6 ) = { 0 };
Define_TL( default, 0xA7 ) = { 0 };
Define_TL( default, 0xA8 ) = { 0 };
Define_TL( default, 0xA9 ) = { 0 };
Define_TL( default, 0xAA ) = { 0 };
Define_TL( default, 0xAB ) = { 0 };
Define_TL( default, 0xAC ) = { 0 };
Define_TL( default, 0xAD ) = { 0 };
Define_TL( default, 0xAE ) = { 0 };
Define_TL( default, 0xAF ) = { 0 };
Define_TL( default, 0xB0 ) = { 0 };
Define_TL( default, 0xB1 ) = { 0 };
Define_TL( default, 0xB2 ) = { 0 };
Define_TL( default, 0xB3 ) = { 0 };
Define_TL( default, 0xB4 ) = { 0 };
Define_TL( default, 0xB5 ) = { 0 };
Define_TL( default, 0xB6 ) = { 0 };
Define_TL( default, 0xB7 ) = { 0 };
Define_TL( default, 0xB8 ) = { 0 };
Define_TL( default, 0xB9 ) = { 0 };
Define_TL( default, 0xBA ) = { 0 };
Define_TL( default, 0xBB ) = { 0 };
Define_TL( default, 0xBC ) = { 0 };
Define_TL( default, 0xBD ) = { 0 };
Define_TL( default, 0xBE ) = { 0 };
Define_TL( default, 0xBF ) = { 0 };
Define_TL( default, 0xC0 ) = { 0 };
Define_TL( default, 0xC1 ) = { 0 };
Define_TL( default, 0xC2 ) = { 0 };
Define_TL( default, 0xC3 ) = { 0 };
Define_TL( default, 0xC4 ) = { 0 };
Define_TL( default, 0xC5 ) = { 0 };
Define_TL( default, 0xC6 ) = { 0 };
Define_TL( default, 0xC7 ) = { 0 };
Define_TL( default, 0xC8 ) = { 0 };
Define_TL( default, 0xC9 ) = { 0 };
Define_TL( default, 0xCA ) = { 0 };
Define_TL( default, 0xCB ) = { 0 };
Define_TL( default, 0xCC ) = { 0 };
Define_TL( default, 0xCD ) = { 0 };
Define_TL( default, 0xCE ) = { 0 };
Define_TL( default, 0xCF ) = { 0 };
Define_TL( default, 0xD0 ) = { 0 };
Define_TL( default, 0xD1 ) = { 0 };
Define_TL( default, 0xD2 ) = { 0 };
Define_TL( default, 0xD3 ) = { 0 };
Define_TL( default, 0xD4 ) = { 0 };
Define_TL( default, 0xD5 ) = { 0 };
Define_TL( default, 0xD6 ) = { 0 };
Define_TL( default, 0xD7 ) = { 0 };
Define_TL( default, 0xD8 ) = { 0 };
Define_TL( default, 0xD9 ) = { 0 };
Define_TL( default, 0xDA ) = { 0 };
Define_TL( default, 0xDB ) = { 0 };
Define_TL( default, 0xDC ) = { 0 };
Define_TL( default, 0xDD ) = { 0 };
Define_TL( default, 0xDE ) = { 0 };
Define_TL( default, 0xDF ) = { 0 };
Define_TL( default, 0xE0 ) = { 0 };
Define_TL( default, 0xE1 ) = { 0 };
Define_TL( default, 0xE2 ) = { 0 };
Define_TL( default, 0xE3 ) = { 0 };
Define_TL( default, 0xE4 ) = { 0 };
Define_TL( default, 0xE5 ) = { 0 };
Define_TL( default, 0xE6 ) = { 0 };
Define_TL( default, 0xE7 ) = { 0 };
Define_TL( default, 0xE8 ) = { 0 };
Define_TL( default, 0xE9 ) = { 0 };
Define_TL( default, 0xEA ) = { 0 };
Define_TL( default, 0xEB ) = { 0 };
Define_TL( default, 0xEC ) = { 0 };
Define_TL( default, 0xED ) = { 0 };
Define_TL( default, 0xEE ) = { 0 };
Define_TL( default, 0xEF ) = { 0 };
Define_TL( default, 0xF0 ) = { 0 };
Define_TL( default, 0xF1 ) = { 0 };
Define_TL( default, 0xF2 ) = { 0 };
Define_TL( default, 0xF3 ) = { 0 };
Define_TL( default, 0xF4 ) = { 0 };
Define_TL( default, 0xF5 ) = { 0 };
Define_TL( default, 0xF6 ) = { 0 };
Define_TL( default, 0xF7 ) = { 0 };
Define_TL( default, 0xF8 ) = { 0 };
Define_TL( default, 0xF9 ) = { 0 };
Define_TL( default, 0xFA ) = { 0 };
Define_TL( default, 0xFB ) = { 0 };
Define_TL( default, 0xFC ) = { 0 };
Define_TL( default, 0xFD ) = { 0 };
Define_TL( default, 0xFE ) = { 0 };
Define_TL( default, 0xFF ) = { 0 };


// myname Layer
Define_TL( myname, 0x05 ) = { 0 };
Define_TL( myname, 0x06 ) = { 0 };
Define_TL( myname, 0x07 ) = { 0 };


// myname2 Layer
Define_TL( myname2, 0x04 ) = { 0 };
Define_TL( myname2, 0x05 ) = { 0 };
Define_TL( myname2, 0x06 ) = { 0 };


// -- ScanCode Indexed Maps
// Maps to a trigger list of macro pointers
// _
// <scan code> -> |T|
// |r| -> <trigger macro pointer 1>
// |i|
// |g| -> <trigger macro pointer 2>
// |g|
// |e| -> <trigger macro pointer 3>
// |r|
// |s| -> <trigger macro pointer n>
// -

// Default Map for ScanCode Lookup
const unsigned int *default_scanMap[] = {
default_tl_0x00, default_tl_0x01, default_tl_0x02, default_tl_0x03, default_tl_0x04, default_tl_0x05, default_tl_0x06, default_tl_0x07, default_tl_0x08, default_tl_0x09, default_tl_0x0A, default_tl_0x0B, default_tl_0x0C, default_tl_0x0D, default_tl_0x0E, default_tl_0x0F, default_tl_0x10, default_tl_0x11, default_tl_0x12, default_tl_0x13, default_tl_0x14, default_tl_0x15, default_tl_0x16, default_tl_0x17, default_tl_0x18, default_tl_0x19, default_tl_0x1A, default_tl_0x1B, default_tl_0x1C, default_tl_0x1D, default_tl_0x1E, default_tl_0x1F, default_tl_0x20, default_tl_0x21, default_tl_0x22, default_tl_0x23, default_tl_0x24, default_tl_0x25, default_tl_0x26, default_tl_0x27, default_tl_0x28, default_tl_0x29, default_tl_0x2A, default_tl_0x2B, default_tl_0x2C, default_tl_0x2D, default_tl_0x2E, default_tl_0x2F, default_tl_0x30, default_tl_0x31, default_tl_0x32, default_tl_0x33, default_tl_0x34, default_tl_0x35, default_tl_0x36, default_tl_0x37, default_tl_0x38, default_tl_0x39, default_tl_0x3A, default_tl_0x3B, default_tl_0x3C, default_tl_0x3D, default_tl_0x3E, default_tl_0x3F, default_tl_0x40, default_tl_0x41, default_tl_0x42, default_tl_0x43, default_tl_0x44, default_tl_0x45, default_tl_0x46, default_tl_0x47, default_tl_0x48, default_tl_0x49, default_tl_0x4A, default_tl_0x4B, default_tl_0x4C, default_tl_0x4D, default_tl_0x4E, default_tl_0x4F, default_tl_0x50, default_tl_0x51, default_tl_0x52, default_tl_0x53, default_tl_0x54, default_tl_0x55, default_tl_0x56, default_tl_0x57, default_tl_0x58, default_tl_0x59, default_tl_0x5A, default_tl_0x5B, default_tl_0x5C, default_tl_0x5D, default_tl_0x5E, default_tl_0x5F, default_tl_0x60, default_tl_0x61, default_tl_0x62, default_tl_0x63, default_tl_0x64, default_tl_0x65, default_tl_0x66, default_tl_0x67, default_tl_0x68, default_tl_0x69, default_tl_0x6A, default_tl_0x6B, default_tl_0x6C, default_tl_0x6D, default_tl_0x6E, default_tl_0x6F, default_tl_0x70, default_tl_0x71, default_tl_0x72, default_tl_0x73, default_tl_0x74, default_tl_0x75, default_tl_0x76, default_tl_0x77, default_tl_0x78, default_tl_0x79, default_tl_0x7A, default_tl_0x7B, default_tl_0x7C, default_tl_0x7D, default_tl_0x7E, default_tl_0x7F, default_tl_0x80, default_tl_0x81, default_tl_0x82, default_tl_0x83, default_tl_0x84, default_tl_0x85, default_tl_0x86, default_tl_0x87, default_tl_0x88, default_tl_0x89, default_tl_0x8A, default_tl_0x8B, default_tl_0x8C, default_tl_0x8D, default_tl_0x8E, default_tl_0x8F, default_tl_0x90, default_tl_0x91, default_tl_0x92, default_tl_0x93, default_tl_0x94, default_tl_0x95, default_tl_0x96, default_tl_0x97, default_tl_0x98, default_tl_0x99, default_tl_0x9A, default_tl_0x9B, default_tl_0x9C, default_tl_0x9D, default_tl_0x9E, default_tl_0x9F, default_tl_0xA0, default_tl_0xA1, default_tl_0xA2, default_tl_0xA3, default_tl_0xA4, default_tl_0xA5, default_tl_0xA6, default_tl_0xA7, default_tl_0xA8, default_tl_0xA9, default_tl_0xAA, default_tl_0xAB, default_tl_0xAC, default_tl_0xAD, default_tl_0xAE, default_tl_0xAF, default_tl_0xB0, default_tl_0xB1, default_tl_0xB2, default_tl_0xB3, default_tl_0xB4, default_tl_0xB5, default_tl_0xB6, default_tl_0xB7, default_tl_0xB8, default_tl_0xB9, default_tl_0xBA, default_tl_0xBB, default_tl_0xBC, default_tl_0xBD, default_tl_0xBE, default_tl_0xBF, default_tl_0xC0, default_tl_0xC1, default_tl_0xC2, default_tl_0xC3, default_tl_0xC4, default_tl_0xC5, default_tl_0xC6, default_tl_0xC7, default_tl_0xC8, default_tl_0xC9, default_tl_0xCA, default_tl_0xCB, default_tl_0xCC, default_tl_0xCD, default_tl_0xCE, default_tl_0xCF, default_tl_0xD0, default_tl_0xD1, default_tl_0xD2, default_tl_0xD3, default_tl_0xD4, default_tl_0xD5, default_tl_0xD6, default_tl_0xD7, default_tl_0xD8, default_tl_0xD9, default_tl_0xDA, default_tl_0xDB, default_tl_0xDC, default_tl_0xDD, default_tl_0xDE, default_tl_0xDF, default_tl_0xE0, default_tl_0xE1, default_tl_0xE2, default_tl_0xE3, default_tl_0xE4, default_tl_0xE5, default_tl_0xE6, default_tl_0xE7, default_tl_0xE8, default_tl_0xE9, default_tl_0xEA, default_tl_0xEB, default_tl_0xEC, default_tl_0xED, default_tl_0xEE, default_tl_0xEF, default_tl_0xF0, default_tl_0xF1, default_tl_0xF2, default_tl_0xF3, default_tl_0xF4, default_tl_0xF5, default_tl_0xF6, default_tl_0xF7, default_tl_0xF8, default_tl_0xF9, default_tl_0xFA, default_tl_0xFB, default_tl_0xFC, default_tl_0xFD, default_tl_0xFE, default_tl_0xFF,
};

// Layer <name> for ScanCode Lookup
const unsigned int *myname_scanMap[] = {
0, 0, 0, 0, myname_tl_0x05, myname_tl_0x06, myname_tl_0x07
};

// Layer <name> for ScanCode Lookup
const unsigned int *myname2_scanMap[] = {
0, 0, 0, myname2_tl_0x04, myname2_tl_0x05, myname2_tl_0x06
};



// ----- Layer Index -----

// -- Layer Index List
//
// Index 0: Default map
// Index n: Additional layers
Layer LayerIndex[] = {
Layer_IN( default_scanMap, "DefaultMap" ),
Layer_IN( myname_scanMap, "myname" ),
Layer_IN( myname2_scanMap, "myname2" ),
};



#endif // __generatedKeymap_h


+ 1
- 3
Macro/PartialMap/macro.c View File

@@ -27,9 +27,7 @@

// Keymaps
#include "usb_hid.h"
//#include <defaultMap.h>
#include "templateKeymap.h" // TODO Use actual generated version
//#include "generatedKeymap.h" // TODO Use actual generated version
#include <generatedKeymap.h> // Generated using kll at compile time, in build directory

// Local Includes
#include "macro.h"

+ 12
- 0
Output/pjrcUSB/capabilities.kll View File

@@ -0,0 +1,12 @@
Name = pjrcUSBCapabilities;
Version = 0.1;
Author = "HaaTa (Jacob Alexander) 2014";
KLL = 0.3;

# Modified Date
Date = 2014-09-14;


# Capabilties available to the pjrcUSB output module
usbKeyOut => Output_usbCodeSend_capability( usbCode : 1 );


+ 0
- 0
Scan/MD1/defaultMap.h View File


+ 82
- 0
Scan/MD1/defaultMap.kll View File

@@ -0,0 +1,82 @@
Name = MD1;
Version = 0.2;
Author = "HaaTa (Jacob Alexander) 2014";
KLL = 0.3;

# Modified Date
Date = 2014-09-14;


# MOVE THIS SECTION to another file
usbKeyOut => Output_usbCodeSend_capability( usbCode : 1 );
layerState => Macro_layerState_capability( layer : 2, state : 1 );
layerLatch => Macro_layerLatch_capability( layer : 2 );
layerLock => Macro_layerLock_capability( layer : 2 );
layerShift => Macro_layerShift_capability( layer : 2 );
# END SECTION


S0x00 : U"Esc";
S0x01 : U"1";
S0x02 : U"2";
S0x03 : U"3";
S0x04 : U"4";
S0x05 : U"5";
S0x06 : U"6";
S0x07 : U"7";
S0x08 : U"8";
S0x09 : U"9";
S0x0A : U"0";
S0x0B : U"Minus";
S0x0C : U"Equal";
S0x0D : U"Backslash";
S0x0E : U"Tab";
S0x0F : U"Q";
S0x10 : U"W";
S0x11 : U"E";
S0x12 : U"R";
S0x13 : U"T";
S0x14 : U"Y";
S0x15 : U"U";
S0x16 : U"I";
S0x17 : U"O";
S0x18 : U"P";
S0x19 : U"LBrace";
S0x1A : U"RBrace";
S0x1B : U"Backspace";
S0x1C : U"Ctrl";
S0x1D : U"A";
S0x1E : U"S";
S0x1F : U"D";
S0x20 : U"F";
S0x21 : U"G";
S0x22 : U"H";
S0x23 : U"J";
S0x24 : U"K";
S0x25 : U"L";
S0x26 : U"Semicolon";
S0x27 : U"Quote";
S0x28 : U"Enter";
S0x29 : U"LShift";
S0x2A : U"Z";
S0x2B : U"X";
S0x2C : U"C";
S0x2D : U"V";
S0x2E : U"B";
S0x2F : U"N";
S0x30 : U"M";
S0x31 : U"Comma";
S0x32 : U"Period";
S0x33 : U"Slash";
S0x34 : U"RShift";
S0x35 : U"Function1"; # Fun key
S0x36 : U"Function2"; # Left Blank Key
S0x37 : U"LAlt";
S0x38 : U"LGui";
S0x39 : U"Space";
S0x3A : U"RGui";
S0x3B : U"RAlt";
S0x3C : U"Function3"; # Right Blank Key 1
S0x3D : U"Function4"; # Right Blank Key 2
S0x3E : U"BackTick";