Browse Source

Merge remote-tracking branch 'refs/remotes/kiibohd/master'

master
di0ib 7 years ago
parent
commit
435898a15d

+ 39
- 0
.travis.yml View File

@@ -8,6 +8,7 @@ language:

os:
- linux
- osx

compiler:
- clang
@@ -53,6 +54,34 @@ matrix:
env: DIR=Bootloader/Builds SCRIPT=mk20dx128vlf5.bash
- compiler: clang
env: DIR=Bootloader/Builds SCRIPT=mk20dx256vlh7.bash
# xcode *and* brew don't support clang ARMCCompiler for arm-none-eabi, sigh useless Apple
# Disabling Linux clang builds until Travis has less crappy repos available
- compiler: clang
env: DIR=Keyboards SCRIPT=infinity.bash
- compiler: clang
env: DIR=Keyboards SCRIPT=infinity_led.bash
- compiler: clang
env: DIR=Keyboards SCRIPT=ergodox.bash
- compiler: clang
env: DIR=Keyboards SCRIPT=whitefox.bash
- compiler: clang
env: DIR=Keyboards/Testing SCRIPT=uartout.bash
- compiler: clang
env: DIR=Keyboards/Testing SCRIPT=usbmuxuart.bash
- compiler: clang
env: DIR=Bootloader/Builds SCRIPT=mk20dx128vlf5.bash
- compiler: clang
env: DIR=Bootloader/Builds SCRIPT=mk20dx256vlh7.bash

# Package Setup
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install python3 ctags dfu-util tree; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$CC" == "gcc" ]]; then brew tap Caskroom/cask; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$CC" == "gcc" ]]; then brew install Caskroom/cask/gcc-arm-embedded; fi
# This may work, but we'd have to compile llvm...
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$CC" == "clang" ]]; then brew tap homebrew/versions; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$CC" == "clang" ]]; then brew install homebrew/versions/llvm38 --with-all-targets --with-asan --with-lld --HEAD; fi

# System setup
install:
@@ -65,6 +94,16 @@ install:
# Directory tree to validate kll.git
- tree

# Compiler Version
- ${CC} --version

# Python Version
- python --version
- python3 --version

# CMake Version
- cmake --version

# Run test script(s)
script:
- (cd ${DIR} && COMPILER=${CC} ./${SCRIPT})

+ 21
- 7
Bootloader/Builds/cmake.bash View File

@@ -84,21 +84,35 @@ done


# Run CMake commands
## TODO Check for windows and do windows specific things ##
mkdir -p "${BuildPath}"
cd "${BuildPath}"
cmake -DCHIP="${Chip}" -DCOMPILER="${Compiler}" "${CMakeListsPath}"
return_code=$?

# Cygwin
if [[ $(uname -s) == MINGW32_NT* ]] || [[ $(uname -s) == CYGWIN* ]]; then
if [[ -z "$wincmake_path" ]]; then
echo "Error wincmake_path environment variable has not been set, see -> https://github.com/kiibohd/controller/wiki/Windows-Setup"
exit 1
fi
echo "Cygwin Build"
PATH="$wincmake_path":"${PATH}" cmake -DCHIP="${Chip}" -DCOMPILER="${Compiler}" "${CMakeListsPath}" -G 'Unix Makefiles'

# Linux / Mac (and everything else)
else
cmake -DCHIP="${Chip}" -DCOMPILER="${Compiler}" "${CMakeListsPath}"
return_code=$?

fi

if [ $return_code != 0 ] ; then
echo "Error in cmake. Exiting..."
exit $return_code
echo "Error in cmake. Exiting..."
exit $return_code
fi

make
return_code=$?
if [ $return_code != 0 ] ; then
echo "Error in make. Exiting..."
exit $return_code
echo "Error in make. Exiting..."
exit $return_code
fi

echo "Firmware has been compiled into: '${BuildPath}'"

+ 5
- 4
Keyboards/cmake.bash View File

@@ -93,6 +93,7 @@ if [[ $(uname -s) == MINGW32_NT* ]] || [[ $(uname -s) == CYGWIN* ]]; then
echo "Error wincmake_path environment variable has not been set, see -> https://github.com/kiibohd/controller/wiki/Windows-Setup"
exit 1
fi
echo "Cygwin Build"
PATH="$wincmake_path":"${PATH}" cmake -DCHIP="${Chip}" -DCOMPILER="${Compiler}" -DScanModule="${ScanModule}" -DMacroModule="${MacroModule}" -DOutputModule="${OutputModule}" -DDebugModule="${DebugModule}" -DBaseMap="${BaseMap}" -DDefaultMap="${DefaultMap}" -DPartialMaps="${PartialMapsExpanded}" "${CMakeListsPath}" -G 'Unix Makefiles'
return_code=$?

@@ -104,15 +105,15 @@ else
fi

if [ $return_code != 0 ] ; then
echo "Error in cmake. Exiting..."
exit $return_code
echo "Error in cmake. Exiting..."
exit $return_code
fi

make
return_code=$?
if [ $return_code != 0 ] ; then
echo "Error in make. Exiting..."
exit $return_code
echo "Error in make. Exiting..."
exit $return_code
fi

echo "Firmware has been compiled into: '${BuildPath}'"

+ 20
- 0
Lib/CMake/buildinfo.cmake View File

@@ -80,8 +80,28 @@ execute_process ( COMMAND ${GIT_EXECUTABLE} rev-list --count HEAD
OUTPUT_VARIABLE Git_Commit_Number
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE res_var
)

#| Older versions of git (e.g. 1.7.1) dont' like rev-list --count
#| If there's an error, try again with a less efficient version
if ( NOT "${res_var}" STREQUAL "0" )
execute_process ( COMMAND ${GIT_EXECUTABLE} log --pretty=oneline
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE Git_Log_Lines
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE res_var
)

# Now we do some CMake wizardry to split lines in the variable so we have a list called contents
string ( REGEX REPLACE ";" "\\\\;" contents "${Git_Log_Lines}" )
string ( REGEX REPLACE "\n" ";" contents "${contents}" )

# Now we just have to measure the length of the list
list ( LENGTH contents Git_Commit_Number )
endif ()


#| Origin URL
execute_process ( COMMAND ${GIT_EXECUTABLE} config --get remote.origin.url
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}

+ 15
- 1
Lib/CMake/kll.cmake View File

@@ -1,6 +1,6 @@
###| CMAKE Kiibohd Controller KLL Configurator |###
#
# Written by Jacob Alexander in 2014-2015 for the Kiibohd Controller
# Written by Jacob Alexander in 2014-2016 for the Kiibohd Controller
#
# Released into the Public Domain
#
@@ -14,6 +14,20 @@
if ( "${MacroModule}" STREQUAL "PartialMap" )


###
# Python 3 is required for kll
# Check disabled for Win32 as it can't detect version correctly (we don't use Python directly through CMake anyways)
#

if ( NOT CMAKE_HOST_WIN32 )
# Required on systems where python is 2, not 3
set ( PYTHON_EXECUTABLE
python3
CACHE STRING "Python 3 Executable Path"
)
find_package ( PythonInterp 3 REQUIRED )
endif ()


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

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

@@ -314,6 +314,14 @@ void Macro_layerShift_capability( uint8_t state, uint8_t stateType, uint8_t *arg
// Cast pointer to uint8_t to uint16_t then access that memory location
uint16_t layer = *(uint16_t*)(&args[0]);

// Only set the layer if it is disabled
if ( LayerState[ layer ] != 0x00 && state == 0x01 )
return;

// Only unset the layer if it is enabled
if ( LayerState[ layer ] == 0x00 && state == 0x03 )
return;

Macro_layerState( state, stateType, layer, 0x01 );
}

@@ -1356,4 +1364,3 @@ void cliFunc_macroStep( char* args )
// Set the macro step counter, negative int's are cast to uint
macroStepCounter = count;
}


+ 1
- 1
Macro/basic/macro.c View File

@@ -173,7 +173,7 @@ inline void keyPressDetection( uint8_t *keys, uint8_t numberOfKeys, uint8_t *mod

inline void process_macros(void)
{
// Online process macros once (if some were found), until the next USB send
// Only process macros once (if some were found), until the next USB send
if ( USBKeys_Sent != 0 )
return;


+ 6
- 0
Output/pjrcUSB/arm/usb_dev.c View File

@@ -653,6 +653,12 @@ static void usb_setup()
print(NL);
#endif
USBKeys_Protocol = setup.wValue & 0xFF; // 0 - Boot Mode, 1 - NKRO Mode

// Force Boot Mode if defined by KLL
if ( USBProtocol_define == 0 )
{
USBKeys_Protocol = USBProtocol_define;
}
goto send;

case 0x03A1: /// HID GET_PROTOCOL

+ 2
- 1
README.markdown View File

@@ -7,7 +7,8 @@ The [KLL](https://github.com/kiibohd/kll) git repo is automatically cloned durin

Please refer to the [KLL](https://github.com/kiibohd/kll) repo or [kiibohd.com](http://kiibohd.com) for details on the KLL (Keyboard Layout Language) Spec.

[![](https://travis-ci.org/kiibohd/controller.svg?branch=master)](https://travis-ci.org/kiibohd/controller)
[![Travis Status](https://travis-ci.org/kiibohd/controller.svg?branch=master)](https://travis-ci.org/kiibohd/controller) [![Appveyor Status](https://ci.appveyor.com/api/projects/status/erfnnhlm3w5sinr3/branch/master?svg=true)](https://ci.appveyor.com/project/haata/controller/branch/master)


[![Visit our IRC channel](https://kiwiirc.com/buttons/irc.freenode.net/input.club.png)](https://kiwiirc.com/client/irc.freenode.net/#input.club)


+ 91
- 0
appveyor.yml View File

@@ -0,0 +1,91 @@
# appveyor file for kiibohd/controller
# Used to test out the Cygwin builds

# System Build Architecture
platform:
- x64


# Dependency Cache
cache:
# Cache gcc arm compiler (it's pruned to be under 100 MB)
# Invalidate whenever this file is changed
- c:/gcc-arm-none-eabi.zip -> appveyor.yml


# Build Matrix + Environment Variables
# NOTE: Only building using 32-bit on a 64-bit system. 64-bit Cygwin should also work fine (no reason to test atm)
environment:
global:
CYG_MIRROR: http://cygwin.uib.no
CYG_CACHE: C:/cygwin/var/cache/setup
CYG_ARCH: x86
CYG_ROOT: C:/cygwin
WIN_CMAKE: "/cygdrive/c/Program Files (x86)/CMake/bin"
ARM_COMPILER_URL: https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q2-update/+download/gcc-arm-none-eabi-5_4-2016q2-20160622-win32.zip
matrix:
# Input Club Keyboard Tests
- SCRIPT_DIR: Keyboards
SCRIPT: infinity.bash
- SCRIPT_DIR: Keyboards
SCRIPT: infinity_led.bash
- SCRIPT_DIR: Keyboards
SCRIPT: ergodox.bash
- SCRIPT_DIR: Keyboards
SCRIPT: whitefox.bash

# Debug Build Tests
- SCRIPT_DIR: Keyboards/Testing
SCRIPT: uartout.bash
- SCRIPT_DIR: Keyboards/Testing
SCRIPT: usbmuxuart.bash

# Bootloader Build Tests
- SCRIPT_DIR: Bootloader/Builds
SCRIPT: mk20dx128vlf5.bash
- SCRIPT_DIR: Bootloader/Builds
SCRIPT: mk20dx256vlh7.bash


# Commands run before cloning git repo
init:
- git config --global core.autocrlf input


# Setup Build Instance
install:
- 'appveyor DownloadFile http://cygwin.com/setup-%CYG_ARCH%.exe -FileName setup.exe'
- 'setup.exe -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P git -P make -P python3 -P ctags -P tree -P p7zip'
- '%CYG_ROOT%/bin/bash -lc "cygcheck -dc cygwin"'
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\"/%SCRIPT_DIR% && export wincmake_path=\"%WIN_CMAKE%\" && which cmake"'
- '%CYG_ROOT%/bin/bash -lc "ls -l /cygdrive/c"'
# Only download if cache is missing
- if not exist c:/gcc-arm-none-eabi.zip appveyor DownloadFile %ARM_COMPILER_URL% -FileName c:/gcc-arm-none-eabi.zip
# Always try to strip out the unnecessary binaries
# Necessary, so we can fit gcc-arm-none-eabi.zip into the dependency cache
# For ARM Cortex-M4 we only need armv7e-m (also supports Cortex-M7)
# https://en.wikipedia.org/wiki/ARM_architecture#Cores
- 7z d c:/gcc-arm-none-eabi.zip "armv6*" -r
- 7z d c:/gcc-arm-none-eabi.zip "armv7-m*" -r
- 7z d c:/gcc-arm-none-eabi.zip "armv7-ar*" -r
- 7z d c:/gcc-arm-none-eabi.zip "armv8*" -r
- 7z d c:/gcc-arm-none-eabi.zip "*.html" -r
- dir
- cmake --version


# Build Commands
build_script:
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && du -sh /cygdrive/c/gcc-arm-none-eabi.zip"'
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && 7z x -o/ /cygdrive/c/gcc-arm-none-eabi.zip"'
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && pwd"'
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && tree"'
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && which cmake"'
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && cmake --version"'
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\"/%SCRIPT_DIR% && export wincmake_path=\"%WIN_CMAKE%\" && export PATH=\"${wincmake_path}\":$PATH && which cmake"'
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\"/%SCRIPT_DIR% && export wincmake_path=\"%WIN_CMAKE%\" && export PATH=\"${wincmake_path}\":$PATH && cmake --version"'
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && git --version"'
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && python3 --version"'
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && arm-none-eabi-gcc --version"'
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\"/%SCRIPT_DIR% && export wincmake_path=\"%WIN_CMAKE%\" && COMPILER=gcc ./%SCRIPT%"'