7 Commits

37 changed files with 86 additions and 554 deletions

View File

@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is loosely based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to the [UHK Versioning](VERSIONING.md) conventions.
## [2.1.0] - 2017-10-13
Data Model: 1.0.0 (unchanged) | USB Protocol: 1.2.0 (minor bump) | Slave Protocol: 2.1.0 (minor bump)
- Add jumpToSlaveBootloader USB and slave protocol command. `USBPROTOCOL:MINOR` `SLAVEPROTOCOL:MINOR`
- Fix generic HID descriptor enumeration error.
## [2.0.0] - 2017-10-10
Data Model: 1.0.0 (unchanged) | USB Protocol: 1.1.0 (minor bump) | Slave Protocol: 2.0.0 (major bump)

View File

@@ -14,6 +14,8 @@ The UHK USB protocol is used by the UHK to interact with the host system via USB
* The minor number is bumped upon an extension of the protocol, such as adding a new protocol command ID, or utilizing a previously unutilized byte within the payload.
* The patch number is bumped upon a protocol related implementation fix, for example adding a new validation check.
In order for a host application to communicate with the UHK, its major USB protocol version must match, and its minor USB protocol version must be less or equal.
## Slave protocol version
The Slave protocol is the I2C based application protocol of the UHK via which the master module (right keyboard half), and the slave modules (left keyboard half, left add-on, right add-on) communicate.
@@ -22,6 +24,8 @@ The Slave protocol is the I2C based application protocol of the UHK via which th
* The minor number is bumped upon an extension of the protocol, such as adding a new protocol command ID, or extending the payload.
* The patch number is bumped upon a protocol related implementation fix, for example adding a new validation check.
In order for the master module to communicate with the slave modules, its major slave protocol version must match, and its minor slave protocol version must be less or equal.
## Data model version
The data model is the binary serialization format of the user configuration which includes keymaps, macros, and every other configuration item.
@@ -30,6 +34,8 @@ The data model is the binary serialization format of the user configuration whic
* The minor number is bumped upon an extension of the data model, such as using a previously unutilized interval of a type number to add a new item type.
* The patch number is bumped upon a data model related implementation fix, for example adding a new validation check.
In order for a host application to parse the configuration of the UHK, its major data model version must match, and its minor data model version must be less or equal.
For the sake of completeness, it's worth mentioning that not only the (user) data model exists, but the hardware data model too which contains hardware-specific configuration items, such as ANSI vs ISO keyboard type. The hardware data model also has a version number field, but it's not expected to ever change so for the sake of simplicity, it's not included into changelog releases. The hardware configuration version is 1.0.0
## Firmware version

View File

@@ -1,198 +0,0 @@
INCLUDE(CMakeForceCompiler)
# CROSS COMPILER SETTING
SET(CMAKE_SYSTEM_NAME Generic)
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
# THE VERSION NUMBER
SET (Tutorial_VERSION_MAJOR 1)
SET (Tutorial_VERSION_MINOR 0)
# ENABLE ASM
ENABLE_LANGUAGE(ASM)
SET(CMAKE_STATIC_LIBRARY_PREFIX)
SET(CMAKE_STATIC_LIBRARY_SUFFIX)
SET(CMAKE_EXECUTABLE_LIBRARY_PREFIX)
SET(CMAKE_EXECUTABLE_LIBRARY_SUFFIX)
# CURRENT DIRECTORY
SET(SrcDir "${CMAKE_CURRENT_SOURCE_DIR}/../../src")
SET(KsdkDir "${SrcDir}/../../lib/KSDK_2.0_MKL03Z8xxx4")
SET(ProjDirPath ${CMAKE_CURRENT_SOURCE_DIR})
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -DDEBUG")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -D__STARTUP_CLEAR_BSS")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -g")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -flto")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -mcpu=cortex-m0plus")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -Wall")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -mfloat-abi=soft")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -mthumb")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -fno-common")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -ffunction-sections")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -fdata-sections")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -ffreestanding")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -fno-builtin")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -mapcs")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -std=gnu99")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -D__STARTUP_CLEAR_BSS")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -flto")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -mcpu=cortex-m0plus")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -Wall")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -mfloat-abi=soft")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -mthumb")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -fno-common")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -ffunction-sections")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -fdata-sections")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -ffreestanding")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -fno-builtin")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -mapcs")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -std=gnu99")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DCPU_MKL03Z32VFK4")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DPRINTF_FLOAT_ENABLE=0")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSCANF_FLOAT_ENABLE=0")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DPRINTF_ADVANCED_ENABLE=0")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSCANF_ADVANCED_ENABLE=0")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DFRDM_KL03Z")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DFREEDOM")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -flto")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mcpu=cortex-m0plus")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mfloat-abi=soft")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mthumb")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -MMD")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -MP")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fno-common")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ffunction-sections")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fdata-sections")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ffreestanding")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fno-builtin")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mapcs")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -std=gnu99")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNDEBUG")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DCPU_MKL03Z32VFK4")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DPRINTF_FLOAT_ENABLE=0")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DSCANF_FLOAT_ENABLE=0")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DPRINTF_ADVANCED_ENABLE=0")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DSCANF_ADVANCED_ENABLE=0")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DFRDM_KL03Z")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DFREEDOM")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Os")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mcpu=cortex-m0plus")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mfloat-abi=soft")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mthumb")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -MMD")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -MP")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fno-common")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffunction-sections")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fdata-sections")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffreestanding")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fno-builtin")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mapcs")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -std=gnu99")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -flto")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -mcpu=cortex-m0plus")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Wall")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -mfloat-abi=soft")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} --specs=nano.specs")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -fno-common")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -ffunction-sections")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -fdata-sections")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -ffreestanding")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -fno-builtin")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -mthumb")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -mapcs")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Xlinker")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} --gc-sections")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Xlinker")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -static")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Xlinker")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -z")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Xlinker")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} muldefs")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -g")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -flto")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -mcpu=cortex-m0plus")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Wall")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -mfloat-abi=soft")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} --specs=nano.specs")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fno-common")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -ffunction-sections")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fdata-sections")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -ffreestanding")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fno-builtin")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -mthumb")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -mapcs")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Xlinker")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} --gc-sections")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Xlinker")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -static")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Xlinker")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -z")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Xlinker")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} muldefs")
include_directories(${KsdkDir}/CMSIS/Include)
include_directories(${ProjDirPath}/../../../../../devices)
include_directories(${KsdkDir}/devices/MKL03Z4/drivers)
include_directories(${ProjDirPath}/..)
include_directories(${ProjDirPath}/../../../../../devices/MKL03Z4/utilities)
include_directories(${ProjDirPath}/../../..)
include_directories(${KsdkDir}/devices/MKL03Z4)
include_directories(${ProjDirPath}/../../../../../CMSIS/Include)
include_directories(${ProjDirPath}/../../../../../devices)
include_directories(${ProjDirPath}/../../../../../devices/MKL03Z4/drivers)
include_directories(${ProjDirPath}/..)
include_directories(${ProjDirPath}/../../../../../devices/MKL03Z4/utilities)
include_directories(${ProjDirPath}/../../..)
include_directories(${ProjDirPath}/../../../../../devices/MKL03Z4)
add_executable(uhk-left.elf
"${KsdkDir}/devices/MKL03Z4/gcc/startup_MKL03Z4.S"
#"${ProjDirPath}/../../../../../devices/MKL03Z4/drivers/fsl_lpuart.h"
#"${ProjDirPath}/../../../../../devices/MKL03Z4/drivers/fsl_lpuart.c"
"${KsdkDir}/devices/MKL03Z4/drivers/fsl_port.h"
"${SrcDir}/main.c"
"${SrcDir}/clock_config.c"
"${SrcDir}/clock_config.h"
#"${KsdkDir}/devices/MKL03Z4/drivers/fsl_common.h"
#"${KsdkDir}/devices/MKL03Z4/drivers/fsl_common.c"
#"${ProjDirPath}/../../../../../devices/MKL03Z4/utilities/fsl_debug_console.c"
#"${ProjDirPath}/../../../../../devices/MKL03Z4/utilities/fsl_debug_console.h"
"${KsdkDir}/devices/MKL03Z4/system_MKL03Z4.c"
"${KsdkDir}/devices/MKL03Z4/system_MKL03Z4.h"
"${KsdkDir}/devices/MKL03Z4/drivers/fsl_gpio.h"
"${KsdkDir}/devices/MKL03Z4/drivers/fsl_gpio.c"
#"${KsdkDir}/../clock_config.c"
#"${rojDirPath}/../clock_config.h"
"${KsdkDir}/devices/MKL03Z4/drivers/fsl_smc.h"
"${KsdkDir}/devices/MKL03Z4/drivers/fsl_smc.c"
"${KsdkDir}/devices/MKL03Z4/drivers/fsl_clock.h"
"${KsdkDir}/devices/MKL03Z4/drivers/fsl_clock.c"
)
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -T${KsdkDir}/devices/MKL03Z4/gcc/MKL03Z32xxx4_flash.ld -static")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -T${KsdkDir}/devices/MKL03Z4/gcc/MKL03Z32xxx4_flash.ld -static")
TARGET_LINK_LIBRARIES(uhk-left.elf -Wl,--start-group)
target_link_libraries(uhk-left.elf debug m)
target_link_libraries(uhk-left.elf debug c)
target_link_libraries(uhk-left.elf debug gcc)
target_link_libraries(uhk-left.elf debug nosys)
target_link_libraries(uhk-left.elf optimized m)
target_link_libraries(uhk-left.elf optimized c)
target_link_libraries(uhk-left.elf optimized gcc)
target_link_libraries(uhk-left.elf optimized nosys)
TARGET_LINK_LIBRARIES(uhk-left.elf -Wl,--end-group)

View File

@@ -1,6 +0,0 @@
echo "This script is not supposed to work. Please port the BASH version to Windows!"
cmake -DCMAKE_TOOLCHAIN_FILE="%KSDK_DIR%/tools/cmake_toolchain_files/armgcc.cmake" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug .
mingw32-make -j4
cmake -DCMAKE_TOOLCHAIN_FILE="%KSDK_DIR%/tools/cmake_toolchain_files/armgcc.cmake" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release .
mingw32-make -j4
pause

View File

@@ -1,3 +0,0 @@
#!/bin/sh
./build_debug.sh
./build_release.sh

View File

@@ -1,4 +0,0 @@
echo "This script is not supposed to work. Please port the BASH version to Windows!"
cmake -DCMAKE_TOOLCHAIN_FILE="%KSDK_DIR%/tools/cmake_toolchain_files/armgcc.cmake" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug .
mingw32-make -j4
pause

View File

@@ -1,4 +0,0 @@
#!/bin/sh
. ./ksdk_dir.sh
cmake -DCMAKE_TOOLCHAIN_FILE="$KSDK_DIR/tools/cmake_toolchain_files/armgcc.cmake" -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug .
make -j4

View File

@@ -1,4 +0,0 @@
echo "This script is not supposed to work. Please port the BASH version to Windows!"
cmake -DCMAKE_TOOLCHAIN_FILE="%KSDK_DIR%/tools/cmake_toolchain_files/armgcc.cmake" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release .
mingw32-make -j4
pause

View File

@@ -1,4 +0,0 @@
#!/bin/sh
. ./ksdk_dir.sh
cmake -DCMAKE_TOOLCHAIN_FILE="$KSDK_DIR/tools/cmake_toolchain_files/armgcc.cmake" -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .
make -j4

View File

@@ -1,3 +0,0 @@
RD /s /Q Debug Release CMakeFiles
DEL /s /Q /F Makefile cmake_install.cmake CMakeCache.txt
pause

View File

@@ -1,3 +0,0 @@
#!/bin/sh
rm -rf debug release CMakeFiles
rm -rf Makefile cmake_install.cmake CMakeCache.txt

View File

@@ -1,2 +0,0 @@
#!/bin/sh
export KSDK_DIR=/../../../lib/KSDK_2.0_MKL03Z8xxx4/

View File

@@ -11,8 +11,8 @@
"bugs": {
"url": "https://github.com/UltimateHackingKeyboard/firmware/issues"
},
"version": "2.0.0",
"version": "2.1.0",
"dataModelVersion": "1.0.0",
"usbProtocolVersion": "1.1.0",
"slaveProtocolVersion": "2.0.0"
"usbProtocolVersion": "1.2.0",
"slaveProtocolVersion": "2.1.0"
}

View File

@@ -1,15 +1,22 @@
#!/usr/bin/env sh
version=$1
version="$1"
if [ -z "$version" ]; then
echo "No version number is specified."
exit 1
fi
releaseName=uhk-firmware-$version
releaseDir=/tmp/$releaseName
rightFirmwareFile=right/build/kds/uhk-right-release-srec/uhk-right.srec
leftFirmwareFile=left/build/kds/uhk-left-release-srec/uhk-left.srec
chmod 644 $rightFirmwareFile $leftFirmwareFile
ls -l $rightFirmwareFile $leftFirmwareFile
rm -r $releaseDir
mkdir $releaseDir
cp $rightFirmwareFile $releaseDir
cp $leftFirmwareFile $releaseDir
echo $version > $releaseDir/version
cp package.json $releaseDir
tar -cvjSf $releaseName.tar.bz2 -C $releaseDir .

View File

@@ -1,239 +0,0 @@
INCLUDE(CMakeForceCompiler)
# CROSS COMPILER SETTING
SET(CMAKE_SYSTEM_NAME Generic)
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
# THE VERSION NUMBER
SET (Tutorial_VERSION_MAJOR 1)
SET (Tutorial_VERSION_MINOR 0)
# ENABLE ASM
ENABLE_LANGUAGE(ASM)
SET(CMAKE_STATIC_LIBRARY_PREFIX)
SET(CMAKE_STATIC_LIBRARY_SUFFIX)
SET(CMAKE_EXECUTABLE_LIBRARY_PREFIX)
SET(CMAKE_EXECUTABLE_LIBRARY_SUFFIX)
# CURRENT DIRECTORY
SET(SrcDir "${CMAKE_CURRENT_SOURCE_DIR}/../../src")
SET(KsdkDir "${SrcDir}/../../lib/KSDK_2.0_MK22FN512xxx12/")
SET(IncludeDir "${SrcDir}/../shared")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -DDEBUG")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -D__STARTUP_CLEAR_BSS")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -g")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -mcpu=cortex-m4")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -Wall")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -mfloat-abi=hard")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -mfpu=fpv4-sp-d16")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -mthumb")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -fno-common")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -ffunction-sections")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -fdata-sections")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -ffreestanding")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -fno-builtin")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -mapcs")
SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -std=gnu99")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -D__STARTUP_CLEAR_BSS")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -mcpu=cortex-m4")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -Wall")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -mfloat-abi=hard")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -mfpu=fpv4-sp-d16")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -mthumb")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -fno-common")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -ffunction-sections")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -fdata-sections")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -ffreestanding")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -fno-builtin")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -mapcs")
SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -std=gnu99")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG=1")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DCPU_MK22FN512VLH12")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DUSB_STACK_BM")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DFRDM_K22F")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DFREEDOM")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mcpu=cortex-m4")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mfloat-abi=hard")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mfpu=fpv4-sp-d16")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mthumb")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -MMD")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -MP")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fno-common")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ffunction-sections")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fdata-sections")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ffreestanding")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fno-builtin")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mapcs")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -std=gnu99")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -D_DEBUG=0")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DCPU_MK22FN512VLH12")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DUSB_STACK_BM")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DFRDM_K22F")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DFREEDOM")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Os")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mcpu=cortex-m4")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mfloat-abi=hard")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mfpu=fpv4-sp-d16")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mthumb")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -MMD")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -MP")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fno-common")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffunction-sections")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fdata-sections")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffreestanding")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fno-builtin")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mapcs")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -std=gnu99")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -mcpu=cortex-m4")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Wall")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -mfloat-abi=hard")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -mfpu=fpv4-sp-d16")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} --specs=nano.specs")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -fno-common")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -ffunction-sections")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -fdata-sections")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -ffreestanding")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -fno-builtin")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -mthumb")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -mapcs")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Xlinker")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} --gc-sections")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Xlinker")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -static")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Xlinker")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -z")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Xlinker")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} muldefs")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -g")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -mcpu=cortex-m4")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Wall")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -mfloat-abi=hard")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -mfpu=fpv4-sp-d16")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} --specs=nano.specs")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fno-common")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -ffunction-sections")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fdata-sections")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -ffreestanding")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fno-builtin")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -mthumb")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -mapcs")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Xlinker")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} --gc-sections")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Xlinker")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -static")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Xlinker")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -z")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Xlinker")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} muldefs")
include_directories(${SrcDir})
include_directories(${SrcDir}/ksdk_usb)
include_directories(${SrcDir}/usb_descriptors)
include_directories(${SrcDir}/../../shared)
include_directories(${KsdkDir}/middleware/usb_1.0.0)
include_directories(${KsdkDir}/middleware/usb_1.0.0/osa)
include_directories(${KsdkDir}/middleware/usb_1.0.0/include)
include_directories(${KsdkDir}/middleware/usb_1.0.0/device)
include_directories(${KsdkDir}/CMSIS/Include)
include_directories(${KsdkDir}/boards/frdmk22f)
include_directories(${KsdkDir}/devices/MK22F51212/drivers)
include_directories(${KsdkDir}/devices/MK22F51212)
include_directories(${IncludeDir})
add_executable(dev_composite_hid_mouse_hid_keyboard_bm.elf
"${KsdkDir}/devices/MK22F51212/gcc/startup_MK22F51212.S"
"${KsdkDir}/devices/MK22F51212/system_MK22F51212.c"
"${KsdkDir}/devices/MK22F51212/system_MK22F51212.h"
"${KsdkDir}/devices/MK22F51212/drivers/fsl_clock.h"
"${KsdkDir}/devices/MK22F51212/drivers/fsl_clock.c"
"${KsdkDir}/devices/MK22F51212/drivers/fsl_gpio.h"
"${KsdkDir}/devices/MK22F51212/drivers/fsl_gpio.c"
"${KsdkDir}/devices/MK22F51212/drivers/fsl_i2c.h"
"${KsdkDir}/devices/MK22F51212/drivers/fsl_i2c.c"
"${KsdkDir}/devices/MK22F51212/drivers/fsl_smc.h"
"${KsdkDir}/devices/MK22F51212/drivers/fsl_smc.c"
"${KsdkDir}/middleware/usb_1.0.0/device/usb_device_khci.c"
"${KsdkDir}/middleware/usb_1.0.0/device/usb_device_khci.h"
"${KsdkDir}/middleware/usb_1.0.0/device/usb_device.h"
"${KsdkDir}/middleware/usb_1.0.0/device/usb_device_dci.c"
"${KsdkDir}/middleware/usb_1.0.0/device/usb_device_dci.h"
"${KsdkDir}/middleware/usb_1.0.0/osa/usb_osa.h"
"${KsdkDir}/middleware/usb_1.0.0/osa/usb_osa_bm.h"
"${KsdkDir}/middleware/usb_1.0.0/osa/usb_osa_bm.c"
"${KsdkDir}/middleware/usb_1.0.0/include/usb.h"
"${SrcDir}/ksdk_usb/usb_device_class.c"
"${SrcDir}/ksdk_usb/usb_device_class.h"
"${SrcDir}/ksdk_usb/usb_device_hid.c"
"${SrcDir}/ksdk_usb/usb_device_hid.h"
"${SrcDir}/ksdk_usb/usb_device_ch9.c"
"${SrcDir}/ksdk_usb/usb_device_ch9.h"
"${SrcDir}/main.c"
"${SrcDir}/usb_composite_device.c"
"${SrcDir}/usb_composite_device.h"
"${SrcDir}/usb_descriptors/usb_descriptor_configuration.c"
"${SrcDir}/usb_descriptors/usb_descriptor_configuration.h"
"${SrcDir}/usb_descriptors/usb_descriptor_device.c"
"${SrcDir}/usb_descriptors/usb_descriptor_device.h"
"${SrcDir}/usb_descriptors/usb_descriptor_generic_hid_report.c"
"${SrcDir}/usb_descriptors/usb_descriptor_generic_hid_report.h"
"${SrcDir}/usb_descriptors/usb_descriptor_hid.c"
"${SrcDir}/usb_descriptors/usb_descriptor_hid.h"
"${SrcDir}/usb_descriptors/usb_descriptor_keyboard_report.c"
"${SrcDir}/usb_descriptors/usb_descriptor_keyboard_report.h"
"${SrcDir}/usb_descriptors/usb_descriptor_mouse_report.c"
"${SrcDir}/usb_descriptors/usb_descriptor_mouse_report.h"
"${SrcDir}/usb_descriptors/usb_descriptor_strings.c"
"${SrcDir}/usb_descriptors/usb_descriptor_strings.h"
"${SrcDir}/usb_device_config.h"
"${SrcDir}/usb_interface_generic_hid.c"
"${SrcDir}/usb_interface_generic_hid.h"
"${SrcDir}/usb_interface_keyboard.c"
"${SrcDir}/usb_interface_keyboard.h"
"${SrcDir}/usb_interface_mouse.c"
"${SrcDir}/usb_interface_mouse.h"
"${SrcDir}/init_peripherials.c"
"${SrcDir}/init_peripherials.h"
"${SrcDir}/init_clock.c"
"${SrcDir}/init_clock.h"
"${SrcDir}/led_driver.c"
"${SrcDir}/led_driver.h"
"${SrcDir}/reset_button.c"
"${SrcDir}/reset_button.h"
"${SrcDir}/test_led.c"
"${SrcDir}/test_led.h"
"${SrcDir}/usb_protocol_handler.c"
"${SrcDir}/usb_protocol_handler.h"
)
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -T${KsdkDir}/devices/MK22F51212/gcc/MK22FN512xxx12_flash.ld -static")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -T${KsdkDir}/devices/MK22F51212/gcc/MK22FN512xxx12_flash.ld -static")
TARGET_LINK_LIBRARIES(dev_composite_hid_mouse_hid_keyboard_bm.elf -Wl,--start-group)
target_link_libraries(dev_composite_hid_mouse_hid_keyboard_bm.elf debug m)
target_link_libraries(dev_composite_hid_mouse_hid_keyboard_bm.elf debug c)
target_link_libraries(dev_composite_hid_mouse_hid_keyboard_bm.elf debug gcc)
target_link_libraries(dev_composite_hid_mouse_hid_keyboard_bm.elf debug nosys)
target_link_libraries(dev_composite_hid_mouse_hid_keyboard_bm.elf optimized m)
target_link_libraries(dev_composite_hid_mouse_hid_keyboard_bm.elf optimized c)
target_link_libraries(dev_composite_hid_mouse_hid_keyboard_bm.elf optimized gcc)
target_link_libraries(dev_composite_hid_mouse_hid_keyboard_bm.elf optimized nosys)
TARGET_LINK_LIBRARIES(dev_composite_hid_mouse_hid_keyboard_bm.elf -Wl,--end-group)

View File

@@ -1,4 +0,0 @@
# ARM GCC build environment
This build environment is set up for command line use. Given that the development dependencies are
installed on your system you can use the available scripts to build the firmware with ARM GCC.

View File

@@ -1,6 +0,0 @@
echo "This script is not supposed to work. Please port the BASH version to Windows!"
cmake -DCMAKE_TOOLCHAIN_FILE="%KSDK_DIR%/tools/cmake_toolchain_files/armgcc.cmake" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug .
mingw32-make -j4
cmake -DCMAKE_TOOLCHAIN_FILE="%KSDK_DIR%/tools/cmake_toolchain_files/armgcc.cmake" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release .
mingw32-make -j4
pause

View File

@@ -1,3 +0,0 @@
#!/bin/sh
./build_debug.sh
./build_release.sh

View File

@@ -1,4 +0,0 @@
echo "This script is not supposed to work. Please port the BASH version to Windows!"
cmake -DCMAKE_TOOLCHAIN_FILE="%KSDK_DIR%/tools/cmake_toolchain_files/armgcc.cmake" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug .
mingw32-make -j4
pause

View File

@@ -1,4 +0,0 @@
#!/bin/sh
. ./ksdk_dir.sh
cmake -DCMAKE_TOOLCHAIN_FILE="$KSDK_DIR/tools/cmake_toolchain_files/armgcc.cmake" -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug .
make -j4

View File

@@ -1,4 +0,0 @@
echo "This script is not supposed to work. Please port the BASH version to Windows!"
cmake -DCMAKE_TOOLCHAIN_FILE="%KSDK_DIR%/tools/cmake_toolchain_files/armgcc.cmake" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release .
mingw32-make -j4
pause

View File

@@ -1,4 +0,0 @@
#!/bin/sh
. ./ksdk_dir.sh
cmake -DCMAKE_TOOLCHAIN_FILE="$KSDK_DIR/tools/cmake_toolchain_files/armgcc.cmake" -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .
make -j4

View File

@@ -1,3 +0,0 @@
RD /s /Q Debug Release CMakeFiles
DEL /s /Q /F Makefile cmake_install.cmake CMakeCache.txt
pause

View File

@@ -1,3 +0,0 @@
#!/bin/sh
rm -rf debug release CMakeFiles
rm -rf Makefile cmake_install.cmake CMakeCache.txt

View File

@@ -1,2 +0,0 @@
#!/bin/sh
export KSDK_DIR=/../../../lib/KSDK_2.0_MK22FN512xxx12/

View File

@@ -74,6 +74,7 @@
<listOptionValue builtIn="false" value="../../../src/ksdk_usb"/>
<listOptionValue builtIn="false" value="../../../src/buspal"/>
<listOptionValue builtIn="false" value="../../../src/buspal/bm_usb"/>
<listOptionValue builtIn="false" value="../../../../lib/bootloader/src"/>
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0"/>
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0/osa"/>
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0/include"/>
@@ -214,6 +215,7 @@
<listOptionValue builtIn="false" value="../../../src/ksdk_usb"/>
<listOptionValue builtIn="false" value="../../../src/buspal"/>
<listOptionValue builtIn="false" value="../../../src/buspal/bm_usb"/>
<listOptionValue builtIn="false" value="../../../../lib/bootloader/src"/>
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0"/>
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0/osa"/>
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0/include"/>
@@ -356,6 +358,7 @@
<listOptionValue builtIn="false" value="../../../src/ksdk_usb"/>
<listOptionValue builtIn="false" value="../../../src/buspal"/>
<listOptionValue builtIn="false" value="../../../src/buspal/bm_usb"/>
<listOptionValue builtIn="false" value="../../../../lib/bootloader/src"/>
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0"/>
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0/osa"/>
<listOptionValue builtIn="false" value="../../../../lib/KSDK_2.0_MK22FN512xxx12/middleware/usb_1.0.0/include"/>
@@ -456,11 +459,11 @@
<resource resourceType="PROJECT" workspacePath="/uhk-right"/>
</configuration>
<configuration configurationName="v6-debug-srec"/>
<configuration configurationName="v7-debug"/>
<configuration configurationName="v6-release"/>
<configuration configurationName="release">
<resource resourceType="PROJECT" workspacePath="/uhk-right"/>
</configuration>
<configuration configurationName="v6-release"/>
<configuration configurationName="v7-debug"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>

View File

@@ -30,6 +30,11 @@
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
<linkedResources>
<link>
<name>bootloader-shared</name>
<type>2</type>
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>drivers</name>
<type>2</type>
@@ -60,6 +65,16 @@
<type>2</type>
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>bootloader-shared/wormhole.c</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/lib/bootloader/src/bootloader/src/wormhole.c</locationURI>
</link>
<link>
<name>bootloader-shared/wormhole.h</name>
<type>1</type>
<locationURI>PARENT-3-PROJECT_LOC/lib/bootloader/src/bootloader/wormhole.h</locationURI>
</link>
<link>
<name>drivers/fsl_adc16.c</name>
<type>1</type>

View File

@@ -12,7 +12,7 @@
#include "bus_pal_hardware.h"
#include "bootloader_config.h"
#include "command.h"
#include "wormhole.h"
#include "bootloader/wormhole.h"
#include "eeprom.h"
key_matrix_t KeyMatrix = {

View File

@@ -174,6 +174,19 @@ status_t UhkModuleSlaveDriver_Update(uint8_t uhkModuleDriverId)
BoolBitsToBytes(rxMessage->data, CurrentKeyStates[slotId], uhkModuleState->features.keyCount);
}
status = kStatus_Uhk_NoTransfer;
*uhkModulePhase = UhkModulePhase_JumpToBootloader;
break;
// Jump to bootloader
case UhkModulePhase_JumpToBootloader:
if (uhkModuleState->jumpToBootloader) {
txMessage.data[0] = SlaveCommand_JumpToBootloader;
txMessage.length = 1;
status = tx(i2cAddress);
uhkModuleState->jumpToBootloader = false;
} else {
status = kStatus_Uhk_NoTransfer;
}
*uhkModulePhase = UhkModulePhase_SetTestLed;
break;

View File

@@ -47,8 +47,9 @@
UhkModulePhase_ProcessKeystates,
// Misc phases
UhkModulePhase_SetLedPwmBrightness,
UhkModulePhase_JumpToBootloader,
UhkModulePhase_SetTestLed,
UhkModulePhase_SetLedPwmBrightness,
} uhk_module_phase_t;
@@ -67,6 +68,7 @@
uint8_t firmwareI2cAddress;
uint8_t bootloaderI2cAddress;
uhk_module_features_t features;
bool jumpToBootloader;
} uhk_module_state_t;
typedef struct {

View File

@@ -4,7 +4,7 @@
#include "usb_descriptors/usb_descriptor_strings.h"
#include "bootloader_config.h"
#include "bus_pal_hardware.h"
#include "wormhole.h"
#include "bootloader/wormhole.h"
static usb_status_t UsbDeviceCallback(usb_device_handle handle, uint32_t event, void *param);
usb_composite_device_t UsbCompositeDevice;

View File

@@ -12,6 +12,6 @@
// Variables:
uint8_t UsbGenericHidReportDescriptor[USB_GENERIC_HID_REPORT_DESCRIPTOR_LENGTH];
extern uint8_t UsbGenericHidReportDescriptor[USB_GENERIC_HID_REPORT_DESCRIPTOR_LENGTH];
#endif

View File

@@ -9,7 +9,7 @@
#include "led_pwm.h"
#include "slave_scheduler.h"
#include "slave_drivers/uhk_module_driver.h"
#include "wormhole.h"
#include "bootloader/wormhole.h"
#include "peripherals/adc.h"
#include "eeprom.h"
#include "keymaps.h"
@@ -265,6 +265,18 @@ void getDebugInfo(void)
GenericHidOutBuffer[8] = (ticks >> 56) & 0xff;
*/}
void jumpToSlaveBootloader(void)
{
uint8_t uhkModuleDriverId = GenericHidInBuffer[1];
if (uhkModuleDriverId >= UHK_MODULE_MAX_COUNT) {
setError(JumpToBootloaderError_InvalidModuleDriverId);
return;
}
UhkModuleStates[uhkModuleDriverId].jumpToBootloader = true;
}
// The main protocol handler function
void UsbProtocolHandler(void)
@@ -316,6 +328,9 @@ void UsbProtocolHandler(void)
case UsbCommand_GetDebugInfo:
getDebugInfo();
break;
case UsbCommand_JumpToSlaveBootloader:
jumpToSlaveBootloader();
break;
default:
break;
}

View File

@@ -23,6 +23,7 @@
UsbCommand_ReadUserConfiguration = 15,
UsbCommand_GetKeyboardState = 16,
UsbCommand_GetDebugInfo = 17,
UsbCommand_JumpToSlaveBootloader = 18,
} usb_command_t;
typedef enum {
@@ -35,6 +36,10 @@
ConfigTransferResponse_BufferOutOfBounds = 2,
} config_transfer_response_t;
typedef enum {
JumpToBootloaderError_InvalidModuleDriverId = 1,
} jump_to_bootloader_error_t;
// Functions:
void UsbProtocolHandler(void);

View File

@@ -1,3 +0,0 @@
#include "wormhole.h"
wormhole_t ATTR_NO_INIT Wormhole;

View File

@@ -1,31 +0,0 @@
#ifndef __WORMHOLE_H__
#define __WORMHOLE_H__
// Includes:
#include <stdint.h>
#include "attributes.h"
// Macros:
#define WORMHOLE_MAGIC_NUMBER 0x3b04cd9e94521f9a
// Typedefs:
typedef enum {
EnumerationMode_Bootloader,
EnumerationMode_NormalKeyboard,
EnumerationMode_CompatibleKeyboard,
EnumerationMode_BusPal,
} enumeration_mode_t;
typedef struct {
uint64_t magicNumber;
uint8_t enumerationMode;
} wormhole_t;
// Variables:
extern wormhole_t ATTR_NO_INIT Wormhole;
#endif