mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-06-28 02:04:06 -04:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 15a106b1ef | |||
| ac9f9f9efb | |||
| ec83c0b185 | |||
| d300811009 | |||
| 27e6e27d3a | |||
| 5687fc7646 | |||
| ebe36ea83c | |||
| 6b205c3064 | |||
| b5d0c44690 | |||
| d0e0b9e583 | |||
| b0dc99fbd8 | |||
| 5b8dae0d61 | |||
| fd56a2a1dc | |||
| be9f6e679b | |||
| b53356f7ab | |||
| c402bac023 | |||
| a030e8094f |
+1
-4
@@ -52,12 +52,9 @@ quantum/version.h
|
||||
.history/
|
||||
build/
|
||||
cmake-build-debug
|
||||
# CMakeLists.txt
|
||||
CMakeLists.txt
|
||||
*.pdf
|
||||
|
||||
# cmake toolchain downloads
|
||||
/toolchains
|
||||
|
||||
# Let these ones be user specific, since we have so many different configurations
|
||||
*.code-workspace
|
||||
.stfolder
|
||||
|
||||
Vendored
-9
@@ -1,9 +0,0 @@
|
||||
[
|
||||
{
|
||||
"name": "AVR GCC",
|
||||
"compilers": {
|
||||
"CC": "C:\\QMK_MSYS\\mingw64\\bin\\avr-gcc.exe",
|
||||
"CXX": "C:\\QMK_MSYS\\mingw64\\bin\\avr-g++.exe"
|
||||
}
|
||||
}
|
||||
]
|
||||
Vendored
+2
-2
@@ -5,8 +5,8 @@
|
||||
// Configure glob patterns for excluding files and folders.
|
||||
"files.exclude": {
|
||||
"**/.build": true,
|
||||
// "**/*.hex": true,
|
||||
// "**/*.bin": true,
|
||||
"**/*.hex": true,
|
||||
"**/*.bin": true,
|
||||
"**/*.uf2": true
|
||||
},
|
||||
"files.associations": {
|
||||
|
||||
Vendored
-114
@@ -1,114 +0,0 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Load Keyboard",
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOn":[
|
||||
"Only Load Keyboard",
|
||||
"Configure CMake"
|
||||
],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Only Load Keyboard",
|
||||
"type": "shell",
|
||||
"command": "cmake -D QMK_KEYBOARD_FOLDER=\"${input:all_keyboards}\" -D QMK_KEYMAP_FOLDER=\"${input:keyboard_keymap}\" -P ${workspaceFolder}/cmake/ConfigureKeyboard.cmake",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Configure CMake",
|
||||
"type": "cmake",
|
||||
"command": "configure"
|
||||
},
|
||||
{
|
||||
"label": "Build",
|
||||
"problemMatcher": [
|
||||
{
|
||||
"base": "$gcc",
|
||||
"fileLocation": ["relative", "${workspaceFolder}/build"]
|
||||
},
|
||||
],
|
||||
"options": {
|
||||
"environment": {
|
||||
"CLICOLOR_FORCE": "1"
|
||||
}
|
||||
},
|
||||
"type": "cmake",
|
||||
"command": "build",
|
||||
"targets":[
|
||||
"${input:keyboard_target}"
|
||||
],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
},
|
||||
// {
|
||||
// "label": "Rebuild",
|
||||
// "problemMatcher": [
|
||||
// {
|
||||
// "base": "$gcc",
|
||||
// "fileLocation": ["relative", "${workspaceFolder}/build"]
|
||||
// },
|
||||
// ],
|
||||
// "options": {
|
||||
// "environment": {
|
||||
// "CLICOLOR_FORCE": "1"
|
||||
// }
|
||||
// },
|
||||
// "type": "cmake",
|
||||
// "command": "cleanRebuild",
|
||||
// "targets":[
|
||||
// "${input:keyboard_target}"
|
||||
// ],
|
||||
// "group": {
|
||||
// "kind": "build",
|
||||
// "isDefault": true
|
||||
// },
|
||||
// }
|
||||
],
|
||||
"inputs": [
|
||||
{
|
||||
"id": "keyboard_target",
|
||||
"type": "command",
|
||||
"command": "shellCommand.execute",
|
||||
"args": {
|
||||
"command": "type build\\targets",
|
||||
"description": "Target:",
|
||||
"fieldSeparator": "|"
|
||||
},
|
||||
},
|
||||
{
|
||||
"id": "all_keyboards",
|
||||
"type": "command",
|
||||
"command": "shellCommand.execute",
|
||||
"args": {
|
||||
"command": "type build\\all_keyboards",
|
||||
"description": "Keyboard:",
|
||||
"default": ""
|
||||
},
|
||||
},
|
||||
{
|
||||
"id": "keymap",
|
||||
"description": "Keymap:",
|
||||
"type": "pickString",
|
||||
"options":[
|
||||
"default"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "keyboard_keymap",
|
||||
"type": "command",
|
||||
"command": "shellCommand.execute",
|
||||
"args": {
|
||||
"command": "cmake -D QMK_KEYBOARD_FOLDER=\"${input:all_keyboards}\" -P ${workspaceFolder}/cmake/GetKeymaps.cmake && type build\\keyboard_keymaps",
|
||||
"description": "Keymap:",
|
||||
"default": ""
|
||||
},
|
||||
},
|
||||
]
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
|
||||
include(UpdateSubmodule)
|
||||
include(ResolveKeyboard)
|
||||
include(ValidateJson)
|
||||
include(ProcessKeyboard)
|
||||
|
||||
set(QMK_KEYBOARDS_FOLDER "${CMAKE_SOURCE_DIR}/keyboards")
|
||||
|
||||
function(_get_all_cmake_targets out_var current_dir)
|
||||
get_property(targets DIRECTORY ${current_dir} PROPERTY BUILDSYSTEM_TARGETS)
|
||||
get_property(subdirs DIRECTORY ${current_dir} PROPERTY SUBDIRECTORIES)
|
||||
|
||||
foreach(subdir ${subdirs})
|
||||
_get_all_cmake_targets(subdir_targets ${subdir})
|
||||
list(APPEND targets ${subdir_targets})
|
||||
endforeach()
|
||||
|
||||
set(${out_var} ${targets} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
if(NOT DEFINED QMK_KEYBOARD)
|
||||
# configure step - populate targets
|
||||
project(qmk_firmware)
|
||||
|
||||
add_subdirectory(keyboards)
|
||||
|
||||
else()
|
||||
# build step
|
||||
if(NOT DEFINED QMK_KEYMAP_FOLDER)
|
||||
set(QMK_KEYMAP_FOLDER "default")
|
||||
endif()
|
||||
|
||||
resolve_keyboard(${QMK_KEYBOARD_FOLDER} QMK_KEYBOARD_FOLDER_ABS)
|
||||
cmake_path(IS_PREFIX QMK_KEYBOARDS_FOLDER "${QMK_KEYBOARD_FOLDER_ABS}" IS_KEYBOARDS_FOLDER)
|
||||
resolve_config_h(${QMK_KEYBOARD_FOLDER_ABS} QMK_KEYBOARD_CONFIG_H)
|
||||
process_keyboard()
|
||||
resolve_keyboard_h(${QMK_KEYBOARD_FOLDER_ABS} QMK_KEYBOARD_H)
|
||||
resolve_keymap_c(${QMK_KEYBOARD_FOLDER_ABS} ${QMK_KEYMAP_FOLDER} QMK_KEYMAP_C)
|
||||
|
||||
message(STATUS "config.h: ${QMK_KEYBOARD_CONFIG_H}")
|
||||
message(STATUS "keyboard.h: ${QMK_KEYBOARD_H}")
|
||||
message(STATUS "keymap.c: ${QMK_KEYMAP_C}")
|
||||
|
||||
|
||||
project(${QMK_KEYBOARD}
|
||||
LANGUAGES C CXX ASM
|
||||
HOMEPAGE_URL ${URL}
|
||||
VERSION ${DEVICE_VER})
|
||||
|
||||
# add_compile_options(
|
||||
# -include ${QMK_KEYBOARD_CONFIG_H}
|
||||
# )
|
||||
add_compile_definitions(
|
||||
QMK_KEYBOARD_H="${QMK_KEYBOARD_H}"
|
||||
KEYBOARD_${QMK_KEYBOARD}
|
||||
KEYMAP_C="${QMK_KEYMAP_C}"
|
||||
MATRIX_ROWS=8
|
||||
MATRIX_COLS=6
|
||||
)
|
||||
|
||||
if(DEFINED DIODE_DIRECTION)
|
||||
add_compile_definitions(DIODE_DIRECTION=${DIODE_DIRECTION})
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR})
|
||||
|
||||
# if(EXISTS ${QMK_KEYBOARD_FOLDER_ABS}/CMakeLists.txt)
|
||||
# add_subdirectory(${QMK_KEYBOARD_FOLDER_ABS})
|
||||
# else()
|
||||
file(GLOB KEYBOARD_SRC "${QMK_KEYBOARD_FOLDER_ABS}/*.c")
|
||||
list(REMOVE_ITEM KEYBOARD_SRC "${QMK_KEYMAP_C}")
|
||||
add_qmk_executable(${TARGET_NAME} ${KEYBOARD_SRC})
|
||||
|
||||
# endif()
|
||||
# add_library(qmk)
|
||||
|
||||
target_precompile_headers(qmk PUBLIC
|
||||
${QMK_KEYBOARD_CONFIG_H}
|
||||
)
|
||||
|
||||
resolve_keyboard_includes(${QMK_KEYBOARD_FOLDER_ABS})
|
||||
|
||||
add_subdirectory(quantum)
|
||||
add_subdirectory(platforms)
|
||||
add_subdirectory(tmk_core/protocol)
|
||||
|
||||
include(features/oled)
|
||||
include(features/backlight)
|
||||
include(features/eeprom)
|
||||
include(features/matrix)
|
||||
include(features/fnv)
|
||||
endif()
|
||||
@@ -1,41 +0,0 @@
|
||||
{
|
||||
"MKL26Z64" : {
|
||||
"MCU" : "cortex-m0plus",
|
||||
"ARMV": 6,
|
||||
"MCU_FAMILY": "KINETIS",
|
||||
"MCU_SERIES": "KL2x",
|
||||
"MCU_LDSCRIPT": "MKL26Z64",
|
||||
"MCU_STARTUP": "kl2x",
|
||||
"BOARD": "PJRC_TEENSY_LC"
|
||||
},
|
||||
"MK20DX128" : {
|
||||
"MCU" : "cortex-m4",
|
||||
"ARMV": 7,
|
||||
"MCU_FAMILY": "KINETIS",
|
||||
"MCU_SERIES": "K20x",
|
||||
"MCU_LDSCRIPT": "MK20DX128",
|
||||
"MCU_STARTUP": "k20x5",
|
||||
"BOARD": "PJRC_TEENSY_3"
|
||||
},
|
||||
"MK20DX256" : {
|
||||
"MCU" : "cortex-m4",
|
||||
"ARMV": 7,
|
||||
"MCU_FAMILY": "KINETIS",
|
||||
"MCU_SERIES": "K20x",
|
||||
"MCU_LDSCRIPT": "MK20DX256",
|
||||
"MCU_STARTUP": "k20x7",
|
||||
"BOARD": "PJRC_TEENSY_3_1"
|
||||
},
|
||||
"STM32F303" : {
|
||||
"MCU" : "cortex-m4",
|
||||
"ARMV": 7,
|
||||
"MCU_FAMILY": "STM32",
|
||||
"MCU_SERIES": "STM32F3xx",
|
||||
"MCU_LDSCRIPT": "STM32F303xC",
|
||||
"MCU_STARTUP": "stm32f3xx",
|
||||
"BOARD": "GENERIC_STM32_F303XC",
|
||||
"USE_FPU": true,
|
||||
"UF2_FAMILY": "STM32F3",
|
||||
"STM32_BOOTLOADER_ADDRESS": "0x1FFFD800"
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
include(ResolveKeyboard)
|
||||
include(ValidateJson)
|
||||
include(ResolveToolchain)
|
||||
|
||||
macro(add_keyboard KEYBOARD_FOLDER KEYMAP_FOLDER)
|
||||
# not entirely sure why this is necessary
|
||||
# set(TEMP_PATH ${KEYBOARD_FOLDER})
|
||||
# cmake_path(IS_RELATIVE TEMP_PATH IS_KEYBOARD_FOLDER_RELATIVE)
|
||||
# if(${IS_KEYBOARD_FOLDER_RELATIVE})
|
||||
# set(KEYBOARD_FOLDER_ABS ${CMAKE_SOURCE_DIR}/keyboards/${KEYBOARD_FOLDER})
|
||||
# if(NOT EXISTS ${KEYBOARD_FOLDER_ABS})
|
||||
# # message(FATAL_ERROR "Keyboard does not exist in QMK - try using an absolute path to the keyboard folder")
|
||||
# resolve_keyboard(${KEYBOARD_FOLDER} KEYBOARD_FOLDER_ABS)
|
||||
# endif()
|
||||
# else()
|
||||
# set(KEYBOARD_FOLDER_ABS ${KEYBOARD_FOLDER})
|
||||
# if(NOT EXISTS ${KEYBOARD_FOLDER_ABS})
|
||||
# message(FATAL_ERROR "Absolute path to keyboard does not exist")
|
||||
# endif()
|
||||
# endif()
|
||||
|
||||
resolve_keyboard(${KEYBOARD_FOLDER} KEYBOARD_FOLDER_ABS)
|
||||
|
||||
set(TEMP_PATH ${KEYBOARD_FOLDER})
|
||||
cmake_path(IS_RELATIVE TEMP_PATH IS_KEYBOARD_FOLDER_RELATIVE)
|
||||
|
||||
set(TEMP_PATH ${KEYMAP_FOLDER})
|
||||
cmake_path(IS_RELATIVE TEMP_PATH IS_KEYMAP_FOLDER_RELATIVE)
|
||||
if(${IS_KEYMAP_FOLDER_RELATIVE})
|
||||
set(KEYMAP_NAME ${KEYMAP_FOLDER})
|
||||
else()
|
||||
if(WIN32)
|
||||
set(KEYMAP_NAME $ENV{USERNAME})
|
||||
else()
|
||||
set(KEYMAP_NAME $ENV{USE})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# find the right toolchain
|
||||
|
||||
# not sure we need to validate here
|
||||
validate_json(${KEYBOARD_FOLDER_ABS}/info.json keyboard JSON_STRING)
|
||||
|
||||
string(JSON PROCESSOR GET ${JSON_STRING} processor)
|
||||
resolve_toolchain(${PROCESSOR} TOOLCHAIN)
|
||||
|
||||
string(JSON KEYBOARD_NAME GET ${JSON_STRING} keyboard_name)
|
||||
if(${IS_KEYBOARD_FOLDER_RELATIVE})
|
||||
string(MAKE_C_IDENTIFIER ${KEYBOARD_FOLDER} KEYBOARD_SLUG)
|
||||
else()
|
||||
string(MAKE_C_IDENTIFIER ${KEYBOARD_NAME} KEYBOARD_SLUG)
|
||||
endif()
|
||||
string(JSON MANUFACTURER GET ${JSON_STRING} manufacturer)
|
||||
set(TARGET_NAME "${KEYBOARD_SLUG}_${KEYMAP_NAME}")
|
||||
ExternalProject_Add(${TARGET_NAME}
|
||||
SOURCE_DIR ${CMAKE_SOURCE_DIR}
|
||||
# PREFIX ${CMAKE_SOURCE_DIR}/build/keyboards/${KEYBOARD_FOLDER}
|
||||
TMP_DIR ${CMAKE_SOURCE_DIR}/build/tmp
|
||||
DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/build/download
|
||||
BINARY_DIR ${CMAKE_SOURCE_DIR}/build/keyboards/${TARGET_NAME}
|
||||
STAMP_DIR ${CMAKE_SOURCE_DIR}/build/stamp
|
||||
LOG_DIR ${CMAKE_SOURCE_DIR}/build/log
|
||||
INSTALL_DIR ${CMAKE_SOURCE_DIR}/build/install
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/build/${TARGET_NAME}${QMK_EXTENSION} ${CMAKE_SOURCE_DIR}/${TARGET_NAME}${QMK_EXTENSION}
|
||||
# this seems to work well for all systems so far - not sure if it'd be useful to customize
|
||||
CMAKE_GENERATOR "Unix Makefiles"
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake/toolchains/${TOOLCHAIN}.cmake
|
||||
-DQMK_KEYBOARD=${KEYBOARD_SLUG}
|
||||
-DQMK_KEYBOARD_FOLDER=${KEYBOARD_FOLDER}
|
||||
-DQMK_KEYMAP_FOLDER=${KEYMAP_FOLDER}
|
||||
-DTARGET_NAME=${TARGET_NAME}
|
||||
)
|
||||
ExternalProject_Add_Step(${TARGET_NAME} copy_compile_commands
|
||||
DEPENDEES configure
|
||||
DEPENDERS build
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/build/keyboards/${TARGET_NAME}/compile_commands.json ${CMAKE_SOURCE_DIR}/compile_commands.json
|
||||
# BYPRODUCTS ${CMAKE_SOURCE_DIR}/compile_commands.json
|
||||
ALWAYS TRUE
|
||||
)
|
||||
|
||||
# file(APPEND "${CMAKE_SOURCE_DIR}/build/targets" "${TARGET_NAME}|${KEYBOARD_NAME} with ${KEYMAP_FOLDER}|${KEYBOARD_FOLDER}|Made by: ${MANUFACTURER}\n")
|
||||
endmacro(add_keyboard)
|
||||
@@ -1,44 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
|
||||
include(ResolveKeyboard)
|
||||
include(ValidateJSON)
|
||||
|
||||
resolve_keyboard(${QMK_KEYBOARD_FOLDER} KEYBOARD_FOLDER_ABS)
|
||||
validate_json(${KEYBOARD_FOLDER_ABS}/info.json keyboard JSON_STRING)
|
||||
|
||||
if(NOT DEFINED QMK_KEYMAP_FOLDER)
|
||||
set(QMK_KEYMAP_FOLDER default)
|
||||
endif()
|
||||
|
||||
set(TEMP_PATH ${QMK_KEYBOARD_FOLDER})
|
||||
cmake_path(IS_RELATIVE TEMP_PATH IS_KEYBOARD_FOLDER_RELATIVE)
|
||||
|
||||
set(TEMP_PATH ${QMK_KEYMAP_FOLDER})
|
||||
cmake_path(IS_RELATIVE TEMP_PATH IS_KEYMAP_FOLDER_RELATIVE)
|
||||
|
||||
if(${IS_KEYMAP_FOLDER_RELATIVE})
|
||||
set(KEYMAP_NAME ${QMK_KEYMAP_FOLDER})
|
||||
else()
|
||||
if(WIN32)
|
||||
set(KEYMAP_NAME $ENV{USERNAME})
|
||||
else()
|
||||
set(KEYMAP_NAME $ENV{USE})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
string(JSON KEYBOARD_NAME GET ${JSON_STRING} keyboard_name)
|
||||
|
||||
if(${IS_KEYBOARD_FOLDER_RELATIVE})
|
||||
string(MAKE_C_IDENTIFIER ${QMK_KEYBOARD_FOLDER} KEYBOARD_SLUG)
|
||||
else()
|
||||
string(MAKE_C_IDENTIFIER ${KEYBOARD_NAME} KEYBOARD_SLUG)
|
||||
endif()
|
||||
|
||||
string(JSON MANUFACTURER GET ${JSON_STRING} manufacturer)
|
||||
|
||||
set(TARGET_NAME "${KEYBOARD_SLUG}_${KEYMAP_NAME}")
|
||||
file(APPEND "${CMAKE_SOURCE_DIR}/build/targets" "${TARGET_NAME}|${KEYBOARD_NAME} with ${QMK_KEYMAP_FOLDER}|${QMK_KEYBOARD_FOLDER}:${QMK_KEYMAP_FOLDER}|Made by: ${MANUFACTURER}\n")
|
||||
|
||||
message(STATUS "Added keyboard '${QMK_KEYBOARD_FOLDER}' with keymap '${QMK_KEYMAP_FOLDER}'")
|
||||
@@ -1,14 +0,0 @@
|
||||
macro(find_arm_toolchain)
|
||||
find_toolchain(arm-none-eabi TOOLCHAIN_ROOT)
|
||||
|
||||
if(NOT TOOLCHAIN_ROOT)
|
||||
include(GetARMToolchain)
|
||||
find_toolchain(arm-none-eabi TOOLCHAIN_ROOT)
|
||||
endif()
|
||||
|
||||
if(NOT TOOLCHAIN_ROOT)
|
||||
message(FATAL_ERROR "ARM Toolchain could not be found")
|
||||
endif()
|
||||
|
||||
message(STATUS "ARM toolchain found: ${TOOLCHAIN_ROOT}")
|
||||
endmacro()
|
||||
@@ -1,20 +0,0 @@
|
||||
macro(find_avr_toolchain)
|
||||
find_toolchain(avr TOOLCHAIN_ROOT)
|
||||
|
||||
if(NOT TOOLCHAIN_ROOT)
|
||||
include(GetAVRToolchain)
|
||||
find_toolchain(avr TOOLCHAIN_ROOT)
|
||||
endif()
|
||||
|
||||
find_program(DFU_PROGRAMMER NAMES dfu-programmer PATHS ${CMAKE_SOURCE_DIR}/toolchains/dfu-programmer/)
|
||||
if(${DFU_PROGRAMMER} STREQUAL "DFU_PROGRAMMER-NOTFOUND")
|
||||
include(GetDfuProgrammer)
|
||||
find_program(DFU_PROGRAMMER NAMES dfu-programmer PATHS ${CMAKE_SOURCE_DIR}/toolchains/dfu-programmer/)
|
||||
endif()
|
||||
|
||||
if(NOT TOOLCHAIN_ROOT)
|
||||
message(FATAL_ERROR "AVR Toolchain could not be found")
|
||||
endif()
|
||||
|
||||
message(STATUS "AVR toolchain found: ${TOOLCHAIN_ROOT}")
|
||||
endmacro()
|
||||
@@ -1,282 +0,0 @@
|
||||
include(ParseMakefile)
|
||||
|
||||
# STM32F303
|
||||
|
||||
set(MCU "cortex-m4")
|
||||
set(ARMV 7)
|
||||
set(MCU_FAMILY "STM32")
|
||||
set(MCU_SERIES "STM32F3xx")
|
||||
string(TOUPPER ${MCU_SERIES} MCU_SERIES_UPPER)
|
||||
set(MCU_LDSCRIPT "STM32F303xC")
|
||||
set(MCU_STARTUP "stm32f3xx")
|
||||
set(BOARD "GENERIC_STM32_F303XC")
|
||||
set(USE_FPU TRUE)
|
||||
set(UF2_FAMILY "STM32F3")
|
||||
set(STM32_BOOTLOADER_ADDRESS 0x1FFFD800)
|
||||
set(EEPROM_DRIVER "wear_leveling" FORCE)
|
||||
set(WEAR_LEVELING_DRIVER "embedded_flash" FORCE)
|
||||
|
||||
target_compile_definitions(qmk PUBLIC
|
||||
QMK_MCU_FAMILY_${MCU_FAMILY}
|
||||
QMK_MCU_SERIES_${MCU_SERIES_UPPER}
|
||||
)
|
||||
|
||||
target_compile_options(qmk PUBLIC
|
||||
-march=armv7-m
|
||||
)
|
||||
|
||||
target_compile_definitions(qmk PUBLIC
|
||||
MCU_${MCU_FAMILY}
|
||||
__ARM_ARCH_7M__
|
||||
)
|
||||
|
||||
# platforms/chibios/platform.mk
|
||||
|
||||
if(NOT DEFINED USE_PROCESS_STACKSIZE)
|
||||
set(USE_PROCESS_STACKSIZE 0x800)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED USE_EXCEPTIONS_STACKSIZE)
|
||||
set(USE_EXCEPTIONS_STACKSIZE 0x400)
|
||||
endif()
|
||||
|
||||
target_link_options(qmk PUBLIC
|
||||
-Wl,--defsym=__process_stack_size__=${USE_PROCESS_STACKSIZE},--defsym=__main_stack_size__=${USE_EXCEPTIONS_STACKSIZE}
|
||||
)
|
||||
|
||||
if(NOT DEFINED MCU_PORT_NAME)
|
||||
set(MCU_PORT_NAME ${MCU_FAMILY})
|
||||
endif()
|
||||
set(MCU_ARCH ${MCU})
|
||||
if(NOT DEFINED CHIBIOS_PORT)
|
||||
set(CHIBIOS_PORT "ARMv${ARMV}-M")
|
||||
endif()
|
||||
if(NOT DEFINED PLATFORM_NAME)
|
||||
set(PLATFORM_NAME platform)
|
||||
endif()
|
||||
|
||||
set(CHIBIOS ${CMAKE_SOURCE_DIR}/lib/chibios)
|
||||
set(CHIBIOS_CONTRIB ${CMAKE_SOURCE_DIR}/lib/chibios-contrib)
|
||||
|
||||
# port*.mk
|
||||
include(chibios/ports/${CHIBIOS_PORT})
|
||||
|
||||
# platform.mk
|
||||
include(chibios/ports/${MCU_SERIES})
|
||||
|
||||
# startup_*.mk - might need to convert these
|
||||
find_file(STARTUP_MK startup_${MCU_STARTUP}.mk
|
||||
${CHIBIOS}/os/common/ports/ARMCMx/compilers/GCC/mk
|
||||
${CHIBIOS}/os/common/startup/ARMCMx/compilers/GCC/mk
|
||||
${CHIBIOS_CONTRIB}/os/common/startup/ARMCMx/compilers/GCC/mk
|
||||
)
|
||||
get_filename_component(STARTUP_DIR ${STARTUP_MK} DIRECTORY)
|
||||
ParseMakefile(${STARTUP_MK})
|
||||
target_sources(qmk PUBLIC ${STARTUPSRC})
|
||||
target_sources(qmk PUBLIC ${STARTUPASM})
|
||||
target_include_directories(qmk PUBLIC ${STARTUPINC})
|
||||
|
||||
# board paths - we should just standardize these
|
||||
find_path(BOARD_PATH
|
||||
NAMES
|
||||
boards/${BOARD}/board.mk
|
||||
board/board.mk
|
||||
PATHS
|
||||
${QMK_KEYBOARD_FOLDER}/boards/${BOARD}
|
||||
${CMAKE_SOURCE_DIR}/platforms/chibios/boards/${BOARD}
|
||||
${CHIBIOS}/os/hal/
|
||||
${CHIBIOS_CONTRIB}/os/hal/
|
||||
)
|
||||
# if(EXISTS ${BOARD_PATH}/rules.mk)
|
||||
# ParseMakefile(${BOARD_PATH}/rules.mk)
|
||||
# endif()
|
||||
|
||||
if(EXISTS ${BOARD_PATH}/configs/config.h)
|
||||
target_precompile_headers(qmk PUBLIC
|
||||
${BOARD_PATH}/configs/config.h
|
||||
)
|
||||
endif()
|
||||
|
||||
if(EXISTS ${BOARD_PATH}/configs/post_config.h)
|
||||
target_precompile_headers(qmk PUBLIC
|
||||
${BOARD_PATH}/configs/post_config.h
|
||||
)
|
||||
endif()
|
||||
|
||||
find_file(BOARD_MK board.mk
|
||||
${BOARD_PATH}/boards/${BOARD}
|
||||
${BOARD_PATH}/board
|
||||
)
|
||||
ParseMakefile(${BOARD_MK})
|
||||
|
||||
target_sources(qmk PUBLIC ${BOARDSRC})
|
||||
target_include_directories(qmk PUBLIC ${BOARDINC})
|
||||
|
||||
# allow board.c to be overriden
|
||||
file(RELATIVE_PATH INIT_HOOK_RELATIVE ${CMAKE_BINARY_DIR}
|
||||
"${CMAKE_SOURCE_DIR}/tmk_core/protocol/chibios/init_hooks.h")
|
||||
set_source_files_properties(${BOARDSRC} TARGET_DIRECTORY qmk PROPERTIES
|
||||
# COMPILE_OPTIONS "-include ../../../tmk_core/protocol/chibios/init_hooks.h"
|
||||
COMPILE_OPTIONS "-include ${INIT_HOOK_RELATIVE}"
|
||||
)
|
||||
|
||||
# bootloader
|
||||
if(DEFINED STM32_BOOTLOADER_ADDRESS)
|
||||
target_compile_definitions(qmk PUBLIC STM32_BOOTLOADER_ADDRESS=${STM32_BOOTLOADER_ADDRESS})
|
||||
endif()
|
||||
if(DEFINED WB32_BOOTLOADER_ADDRESS)
|
||||
target_compile_definitions(qmk PUBLIC WB32_BOOTLOADER_ADDRESS=${WB32_BOOTLOADER_ADDRESS})
|
||||
endif()
|
||||
|
||||
find_file(BOOTLOADER_DEFS_H bootloader_defs.h
|
||||
${QMK_KEYBOARD_FOLDER}
|
||||
${QMK_KEYBOARD_FOLDER}/boards/${BOARD}
|
||||
${BOARD_PATH}/configs
|
||||
)
|
||||
if(EXISTS ${BOOTLOADER_DEFS_H})
|
||||
target_compile_options(qmk PUBLIC -include ${BOOTLOADER_DEFS_H})
|
||||
endif()
|
||||
|
||||
# chconf directories
|
||||
find_path(CHCONFDIR chconf.h
|
||||
${QMK_KEYBOARD_FOLDER}
|
||||
${CMAKE_SOURCE_DIR}/platforms/chibios/boards/${BOARD}/configs
|
||||
${CMAKE_SOURCE_DIR}/platforms/chibios/boards/common/configs
|
||||
)
|
||||
target_include_directories(qmk PUBLIC ${CHCONFDIR})
|
||||
|
||||
# halconf directories
|
||||
find_path(HALCONFDIR halconf.h
|
||||
${QMK_KEYBOARD_FOLDER}
|
||||
${CMAKE_SOURCE_DIR}/platforms/chibios/boards/${BOARD}/configs
|
||||
${CMAKE_SOURCE_DIR}/platforms/chibios/boards/common/configs
|
||||
)
|
||||
target_include_directories(qmk PUBLIC ${HALCONFDIR})
|
||||
|
||||
# linker script
|
||||
find_file(LDSCRIPT ${MCU_LDSCRIPT}.ld
|
||||
${QMK_KEYBOARD_FOLDER}/ld
|
||||
${CMAKE_SOURCE_DIR}/platforms/chibios/boards/${BOARD}/ld
|
||||
${CMAKE_SOURCE_DIR}/platforms/chibios/boards/common/ld
|
||||
${STARTUPLD}
|
||||
${STARTUPLD_CONTRIB}
|
||||
)
|
||||
get_filename_component(LDSCRIPT_PATH ${LDSCRIPT} DIRECTORY)
|
||||
target_link_options(qmk PUBLIC
|
||||
-T ${LDSCRIPT}
|
||||
-L ${LDSCRIPT_PATH}
|
||||
)
|
||||
|
||||
# os/hal/hal.mk
|
||||
target_sources(qmk PUBLIC
|
||||
${CHIBIOS}/os/hal/src/hal.c
|
||||
${CHIBIOS}/os/hal/src/hal_st.c
|
||||
${CHIBIOS}/os/hal/src/hal_buffers.c
|
||||
${CHIBIOS}/os/hal/src/hal_queues.c
|
||||
${CHIBIOS}/os/hal/src/hal_flash.c
|
||||
${CHIBIOS}/os/hal/src/hal_mmcsd.c
|
||||
${CHIBIOS}/os/hal/src/hal_adc.c
|
||||
${CHIBIOS}/os/hal/src/hal_can.c
|
||||
${CHIBIOS}/os/hal/src/hal_crypto.c
|
||||
${CHIBIOS}/os/hal/src/hal_dac.c
|
||||
${CHIBIOS}/os/hal/src/hal_efl.c
|
||||
${CHIBIOS}/os/hal/src/hal_gpt.c
|
||||
${CHIBIOS}/os/hal/src/hal_i2c.c
|
||||
${CHIBIOS}/os/hal/src/hal_i2s.c
|
||||
${CHIBIOS}/os/hal/src/hal_icu.c
|
||||
${CHIBIOS}/os/hal/src/hal_mac.c
|
||||
${CHIBIOS}/os/hal/src/hal_mmc_spi.c
|
||||
${CHIBIOS}/os/hal/src/hal_pal.c
|
||||
${CHIBIOS}/os/hal/src/hal_pwm.c
|
||||
${CHIBIOS}/os/hal/src/hal_rtc.c
|
||||
${CHIBIOS}/os/hal/src/hal_sdc.c
|
||||
${CHIBIOS}/os/hal/src/hal_serial.c
|
||||
${CHIBIOS}/os/hal/src/hal_serial_usb.c
|
||||
${CHIBIOS}/os/hal/src/hal_sio.c
|
||||
${CHIBIOS}/os/hal/src/hal_spi.c
|
||||
${CHIBIOS}/os/hal/src/hal_trng.c
|
||||
${CHIBIOS}/os/hal/src/hal_uart.c
|
||||
${CHIBIOS}/os/hal/src/hal_usb.c
|
||||
${CHIBIOS}/os/hal/src/hal_wdg.c
|
||||
${CHIBIOS}/os/hal/src/hal_wspi.c
|
||||
)
|
||||
target_include_directories(qmk PUBLIC
|
||||
${CHIBIOS}/os/hal/include
|
||||
)
|
||||
|
||||
# os/hal/osal/rt-nil/osal.mk
|
||||
target_sources(qmk PUBLIC
|
||||
${CHIBIOS}/os/hal/osal/rt-nil/osal.c
|
||||
)
|
||||
target_include_directories(qmk PUBLIC
|
||||
${CHIBIOS}/os/hal/osal/rt-nil
|
||||
)
|
||||
|
||||
# os/rt/rt.mk
|
||||
target_sources(qmk PUBLIC
|
||||
${CHIBIOS}/os/rt/src/chsys.c
|
||||
${CHIBIOS}/os/rt/src/chrfcu.c
|
||||
${CHIBIOS}/os/rt/src/chdebug.c
|
||||
${CHIBIOS}/os/rt/src/chtrace.c
|
||||
${CHIBIOS}/os/rt/src/chvt.c
|
||||
${CHIBIOS}/os/rt/src/chschd.c
|
||||
${CHIBIOS}/os/rt/src/chinstances.c
|
||||
${CHIBIOS}/os/rt/src/chthreads.c
|
||||
${CHIBIOS}/os/rt/src/chsys.c
|
||||
${CHIBIOS}/os/rt/src/chrfcu.c
|
||||
${CHIBIOS}/os/rt/src/chdebug.c
|
||||
${CHIBIOS}/os/rt/src/chtrace.c
|
||||
${CHIBIOS}/os/rt/src/chvt.c
|
||||
${CHIBIOS}/os/rt/src/chschd.c
|
||||
${CHIBIOS}/os/rt/src/chinstances.c
|
||||
${CHIBIOS}/os/rt/src/chthreads.c
|
||||
${CHIBIOS}/os/rt/src/chtm.c
|
||||
${CHIBIOS}/os/rt/src/chstats.c
|
||||
${CHIBIOS}/os/rt/src/chregistry.c
|
||||
${CHIBIOS}/os/rt/src/chsem.c
|
||||
${CHIBIOS}/os/rt/src/chmtx.c
|
||||
${CHIBIOS}/os/rt/src/chcond.c
|
||||
${CHIBIOS}/os/rt/src/chevents.c
|
||||
${CHIBIOS}/os/rt/src/chmsg.c
|
||||
${CHIBIOS}/os/rt/src/chdynamic.c
|
||||
)
|
||||
target_include_directories(qmk PUBLIC
|
||||
${CHIBIOS}/os/rt/include
|
||||
)
|
||||
|
||||
# os/oslib/oslib.mk
|
||||
target_sources(qmk PUBLIC
|
||||
${CHIBIOS}/os/oslib/src/chmboxes.c
|
||||
${CHIBIOS}/os/oslib/src/chmemcore.c
|
||||
${CHIBIOS}/os/oslib/src/chmemheaps.c
|
||||
${CHIBIOS}/os/oslib/src/chmempools.c
|
||||
${CHIBIOS}/os/oslib/src/chpipes.c
|
||||
${CHIBIOS}/os/oslib/src/chobjcaches.c
|
||||
${CHIBIOS}/os/oslib/src/chdelegates.c
|
||||
${CHIBIOS}/os/oslib/src/chfactory.c
|
||||
)
|
||||
target_include_directories(qmk PUBLIC
|
||||
${CHIBIOS}/os/oslib/include
|
||||
)
|
||||
|
||||
# os/hal/lib/streams/streams.mk
|
||||
target_sources(qmk PUBLIC
|
||||
${CHIBIOS}/os/hal/lib/streams/chprintf.c
|
||||
${CHIBIOS}/os/hal/lib/streams/chscanf.c
|
||||
${CHIBIOS}/os/hal/lib/streams/memstreams.c
|
||||
${CHIBIOS}/os/hal/lib/streams/nullstreams.c
|
||||
${CHIBIOS}/os/hal/lib/streams/bufstreams.c
|
||||
)
|
||||
target_include_directories(qmk PUBLIC
|
||||
${CHIBIOS}/os/hal/lib/streams
|
||||
)
|
||||
|
||||
# resume platform.mk
|
||||
target_sources(qmk PUBLIC
|
||||
${CHIBIOS}/os/various/syscalls.c
|
||||
)
|
||||
target_include_directories(qmk PUBLIC
|
||||
${CHIBIOS}/os/license
|
||||
${CHIBIOS}/os/oslib/include
|
||||
${CHIBIOS}/os/various
|
||||
)
|
||||
@@ -1,27 +0,0 @@
|
||||
include(UpdateSubmodule)
|
||||
update_submodule(lib/lufa)
|
||||
set(LUFA_PATH ${CMAKE_SOURCE_DIR}/lib/lufa)
|
||||
set(LUFA_ROOT_PATH ${LUFA_PATH}/LUFA)
|
||||
target_sources(qmk PUBLIC
|
||||
${LUFA_ROOT_PATH}/Drivers/USB/Core/${ARCH}/USBController_${ARCH}.c
|
||||
${LUFA_ROOT_PATH}/Drivers/USB/Core/${ARCH}/USBInterrupt_${ARCH}.c
|
||||
${LUFA_ROOT_PATH}/Drivers/USB/Core/ConfigDescriptors.c
|
||||
${LUFA_ROOT_PATH}/Drivers/USB/Core/Events.c
|
||||
${LUFA_ROOT_PATH}/Drivers/USB/Core/USBTask.c
|
||||
${LUFA_ROOT_PATH}/Drivers/USB/Class/Common/HIDParser.c
|
||||
|
||||
${LUFA_ROOT_PATH}/Drivers/USB/Core/${ARCH}/Host_${ARCH}.c
|
||||
${LUFA_ROOT_PATH}/Drivers/USB/Core/${ARCH}/Pipe_${ARCH}.c
|
||||
${LUFA_ROOT_PATH}/Drivers/USB/Core/${ARCH}/PipeStream_${ARCH}.c
|
||||
${LUFA_ROOT_PATH}/Drivers/USB/Core/HostStandardReq.c
|
||||
|
||||
${LUFA_ROOT_PATH}/Drivers/USB/Core/${ARCH}/Device_${ARCH}.c
|
||||
${LUFA_ROOT_PATH}/Drivers/USB/Core/${ARCH}/Endpoint_${ARCH}.c
|
||||
${LUFA_ROOT_PATH}/Drivers/USB/Core/${ARCH}/EndpointStream_${ARCH}.c
|
||||
${LUFA_ROOT_PATH}/Drivers/USB/Core/DeviceStandardReq.c
|
||||
${LUFA_PATH}/LUFA/Drivers/USB/USB.h
|
||||
)
|
||||
target_include_directories(qmk PUBLIC ${LUFA_PATH})
|
||||
# target_link_libraries(lufa ${QMK_TARGET})
|
||||
# target_link_libraries(lufa tmk_core_protocol)
|
||||
# target_link_libraries(lufa tmk_core_protocol_lufa)
|
||||
@@ -1,24 +0,0 @@
|
||||
message("Downloading gcc-arm-none-eabi")
|
||||
if(WIN32)
|
||||
file(DOWNLOAD
|
||||
https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-win32.zip?rev=8f4a92e2ec2040f89912f372a55d8cf3&hash=8A9EAF77EF1957B779C59EADDBF2DAC118170BBF
|
||||
${CMAKE_SOURCE_DIR}/toolchains/downloads/gcc-arm-none-eabi-win32.zip
|
||||
EXPECTED_HASH MD5=2bc8f0c4c4659f8259c8176223eeafc1
|
||||
SHOW_PROGRESS
|
||||
)
|
||||
file(ARCHIVE_EXTRACT
|
||||
INPUT ${CMAKE_SOURCE_DIR}/toolchains/downloads/gcc-arm-none-eabi-win32.zip
|
||||
DESTINATION ${CMAKE_SOURCE_DIR}/toolchains/
|
||||
)
|
||||
elseif(UNIX)
|
||||
file(DOWNLOAD
|
||||
https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2?rev=78196d3461ba4c9089a67b5f33edf82a&hash=D484B37FF37D6FC3597EBE2877FB666A41D5253B
|
||||
${CMAKE_SOURCE_DIR}/toolchains/downloads/gcc-arm-none-eabi-x86_64-linux.tar.bz2
|
||||
EXPECTED_HASH MD5=3fe3d8bb693bd0a6e4615b6569443d0d
|
||||
SHOW_PROGRESS
|
||||
)
|
||||
file(ARCHIVE_EXTRACT
|
||||
INPUT ${CMAKE_SOURCE_DIR}/toolchains/downloads/gcc-arm-none-eabi-x86_64-linux.tar.bz2
|
||||
DESTINATION ${CMAKE_SOURCE_DIR}/toolchains/
|
||||
)
|
||||
endif()
|
||||
@@ -1,24 +0,0 @@
|
||||
message("Downloading avr-gcc")
|
||||
if(WIN32)
|
||||
file(DOWNLOAD
|
||||
https://github.com/ZakKemble/avr-gcc-build/releases/download/v12.1.0-1/avr-gcc-12.1.0-x64-windows.zip
|
||||
${CMAKE_SOURCE_DIR}/toolchains/downloads/avr-gcc-x64-windows.zip
|
||||
EXPECTED_HASH SHA256=e921a964fdeaedbe963352d0f26c6520a0a3eb8effc6ff232f3824b06c4ea0e2
|
||||
SHOW_PROGRESS
|
||||
)
|
||||
file(ARCHIVE_EXTRACT
|
||||
INPUT ${CMAKE_SOURCE_DIR}/toolchains/downloads/avr-gcc-x64-windows.zip
|
||||
DESTINATION ${CMAKE_SOURCE_DIR}/toolchains/
|
||||
)
|
||||
elseif(UNIX)
|
||||
file(DOWNLOAD
|
||||
https://github.com/ZakKemble/avr-gcc-build/releases/download/v12.1.0-1/avr-gcc-12.1.0-x64-linux.tar.bz2
|
||||
${CMAKE_SOURCE_DIR}/toolchains/downloads/avr-gcc-x64-linux.tar.bz2
|
||||
EXPECTED_HASH SHA256=feb034f4b85237032da8bac1f03765af5ebc4a8939b69bed57ff31bc482ca1a6
|
||||
SHOW_PROGRESS
|
||||
)
|
||||
file(ARCHIVE_EXTRACT
|
||||
INPUT ${CMAKE_SOURCE_DIR}/toolchains/downloads/avr-gcc-x64-linux.tar.bz2
|
||||
DESTINATION ${CMAKE_SOURCE_DIR}/toolchains/
|
||||
)
|
||||
endif()
|
||||
@@ -1,22 +0,0 @@
|
||||
message("Downloading dfu-programmer")
|
||||
if(WIN32)
|
||||
file(DOWNLOAD
|
||||
https://github.com/dfu-programmer/dfu-programmer/releases/download/v1.0.0/dfu-programmer-x64-1.0.0.7z
|
||||
${CMAKE_SOURCE_DIR}/toolchains/downloads/dfu-programmer-x64-1.0.0.7z
|
||||
SHOW_PROGRESS
|
||||
)
|
||||
file(ARCHIVE_EXTRACT
|
||||
INPUT ${CMAKE_SOURCE_DIR}/toolchains/downloads/dfu-programmer-x64-1.0.0.7z
|
||||
DESTINATION ${CMAKE_SOURCE_DIR}/toolchains/dfu-programmer/
|
||||
)
|
||||
elseif(UNIX)
|
||||
file(DOWNLOAD
|
||||
https://github.com/dfu-programmer/dfu-programmer/releases/download/v1.0.0/dfu-programmer-linux-1.0.0.7z
|
||||
${CMAKE_SOURCE_DIR}/toolchains/downloads/dfu-programmer-linux-1.0.0.7z
|
||||
SHOW_PROGRESS
|
||||
)
|
||||
file(ARCHIVE_EXTRACT
|
||||
INPUT ${CMAKE_SOURCE_DIR}/toolchains/downloads/dfu-programmer-linux-1.0.0.7z
|
||||
DESTINATION ${CMAKE_SOURCE_DIR}/toolchains/dfu-programmer/
|
||||
)
|
||||
endif()
|
||||
@@ -1,51 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
|
||||
include(ResolveKeyboard)
|
||||
include(ValidateJson)
|
||||
|
||||
set(QMK_KEYBOARDS_FOLDER "${CMAKE_SOURCE_DIR}/keyboards")
|
||||
set(CMAKE_MESSAGE_INDENT "")
|
||||
|
||||
resolve_keyboard(${QMK_KEYBOARD_FOLDER} KEYBOARD_FOLDER_ABS)
|
||||
validate_json(${KEYBOARD_FOLDER_ABS}/info.json keyboard JSON_STR)
|
||||
cmake_path(IS_PREFIX QMK_KEYBOARDS_FOLDER "${KEYBOARD_FOLDER_ABS}" IS_KEYBOARDS_FOLDER)
|
||||
|
||||
file(WRITE "${CMAKE_SOURCE_DIR}/build/keyboard_keymaps" "")
|
||||
if(${IS_KEYBOARDS_FOLDER})
|
||||
file(RELATIVE_PATH RELATIVE_KEYBOARD_FOLDER ${QMK_KEYBOARDS_FOLDER} ${KEYBOARD_FOLDER_ABS})
|
||||
while(NOT ${RELATIVE_KEYBOARD_FOLDER} STREQUAL "")
|
||||
file(GLOB KEYMAPS "${QMK_KEYBOARDS_FOLDER}/${RELATIVE_KEYBOARD_FOLDER}/keymaps/*/keymap.c")
|
||||
foreach(KEYMAP ${KEYMAPS})
|
||||
file(RELATIVE_PATH KEYMAP_C "${QMK_KEYBOARDS_FOLDER}/${RELATIVE_KEYBOARD_FOLDER}/keymaps" "${KEYMAP}")
|
||||
get_filename_component(KEYMAP_FOLDER ${KEYMAP_C} DIRECTORY)
|
||||
# message(STATUS "${KEYMAP_FOLDER}")
|
||||
file(APPEND "${CMAKE_SOURCE_DIR}/build/keyboard_keymaps" "${KEYMAP_FOLDER}\n")
|
||||
endforeach()
|
||||
get_filename_component(RELATIVE_KEYBOARD_FOLDER ${RELATIVE_KEYBOARD_FOLDER} DIRECTORY)
|
||||
endwhile()
|
||||
else()
|
||||
if(EXISTS "${KEYBOARD_FOLDER_ABS}/keymap.c")
|
||||
set(${KEYMAP_C_STR} "${KEYBOARD_FOLDER_ABS}/keymap.c" PARENT_SCOPE)
|
||||
elseif(EXISTS "${KEYBOARD_FOLDER_ABS}/keymaps/${KEYMAP_FOLDER}/keymap.c")
|
||||
set(${KEYMAP_C_STR} "${KEYBOARD_FOLDER_ABS}/keymaps/${KEYMAP_FOLDER}/keymap.c" PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
string(JSON COMMUNITY_LAYOUTS ERROR_VARIABLE NO_COMMUNITY_LAYOUTS GET ${JSON_STR} community_layouts)
|
||||
|
||||
if(${NO_COMMUNITY_LAYOUTS} STREQUAL "NOTFOUND")
|
||||
string(JSON NUM_LAYOUTS LENGTH ${COMMUNITY_LAYOUTS})
|
||||
math(EXPR MAX "${NUM_LAYOUTS} - 1")
|
||||
foreach(IDX RANGE ${MAX})
|
||||
string(JSON LAYOUT GET ${COMMUNITY_LAYOUTS} ${IDX})
|
||||
file(GLOB KEYMAPS "${CMAKE_SOURCE_DIR}/layouts/community/${LAYOUT}/*/keymap.c")
|
||||
foreach(KEYMAP ${KEYMAPS})
|
||||
file(RELATIVE_PATH KEYMAP_C "${CMAKE_SOURCE_DIR}/layouts/community/${LAYOUT}" "${KEYMAP}")
|
||||
get_filename_component(KEYMAP_FOLDER ${KEYMAP_C} DIRECTORY)
|
||||
# message(STATUS "${KEYMAP_FOLDER}")
|
||||
file(APPEND "${CMAKE_SOURCE_DIR}/build/keyboard_keymaps" "${KEYMAP_FOLDER}\n")
|
||||
endforeach()
|
||||
endforeach()
|
||||
endif()
|
||||
@@ -1,64 +0,0 @@
|
||||
# Simple CMake utility to read variables from MK files
|
||||
# - Gets contents from given file (name or path)
|
||||
# - Parses the assignment statements
|
||||
# - Makes the same assignments in the PARENT_SCOPE
|
||||
|
||||
if(POLICY CMP0007)
|
||||
cmake_policy(SET CMP0007 NEW)
|
||||
endif()
|
||||
|
||||
function(ParseHeader HeaderFile Prefix)
|
||||
_ParseHeader(${HeaderFile} ${Prefix})
|
||||
endfunction()
|
||||
|
||||
macro(_ParseHeader HeaderFile Prefix)
|
||||
message(CHECK_START "Parsing Header")
|
||||
list(APPEND CMAKE_MESSAGE_INDENT " ")
|
||||
message(STATUS "Reading \"${HeaderFile}\"")
|
||||
|
||||
file(READ "${HeaderFile}" FileContents)
|
||||
string(REGEX REPLACE "/\\*.*\\*/" "" FileContents ${FileContents})
|
||||
# replace the \ newlines with spaces
|
||||
string(REGEX REPLACE "\\\\\r?\n *" " " FileContents ${FileContents})
|
||||
# turn each line into an item in a list
|
||||
string(REGEX REPLACE "\r?\n" ";" FileLines ${FileContents})
|
||||
list(REMOVE_ITEM FileLines "")
|
||||
|
||||
foreach(line ${FileLines})
|
||||
# remove comments from the ends of each line
|
||||
string(REGEX REPLACE "//.*" "" line ${line})
|
||||
|
||||
# remove now-empty lines
|
||||
if("${line}" STREQUAL "")
|
||||
continue()
|
||||
endif()
|
||||
|
||||
# try to process includes, if the file exists
|
||||
if(line MATCHES "^#include \"(.+)\"")
|
||||
set(INCLUDED_HEADER ${CMAKE_MATCH_1})
|
||||
if(EXISTS ${INCLUDED_HEADER})
|
||||
_ParseHeader("${INCLUDED_HEADER}" ${Prefix})
|
||||
else()
|
||||
message(STATUS "Could not read ${INCLUDED_HEADER}")
|
||||
endif()
|
||||
continue()
|
||||
endif()
|
||||
|
||||
# array
|
||||
if(line MATCHES "#define ([A-Za-z0-9_]+) {(.*)}")
|
||||
set(VARIABLE_NAME ${CMAKE_MATCH_1})
|
||||
set(VARIABLE_VALUE ${CMAKE_MATCH_2})
|
||||
set(${Prefix}${VARIABLE_NAME} ${VARIABLE_VALUE})
|
||||
endif()
|
||||
|
||||
# regular variable
|
||||
if(line MATCHES "#define ([A-Za-z0-9_]+) (.*)")
|
||||
set(VARIABLE_NAME ${CMAKE_MATCH_1})
|
||||
set(VARIABLE_VALUE ${CMAKE_MATCH_2})
|
||||
set(${Prefix}${VARIABLE_NAME} ${VARIABLE_VALUE})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
list(POP_BACK CMAKE_MESSAGE_INDENT)
|
||||
message(CHECK_PASS "Complete")
|
||||
endmacro()
|
||||
@@ -1,98 +0,0 @@
|
||||
# Simple CMake utility to read variables from MK files
|
||||
# - Gets contents from given file (name or path)
|
||||
# - Parses the assignment statements
|
||||
# - Makes the same assignments in the PARENT_SCOPE
|
||||
|
||||
if(POLICY CMP0007)
|
||||
cmake_policy(SET CMP0007 NEW)
|
||||
endif()
|
||||
|
||||
function(ParseMakefile MKFile)
|
||||
_ParseMakefile(${MKFile} ${ARGN})
|
||||
endfunction()
|
||||
|
||||
macro(_ParseMakefile MKFile)
|
||||
message(CHECK_START "Parsing Makefile")
|
||||
list(APPEND CMAKE_MESSAGE_INDENT " ")
|
||||
message(STATUS "Reading \"${MKFile}\"")
|
||||
|
||||
file(READ "${MKFile}" FileContents)
|
||||
# replace the \ newlines with spaces
|
||||
string(REGEX REPLACE "\\\\\r?\n *" " " FileContents ${FileContents})
|
||||
# turn each line into an item in a list
|
||||
string(REGEX REPLACE "\r?\n" ";" FileLines ${FileContents})
|
||||
list(REMOVE_ITEM FileLines "")
|
||||
|
||||
foreach(line ${FileLines})
|
||||
# remove comments from the ends of each line
|
||||
string(REGEX REPLACE "#.*" "" line ${line})
|
||||
|
||||
# remove now-empty lines
|
||||
if("${line}" STREQUAL "")
|
||||
continue()
|
||||
endif()
|
||||
|
||||
# try to process includes, if the file exists
|
||||
if(line MATCHES "^-?include (.+)$")
|
||||
set(MAKE_CHILD ${CMAKE_MATCH_1})
|
||||
if(EXISTS ${MAKE_CHILD})
|
||||
_ParseMakefile("${MAKE_CHILD}" ${ARGN})
|
||||
else()
|
||||
message(STATUS "Could not read ${MAKE_CHILD}")
|
||||
endif()
|
||||
continue()
|
||||
endif()
|
||||
|
||||
# turn the assignment into a list with the first item being the variable name
|
||||
string(REPLACE "=" ";" line_split ${line})
|
||||
list(LENGTH line_split count)
|
||||
|
||||
if(count LESS 2)
|
||||
message(STATUS "Skipping ${line}")
|
||||
continue()
|
||||
endif()
|
||||
|
||||
list(GET line_split -1 value)
|
||||
string(STRIP ${value} value)
|
||||
# separate_arguments(value)
|
||||
# string(REPLACE " " ";" value ${value})
|
||||
list(REMOVE_AT line_split -1)
|
||||
|
||||
foreach(var_name ${line_split})
|
||||
string(STRIP ${var_name} var_name)
|
||||
# replace $(?) with the variable ? from cmake
|
||||
if(value MATCHES "\\$\\(([^\\(\\)]+)\\)")
|
||||
set(MAKE_VARIABLE "${CMAKE_MATCH_1}")
|
||||
string(REPLACE "$(${MAKE_VARIABLE})" "${${MAKE_VARIABLE}}" value ${value})
|
||||
endif()
|
||||
|
||||
# look for +, assuming it used to be +=
|
||||
if(${var_name} MATCHES "([^ \\+]+) *\\+")
|
||||
message(STATUS "Appending \"${CMAKE_MATCH_1}\" with \"${value}\"")
|
||||
# read parent variable in local & append
|
||||
set(LOCAL_${CMAKE_MATCH_1} ${CMAKE_MATCH_1})
|
||||
# APPEND accepts spaces between values
|
||||
list(APPEND LOCAL_${CMAKE_MATCH_1} ${value})
|
||||
set(${CMAKE_MATCH_1} ${LOCAL_${CMAKE_MATCH_1}})
|
||||
set(${CMAKE_MATCH_1} ${LOCAL_${CMAKE_MATCH_1}} PARENT_SCOPE)
|
||||
else()
|
||||
# set needs ; between elements to be considered a list
|
||||
string(REGEX REPLACE " +" ";" value ${value})
|
||||
# try to find variable in cache and FORCE wtih INTERNAL if it exists
|
||||
if(DEFINED CACHE${${var_name}})
|
||||
message(STATUS "Caching \"${var_name}\" to \"${value}\"")
|
||||
# set locally so replacement still work
|
||||
set(${var_name} ${value})
|
||||
set(${var_name} ${value} CACHE INTERNAL "")
|
||||
else()
|
||||
message(STATUS "Setting \"${var_name}\" to \"${value}\"")
|
||||
set(${var_name} ${value})
|
||||
set(${var_name} ${value} PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
list(POP_BACK CMAKE_MESSAGE_INDENT)
|
||||
message(CHECK_PASS "Complete")
|
||||
endmacro()
|
||||
@@ -1,78 +0,0 @@
|
||||
include(ParseMakefile)
|
||||
include(Utils)
|
||||
|
||||
macro(process_keyboard)
|
||||
message(CHECK_START "Processing keyboard")
|
||||
list(APPEND CMAKE_MESSAGE_INDENT " ")
|
||||
|
||||
validate_json(${QMK_KEYBOARD_FOLDER_ABS}/info.json keyboard QMK_KEYBOARD_INFO_JSON_STRING)
|
||||
|
||||
# process rules from info.json
|
||||
file(READ ${CMAKE_SOURCE_DIR}/data/mappings/info_rules.hjson JSON_STRING)
|
||||
string(JSON MAPPING_LENGTH LENGTH ${JSON_STRING})
|
||||
math(EXPR MAX "${MAPPING_LENGTH} - 1")
|
||||
foreach(IDX RANGE ${MAX})
|
||||
string(JSON RULE_KEY MEMBER ${JSON_STRING} ${IDX})
|
||||
# string(JSON INFO_KEY GET ${JSON_STRING} ${RULE_KEY} info_key)
|
||||
json_get_with_default(INFO_KEY ${JSON_STRING} _ ${RULE_KEY} info_key)
|
||||
string(REPLACE "." " " INFO_KEYS ${INFO_KEY})
|
||||
string(JSON RULE_VALUE ERROR_VARIABLE RULE_KEY_NOT_FOUND GET ${QMK_KEYBOARD_INFO_JSON_STRING} ${INFO_KEYS})
|
||||
if(${RULE_KEY_NOT_FOUND} STREQUAL "NOTFOUND")
|
||||
json_get_with_default(VALUE_TYPE ${JSON_STRING} raw ${RULE_KEY} value_type)
|
||||
if(${VALUE_TYPE} STREQUAL "list")
|
||||
string(JSON NUM_VALUES LENGTH ${RULE_VALUE})
|
||||
math(EXPR MAX "${NUM_VALUES} - 1")
|
||||
foreach(IDX RANGE ${MAX})
|
||||
string(JSON VALUE GET ${RULE_VALUE} ${IDX})
|
||||
list(APPEND ${RULE_KEY} ${VALUE})
|
||||
endforeach()
|
||||
message(STATUS "Found rule '${INFO_KEY}': '${${RULE_KEY}}' assigned to '${RULE_KEY}'")
|
||||
else()
|
||||
set(${RULE_KEY} ${RULE_VALUE})
|
||||
message(STATUS "Found rule '${INFO_KEY}': '${RULE_VALUE}' assigned to '${RULE_KEY}'")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# process definitions from info.json
|
||||
file(READ ${CMAKE_SOURCE_DIR}/data/mappings/info_config.hjson JSON_STRING)
|
||||
string(JSON MAPPING_LENGTH LENGTH ${JSON_STRING})
|
||||
math(EXPR MAX "${MAPPING_LENGTH} - 1")
|
||||
foreach(IDX RANGE ${MAX})
|
||||
string(JSON CONFIG_KEY MEMBER ${JSON_STRING} ${IDX})
|
||||
json_get_with_default(INFO_KEY ${JSON_STRING} _ ${CONFIG_KEY} info_key)
|
||||
string(REPLACE "." ";" INFO_KEYS ${INFO_KEY})
|
||||
# string(JSON CONFIG_VALUE ERROR_VARIABLE CONFIG_KEY_NOT_FOUND GET ${QMK_KEYBOARD_INFO_JSON_STRING} ${INFO_KEYS})
|
||||
json_get_with_default(CONFIG_VALUE ${QMK_KEYBOARD_INFO_JSON_STRING} NOTFOUND ${INFO_KEYS})
|
||||
if(NOT CONFIG_VALUE STREQUAL "NOTFOUND")
|
||||
set(${CONFIG_KEY} ${CONFIG_VALUE})
|
||||
json_get_with_default(VALUE_TYPE ${JSON_STRING} raw ${CONFIG_KEY} value_type)
|
||||
if(${VALUE_TYPE} STREQUAL "str")
|
||||
add_compile_definitions(${CONFIG_KEY}="${CONFIG_VALUE}")
|
||||
message(STATUS "Found definition '${INFO_KEY}': '\"${CONFIG_VALUE}\"' assigned to '${CONFIG_KEY}'")
|
||||
elseif(${VALUE_TYPE} STREQUAL "bcd_version")
|
||||
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)" VERSION_MATCH ${CONFIG_VALUE})
|
||||
set(VERSION_MAJOR ${CMAKE_MATCH_1})
|
||||
set(VERSION_MINOR ${CMAKE_MATCH_2})
|
||||
set(VERSION_PATCH ${CMAKE_MATCH_3})
|
||||
math(EXPR BCD_VERSION "${VERSION_MAJOR} * 10000 + ${VERSION_MINOR} * 100 + ${VERSION_PATCH}" OUTPUT_FORMAT HEXADECIMAL)
|
||||
add_compile_definitions(${CONFIG_KEY}=${BCD_VERSION})
|
||||
message(STATUS "Found definition '${INFO_KEY}': '${BCD_VERSION}' assigned to '${CONFIG_KEY}'")
|
||||
else()
|
||||
add_compile_definitions(${CONFIG_KEY}=${CONFIG_VALUE})
|
||||
message(STATUS "Found definition '${INFO_KEY}': '${CONFIG_VALUE}' assigned to '${CONFIG_KEY}'")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
string(JSON KEYBOARD_NAME GET ${QMK_KEYBOARD_INFO_JSON_STRING} keyboard_name)
|
||||
string(JSON MANUFACTURER GET ${QMK_KEYBOARD_INFO_JSON_STRING} manufacturer)
|
||||
string(JSON URL GET ${QMK_KEYBOARD_INFO_JSON_STRING} url)
|
||||
string(JSON QMK_MCU GET ${QMK_KEYBOARD_INFO_JSON_STRING} processor)
|
||||
|
||||
list(POP_BACK CMAKE_MESSAGE_INDENT)
|
||||
message(CHECK_PASS "info.json validated and loaded")
|
||||
|
||||
|
||||
ParseMakefile(${QMK_KEYBOARD_FOLDER_ABS}/rules.mk)
|
||||
endmacro()
|
||||
@@ -1,146 +0,0 @@
|
||||
include(Utils)
|
||||
|
||||
function(resolve_keyboard KEYBOARD KEYBOAD_FOLDER_ABS_STR)
|
||||
message(VERBOSE "Resolving ${KEYBOARD}")
|
||||
if(EXISTS "${CMAKE_SOURCE_DIR}/keyboards/${KEYBOARD}")
|
||||
message(VERBOSE "Found in repo: ${KEYBOARD}")
|
||||
set(${KEYBOAD_FOLDER_ABS_STR} "${CMAKE_SOURCE_DIR}/keyboards/${KEYBOARD}" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
if(EXISTS "${CMAKE_SOURCE_DIR}/build/keyboard_repository/${KEYBOARD}")
|
||||
message(VERBOSE "Already checked out: ${KEYBOARD}")
|
||||
set(${KEYBOAD_FOLDER_ABS_STR} "${CMAKE_SOURCE_DIR}/build/keyboard_repository/${KEYBOARD}" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
file(READ ${CMAKE_SOURCE_DIR}/data/keyboards.json KEYBOARDS_JSON)
|
||||
string(JSON KEYBOARD_SLUG ERROR_VARIABLE JSON_ERROR GET ${KEYBOARDS_JSON} ${KEYBOARD})
|
||||
if(${JSON_ERROR} STREQUAL "NOTFOUND")
|
||||
message(VERBOSE "Found ${KEYBOARD_SLUG}")
|
||||
if(${KEYBOARD_SLUG} MATCHES "^@([0-9a-zA-Z_]+/[0-9a-zA-Z_]+)")
|
||||
# keyboard slug is mapped to a github repo
|
||||
set(GIT_SLUG ${CMAKE_MATCH_1})
|
||||
# string(MAKE_C_IDENTIFIER ${KEYBOARD} KEYBOARD_NAME)
|
||||
message(VERBOSE "Cloning ${GIT_SLUG}")
|
||||
find_package(Git QUIET)
|
||||
if(GIT_FOUND)
|
||||
file(MAKE_DIRECTORY "${CMAKE_SOURCE_DIR}/build/keyboard_repository/${KEYBOARD}")
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} clone "https://github.com/${GIT_SLUG}.git" .
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/build/keyboard_repository/${KEYBOARD}"
|
||||
RESULT_VARIABLE GIT_SUBMOD_RESULT)
|
||||
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
|
||||
message(FATAL_ERROR "git clone failed with ${GIT_SUBMOD_RESULT}")
|
||||
endif()
|
||||
else()
|
||||
message("Git not found - skipping submodule update")
|
||||
endif()
|
||||
set(${KEYBOAD_FOLDER_ABS_STR} "${CMAKE_SOURCE_DIR}/build/keyboard_repository/${KEYBOARD}" PARENT_SCOPE)
|
||||
else()
|
||||
message(FATAL_ERROR "Didn't match")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Couldn't find")
|
||||
# set(${RESULT_STR} "NOTFOUND" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(resolve_config_h KEYBOARD_FOLDER_ABS CONFIG_H_STR)
|
||||
set(${CONFIG_H_STR} PARENT_SCOPE)
|
||||
if(${IS_KEYBOARDS_FOLDER})
|
||||
file(RELATIVE_PATH RELATIVE_KEYBOARD_FOLDER ${QMK_KEYBOARDS_FOLDER} ${KEYBOARD_FOLDER_ABS})
|
||||
# get the deepest config.h
|
||||
while(NOT ${RELATIVE_KEYBOARD_FOLDER} STREQUAL "")
|
||||
if(EXISTS "${QMK_KEYBOARDS_FOLDER}/${RELATIVE_KEYBOARD_FOLDER}/config.h")
|
||||
parent_list(PREPEND ${CONFIG_H_STR} "${QMK_KEYBOARDS_FOLDER}/${RELATIVE_KEYBOARD_FOLDER}/config.h")
|
||||
# set(${CONFIG_H_STR} "${QMK_KEYBOARDS_FOLDER}/${RELATIVE_KEYBOARD_FOLDER}/config.h" PARENT_SCOPE)
|
||||
# return()
|
||||
endif()
|
||||
get_filename_component(RELATIVE_KEYBOARD_FOLDER ${RELATIVE_KEYBOARD_FOLDER} DIRECTORY)
|
||||
endwhile()
|
||||
# message(FATAL_ERROR "Could not find config.h in ${KEYBOARD_FOLDER_ABS}")
|
||||
else()
|
||||
if(EXISTS "${KEYBOARD_FOLDER_ABS}/config.h")
|
||||
set(${CONFIG_H_STR} "${KEYBOARD_FOLDER_ABS}/config.h" PARENT_SCOPE)
|
||||
else()
|
||||
message(FATAL_ERROR "Could not find config.h in ${KEYBOARD_FOLDER_ABS}")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(resolve_keyboard_h KEYBOARD_FOLDER_ABS KEYBOARD_H_STR)
|
||||
if(${IS_KEYBOARDS_FOLDER})
|
||||
file(RELATIVE_PATH RELATIVE_KEYBOARD_FOLDER ${QMK_KEYBOARDS_FOLDER} ${KEYBOARD_FOLDER_ABS})
|
||||
# get the deepest header
|
||||
while(NOT ${RELATIVE_KEYBOARD_FOLDER} STREQUAL "")
|
||||
get_filename_component(LAST_PART ${RELATIVE_KEYBOARD_FOLDER} NAME)
|
||||
if(EXISTS "${QMK_KEYBOARDS_FOLDER}/${RELATIVE_KEYBOARD_FOLDER}/${LAST_PART}.h")
|
||||
set(${KEYBOARD_H_STR} "${QMK_KEYBOARDS_FOLDER}/${RELATIVE_KEYBOARD_FOLDER}/${LAST_PART}.h" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
get_filename_component(RELATIVE_KEYBOARD_FOLDER ${RELATIVE_KEYBOARD_FOLDER} DIRECTORY)
|
||||
endwhile()
|
||||
message(FATAL_ERROR "Could not find *.h in ${KEYBOARD_FOLDER_ABS}")
|
||||
else()
|
||||
if(EXISTS "${KEYBOARD_FOLDER_ABS}/keyboard.h")
|
||||
set(${KEYBOARD_H_STR} "${KEYBOARD_FOLDER_ABS}/keyboard.h" PARENT_SCOPE)
|
||||
else()
|
||||
message(FATAL_ERROR "Could not find keyboard.h in ${KEYBOARD_FOLDER_ABS}")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(resolve_keymap_c KEYBOARD_FOLDER_ABS KEYMAP_FOLDER KEYMAP_C_STR)
|
||||
if(IS_ABSOLUTE ${KEYMAP_FOLDER})
|
||||
if(EXISTS "${KEYMAP_FOLDER}/keymap.c")
|
||||
set(${KEYMAP_C_STR} "${KEYMAP_FOLDER}/keymap.c" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
else()
|
||||
if(${IS_KEYBOARDS_FOLDER})
|
||||
file(RELATIVE_PATH RELATIVE_KEYBOARD_FOLDER ${QMK_KEYBOARDS_FOLDER} ${KEYBOARD_FOLDER_ABS})
|
||||
# get the deepest keymap.c
|
||||
while(NOT ${RELATIVE_KEYBOARD_FOLDER} STREQUAL "")
|
||||
if(EXISTS "${QMK_KEYBOARDS_FOLDER}/${RELATIVE_KEYBOARD_FOLDER}/keymaps/${KEYMAP_FOLDER}/keymap.c")
|
||||
set(${KEYMAP_C_STR} "${QMK_KEYBOARDS_FOLDER}/${RELATIVE_KEYBOARD_FOLDER}/keymaps/${KEYMAP_FOLDER}/keymap.c" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
get_filename_component(RELATIVE_KEYBOARD_FOLDER ${RELATIVE_KEYBOARD_FOLDER} DIRECTORY)
|
||||
endwhile()
|
||||
else()
|
||||
if(EXISTS "${KEYBOARD_FOLDER_ABS}/keymap.c")
|
||||
set(${KEYMAP_C_STR} "${KEYBOARD_FOLDER_ABS}/keymap.c" PARENT_SCOPE)
|
||||
return()
|
||||
elseif(EXISTS "${KEYBOARD_FOLDER_ABS}/keymaps/${KEYMAP_FOLDER}/keymap.c")
|
||||
set(${KEYMAP_C_STR} "${KEYBOARD_FOLDER_ABS}/keymaps/${KEYMAP_FOLDER}/keymap.c" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# string(JSON COMMUNITY_LAYOUTS ERROR_VARIABLE NO_COMMUNITY_LAYOUTS GET ${QMK_KEYBOARD_INFO_JSON_STRING} community_layouts)
|
||||
|
||||
# if(${NO_COMMUNITY_LAYOUTS} STREQUAL "NOTFOUND")
|
||||
# string(JSON NUM_LAYOUTS LENGTH ${COMMUNITY_LAYOUTS})
|
||||
# math(EXPR MAX "${NUM_LAYOUTS} - 1")
|
||||
foreach(LAYOUT ${LAYOUTS})
|
||||
# foreach(IDX RANGE ${MAX})
|
||||
# string(JSON LAYOUT GET ${COMMUNITY_LAYOUTS} ${IDX})
|
||||
if(EXISTS "${CMAKE_SOURCE_DIR}/layouts/community/${LAYOUT}/${KEYMAP_FOLDER}/keymap.c")
|
||||
set(${KEYMAP_C_STR} "${CMAKE_SOURCE_DIR}/layouts/community/${LAYOUT}/${KEYMAP_FOLDER}/keymap.c" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endforeach()
|
||||
# endif()
|
||||
message(FATAL_ERROR "Could not resolve keymap '${KEYMAP_FOLDER}'")
|
||||
endfunction()
|
||||
|
||||
function(resolve_keyboard_includes KEYBOARD_FOLDER_ABS)
|
||||
if(${IS_KEYBOARDS_FOLDER})
|
||||
file(RELATIVE_PATH RELATIVE_KEYBOARD_FOLDER ${QMK_KEYBOARDS_FOLDER} ${KEYBOARD_FOLDER_ABS})
|
||||
while(NOT ${RELATIVE_KEYBOARD_FOLDER} STREQUAL "")
|
||||
target_include_directories(qmk PUBLIC "${CMAKE_SOURCE_DIR}/keyboards/${RELATIVE_KEYBOARD_FOLDER}")
|
||||
get_filename_component(RELATIVE_KEYBOARD_FOLDER ${RELATIVE_KEYBOARD_FOLDER} DIRECTORY)
|
||||
endwhile()
|
||||
else()
|
||||
target_include_directories(qmk PUBLIC "${KEYBOARD_FOLDER_ABS}")
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -1,60 +0,0 @@
|
||||
function(resolve_toolchain PROCESSOR TOOLCHAIN_STR)
|
||||
unset(${TOOLCHAIN_STR} PARENT_SCOPE)
|
||||
if(
|
||||
${PROCESSOR} MATCHES "^at.*"
|
||||
)
|
||||
set(${TOOLCHAIN_STR} "avr" PARENT_SCOPE)
|
||||
set(QMK_EXTENSION ".hex" PARENT_SCOPE)
|
||||
include(FindAVRToolchain)
|
||||
find_avr_toolchain()
|
||||
elseif(
|
||||
${PROCESSOR} MATCHES "^STM.*" OR
|
||||
${PROCESSOR} MATCHES "^WB32.*" OR
|
||||
${PROCESSOR} MATCHES "^MK.*" OR
|
||||
${PROCESSOR} MATCHES "RP2040" OR
|
||||
${PROCESSOR} MATCHES "^GD32.*"
|
||||
)
|
||||
set(${TOOLCHAIN_STR} "arm-none-eabi" PARENT_SCOPE)
|
||||
set(QMK_EXTENSION ".bin" PARENT_SCOPE)
|
||||
include(FindARMToolchain)
|
||||
find_arm_toolchain()
|
||||
elseif(
|
||||
${PROCESSOR} MATCHES "risc-v"
|
||||
)
|
||||
set(${TOOLCHAIN_STR} "riscv32-unknown-elf" PARENT_SCOPE)
|
||||
set(QMK_EXTENSION ".bin" PARENT_SCOPE)
|
||||
else()
|
||||
message(FATAL_ERROR "Could not find toolchain for ${PROCESSOR}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(find_toolchain TOOLCHAIN TOOLCHAIN_ROOT_STR)
|
||||
unset(${TOOLCHAIN_STR} PARENT_SCOPE)
|
||||
if(UNIX)
|
||||
set(OS_SUFFIX "")
|
||||
find_path(TOOLCHAIN_ROOT
|
||||
NAMES
|
||||
${TOOLCHAIN}-gcc${OS_SUFFIX}
|
||||
PATHS
|
||||
"${CMAKE_SOURCE_DIR}/toolchains/avr-gcc/avr-gcc-12.1.0-x64-linux/bin/"
|
||||
"${CMAKE_SOURCE_DIR}/toolchains/gcc-arm-none-eabi-10.3-2021.10/bin/"
|
||||
/usr/bin/
|
||||
/usr/local/bin
|
||||
/bin/
|
||||
$ENV{AVR_ROOT}
|
||||
)
|
||||
elseif(WIN32)
|
||||
set(OS_SUFFIX ".exe")
|
||||
find_path(TOOLCHAIN_ROOT
|
||||
NAMES
|
||||
${TOOLCHAIN}-gcc${OS_SUFFIX}
|
||||
PATHS
|
||||
"${CMAKE_SOURCE_DIR}/toolchains/avr-gcc-12.1.0-x64-windows/bin"
|
||||
"${CMAKE_SOURCE_DIR}/toolchains/gcc-arm-none-eabi-10.3-2021.10/bin/"
|
||||
$ENV{AVR_ROOT}
|
||||
)
|
||||
else()
|
||||
message(FATAL_ERROR "Unsure how to handle this OS")
|
||||
endif(UNIX)
|
||||
set(${TOOLCHAIN_ROOT_STR} ${TOOLCHAIN_ROOT} PARENT_SCOPE)
|
||||
endfunction(find_toolchain)
|
||||
@@ -1,22 +0,0 @@
|
||||
# can be passed a relative path (to CMAKE_SOURCE_DIR) to update/checkout that submodule
|
||||
macro(update_submodule SUBMODULE)
|
||||
find_package(Git QUIET)
|
||||
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
option(GIT_SUBMODULE "Check submodules during build" ON)
|
||||
if(GIT_SUBMODULE)
|
||||
message(STATUS "Updating submoudle ${SUBMODULE}")
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update ${SUBMODULE}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
RESULT_VARIABLE GIT_SUBMOD_RESULT)
|
||||
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
|
||||
message(FATAL_ERROR "git submodule update ${SUBMODULE} failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
message("Git not found - skipping submodule update")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/${SUBMODULE}/.git")
|
||||
message(FATAL_ERROR "The submodule was not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
|
||||
endif()
|
||||
endmacro()
|
||||
@@ -1,25 +0,0 @@
|
||||
macro(json_get_with_default KEY_STR JSON_STR DEFAULT)
|
||||
# message(STATUS "Getting ${ARGN} for ${KEY_STR}")
|
||||
string(JSON ${KEY_STR} ERROR_VARIABLE JSON_ERROR GET ${JSON_STR} ${ARGN})
|
||||
if(NOT ${JSON_ERROR} STREQUAL "NOTFOUND")
|
||||
set(${KEY_STR} ${DEFAULT})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(json_get KEY_STR JSON_STR)
|
||||
# message(STATUS "Getting ${ARGN} for ${KEY_STR}")
|
||||
string(JSON ${KEY_STR} ERROR_VARIABLE JSON_ERROR GET ${JSON_STR} ${ARGN})
|
||||
if(NOT ${JSON_ERROR} STREQUAL "NOTFOUND")
|
||||
unset(${KEY_STR})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(parent_list ACTION LIST_STR)
|
||||
set(ARGS ${ARGN})
|
||||
string(REPLACE ";" " " ARGS ${ARGS})
|
||||
set(LOCAL_LIST ${${LIST_STR}})
|
||||
list(${ACTION} LOCAL_LIST ${ARGS})
|
||||
# set in current scope too
|
||||
set(${LIST_STR} ${LOCAL_LIST})
|
||||
set(${LIST_STR} ${LOCAL_LIST} PARENT_SCOPE)
|
||||
endmacro()
|
||||
@@ -1,199 +0,0 @@
|
||||
function(validate_json JSON_FILE SCHEMA_NAME JSON_STRING_STR)
|
||||
unset(${JSON_STRING_STR} PARENT_SCOPE)
|
||||
message(VERBOSE "Validating ${JSON_FILE} with '${SCHEMA_NAME}' schema")
|
||||
file(READ ${JSON_FILE} JSON_STRING)
|
||||
file(READ ${CMAKE_SOURCE_DIR}/data/schemas/${SCHEMA_NAME}.jsonschema SCHEMA_STRING)
|
||||
string(JSON SCHEMA_ID GET ${SCHEMA_STRING} $id)
|
||||
|
||||
set(DEFINITIONS "{}")
|
||||
file(READ ${CMAKE_SOURCE_DIR}/data/schemas/definitions.jsonschema DEFINITIONS_STRING)
|
||||
string(JSON DEFINITION_ID GET ${DEFINITIONS_STRING} $id)
|
||||
string(JSON DEFINITIONS SET ${DEFINITIONS} "${DEFINITION_ID}#" ${DEFINITIONS_STRING})
|
||||
|
||||
string(JSON SCHEMA_DEFINITIONS ERROR_VARIABLE JSON_ERROR GET ${SCHEMA_STRING} definitions)
|
||||
if(${JSON_ERROR} STREQUAL "NOTFOUND")
|
||||
string(JSON DEFINITIONS SET ${DEFINITIONS} "#" "{}")
|
||||
string(JSON DEFINITIONS SET ${DEFINITIONS} "#" definitions ${SCHEMA_DEFINITIONS})
|
||||
# string(JSON DEFINITIONS_LENGTH LENGTH ${SCHEMA_DEFINITIONS})
|
||||
# math(EXPR MAX "${DEFINITIONS_LENGTH} - 1")
|
||||
# foreach(IDX RANGE ${MAX})
|
||||
# string(JSON DEFINITION_NAME MEMBER ${SCHEMA_DEFINITIONS} ${IDX})
|
||||
# string(JSON DEFINITION GET ${SCHEMA_DEFINITIONS} ${DEFINITION_NAME})
|
||||
# message(VERBOSE "Loading local definition '${DEFINITION_NAME}'")
|
||||
# string(JSON DEFINITIONS_STRING SET ${DEFINITIONS_STRING} ${DEFINITION_NAME} ${DEFINITION})
|
||||
# endforeach()
|
||||
endif()
|
||||
|
||||
validate_object(${JSON_STRING} ${SCHEMA_STRING} OBJECT_ERROR)
|
||||
if(DEFINED OBJECT_ERROR)
|
||||
message(FATAL_ERROR ${OBJECT_ERROR})
|
||||
else()
|
||||
set(${JSON_STRING_STR} ${JSON_STRING} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(validate_object JSON_STRING SCHEMA_STRING OBJECT_ERROR_STR)
|
||||
unset(${OBJECT_ERROR_STR} PARENT_SCOPE)
|
||||
set(OBJECT_ERROR)
|
||||
string(JSON PROPERTY_NAME_SCHEMA ERROR_VARIABLE PROPERTY_NAMES_ERROR GET ${SCHEMA_STRING} propertyNames)
|
||||
string(JSON REQUIRED_PROPERTIES ERROR_VARIABLE REQUIRED_PROPERTIES_ERROR GET ${SCHEMA_STRING} required)
|
||||
set(REQUIRED_LIST)
|
||||
if(${REQUIRED_PROPERTIES_ERROR} STREQUAL "NOTFOUND")
|
||||
string(JSON REQUIRED_LENGTH LENGTH ${REQUIRED_PROPERTIES})
|
||||
math(EXPR MAX "${REQUIRED_LENGTH} - 1")
|
||||
foreach(IDX RANGE ${MAX})
|
||||
string(JSON REQUIRED GET ${REQUIRED_PROPERTIES} ${IDX})
|
||||
list(APPEND REQUIRED_LIST ${REQUIRED})
|
||||
endforeach()
|
||||
endif()
|
||||
string(JSON NUM_PROPERTIES LENGTH ${JSON_STRING})
|
||||
math(EXPR MAX "${NUM_PROPERTIES} - 1")
|
||||
foreach(IDX RANGE ${MAX})
|
||||
string(JSON PROPERTY_NAME MEMBER ${JSON_STRING} ${IDX})
|
||||
list(REMOVE_ITEM REQUIRED_LIST ${PROPERTY_NAME})
|
||||
message(VERBOSE "Validating property '${PROPERTY_NAME}'")
|
||||
if(${PROPERTY_NAMES_ERROR} STREQUAL "NOTFOUND")
|
||||
validate_property(${PROPERTY_NAME} ${PROPERTY_NAME_SCHEMA} PROPERTY_NAME_ERROR)
|
||||
if(DEFINED PROPERTY_NAME_ERROR)
|
||||
list(APPEND OBJECT_ERROR "${PROPERTY_NAME_ERROR}")
|
||||
endif()
|
||||
endif()
|
||||
string(JSON PROPERTY GET ${JSON_STRING} ${PROPERTY_NAME})
|
||||
string(JSON SCHEMA_PROPERTIES ERROR_VARIABLE PROPERTIES_ERROR GET ${SCHEMA_STRING} properties ${PROPERTY_NAME})
|
||||
if(${PROPERTIES_ERROR} STREQUAL "NOTFOUND")
|
||||
string(JSON PROPERTY_SCHEMA GET ${SCHEMA_STRING} properties ${PROPERTY_NAME})
|
||||
else()
|
||||
string(JSON PROPERTY_SCHEMA ERROR_VARIABLE ADDITIONAL_PROPERTIES_ERROR GET ${SCHEMA_STRING} additionalProperties)
|
||||
if(NOT ${ADDITIONAL_PROPERTIES_ERROR} STREQUAL "NOTFOUND" OR "${PROPERTY_SCHEMA}" STREQUAL "OFF")
|
||||
list(APPEND OBJECT_ERROR "Additional properties like '${PROPERTY_NAME}' not permitted in '${JSON_STRING}'")
|
||||
endif()
|
||||
endif()
|
||||
validate_property(${PROPERTY} ${PROPERTY_SCHEMA} PROPERTY_ERROR)
|
||||
if(DEFINED PROPERTY_ERROR)
|
||||
list(APPEND OBJECT_ERROR "${PROPERTY_ERROR}")
|
||||
endif()
|
||||
endforeach()
|
||||
list(LENGTH REQUIRED_LIST REQUIRED_REMAINING_LENGTH)
|
||||
if(${REQUIRED_REMAINING_LENGTH} GREATER 0)
|
||||
list(APPEND OBJECT_ERROR "Required properties not found: ${REQUIRED_LIST}")
|
||||
endif()
|
||||
set(${OBJECT_ERROR_STR} ${OBJECT_ERROR} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(validate_property PROPERTY PROPERTY_SCHEMA PROPERTY_ERROR_STR)
|
||||
unset(${PROPERTY_ERROR_STR} PARENT_SCOPE)
|
||||
set(PROPERTY_ERROR)
|
||||
string(JSON PROPERTY_REF ERROR_VARIABLE JSON_ERROR GET ${PROPERTY_SCHEMA} $ref)
|
||||
if(${JSON_ERROR} STREQUAL "NOTFOUND")
|
||||
string(REPLACE "/" ";" REF_COMPONENTS "${PROPERTY_REF}")
|
||||
string(JSON PROPERTY_SCHEMA GET ${DEFINITIONS} ${REF_COMPONENTS})
|
||||
endif()
|
||||
string(JSON PROPERTY_TYPE ERROR_VARIABLE JSON_ERROR GET ${PROPERTY_SCHEMA} type)
|
||||
if(${JSON_ERROR} STREQUAL "NOTFOUND")
|
||||
message(VERBOSE "Validating property type '${PROPERTY_TYPE}'")
|
||||
if(${PROPERTY_TYPE} STREQUAL "object")
|
||||
validate_object(${PROPERTY} ${PROPERTY_SCHEMA} OBJECT_ERROR)
|
||||
if(DEFINED OBJECT_ERROR)
|
||||
list(APPEND PROPERTY_ERROR ${OBJECT_ERROR})
|
||||
endif()
|
||||
elseif(${PROPERTY_TYPE} STREQUAL "array")
|
||||
string(JSON ARRAY_LENGTH LENGTH ${PROPERTY})
|
||||
string(JSON MAX_ITEMS ERROR_VARIABLE JSON_ERROR GET ${PROPERTY_SCHEMA} maxItems)
|
||||
if(${JSON_ERROR} STREQUAL "NOTFOUND" AND ${ARRAY_LENGTH} GREATER ${MAX_ITEMS})
|
||||
list(APPEND PROPERTY_ERROR "Number of items in '${PROPERTY}' exceeds maximum ${MAX_ITEMS}")
|
||||
endif()
|
||||
string(JSON MIN_ITEMS ERROR_VARIABLE JSON_ERROR GET ${PROPERTY_SCHEMA} minItems)
|
||||
if(${JSON_ERROR} STREQUAL "NOTFOUND" AND ${ARRAY_LENGTH} LESS ${MIN_ITEMS})
|
||||
list(APPEND PROPERTY_ERROR "Number of items in '${PROPERTY}' is less than ${MIN_ITEMS}")
|
||||
endif()
|
||||
string(JSON ITEM_SCHEMA ERROR_VARIABLE JSON_ERROR GET ${PROPERTY_SCHEMA} items)
|
||||
if(${JSON_ERROR} STREQUAL "NOTFOUND")
|
||||
math(EXPR MAX "${ARRAY_LENGTH} - 1")
|
||||
foreach(IDX RANGE ${MAX})
|
||||
string(JSON ITEM GET ${PROPERTY} ${IDX})
|
||||
validate_property(${ITEM} ${ITEM_SCHEMA} ITEM_ERROR)
|
||||
if(DEFINED ITEM_ERROR)
|
||||
list(APPEND PROPERTY_ERROR ${ITEM_ERROR})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
elseif(${PROPERTY_TYPE} STREQUAL "null")
|
||||
if(NOT "${PROPERTY}" STREQUAL "null")
|
||||
list(APPEND PROPERTY_ERROR "Property '${PROPERTY}' is not null'")
|
||||
endif()
|
||||
elseif(${PROPERTY_TYPE} STREQUAL "boolean")
|
||||
if(NOT "${PROPERTY}" STREQUAL "OFF" AND NOT "${PROPERTY}" STREQUAL "ON")
|
||||
list(APPEND PROPERTY_ERROR "Property '${PROPERTY}' is not a boolean'")
|
||||
endif()
|
||||
elseif(${PROPERTY_TYPE} STREQUAL "number")
|
||||
if(NOT "${PROPERTY}" MATCHES "-?[0-9]+\\.?[0-9]*")
|
||||
list(APPEND PROPERTY_ERROR "Property '${PROPERTY}' is not a number'")
|
||||
endif()
|
||||
elseif(${PROPERTY_TYPE} STREQUAL "integer")
|
||||
if(NOT "${PROPERTY}" MATCHES "-?[0-9]+")
|
||||
list(APPEND PROPERTY_ERROR "Property '${PROPERTY}' is not an integer'")
|
||||
endif()
|
||||
string(JSON MIN ERROR_VARIABLE JSON_ERROR GET ${PROPERTY_SCHEMA} minimum)
|
||||
if(${JSON_ERROR} STREQUAL "NOTFOUND" AND ${PROPERTY} LESS ${MIN})
|
||||
list(APPEND PROPERTY_ERROR "Property '${PROPERTY}' is less than the minimum of ${MIN}")
|
||||
endif()
|
||||
string(JSON MAX ERROR_VARIABLE JSON_ERROR GET ${PROPERTY_SCHEMA} maximum)
|
||||
if(${JSON_ERROR} STREQUAL "NOTFOUND" AND ${PROPERTY} GREATER ${MAX})
|
||||
list(APPEND PROPERTY_ERROR "Property '${PROPERTY}' is greater than the maximum of ${MAX}")
|
||||
endif()
|
||||
elseif(${PROPERTY_TYPE} STREQUAL "string")
|
||||
# cmake regex doesn't support {}, so other options might be needed here
|
||||
string(JSON PATTERN ERROR_VARIABLE JSON_ERROR GET ${PROPERTY_SCHEMA} pattern)
|
||||
if(${JSON_ERROR} STREQUAL "NOTFOUND" AND NOT "${PROPERTY}" MATCHES "${PATTERN}")
|
||||
list(APPEND PROPERTY_ERROR "Property '${PROPERTY}' does not match '${PATTERN}'")
|
||||
endif()
|
||||
string(LENGTH ${PROPERTY} STRING_LENGTH)
|
||||
string(JSON MIN_LENGTH ERROR_VARIABLE JSON_ERROR GET ${PROPERTY_SCHEMA} minLength)
|
||||
if(${JSON_ERROR} STREQUAL "NOTFOUND" AND ${STRING_LENGTH} LESS ${MIN_LENGTH})
|
||||
list(APPEND PROPERTY_ERROR "Length of property '${PROPERTY}' is less than the minimum of ${MIN_LENGTH}")
|
||||
endif()
|
||||
string(JSON MAX_LENGTH ERROR_VARIABLE JSON_ERROR GET ${PROPERTY_SCHEMA} maxLength)
|
||||
if(${JSON_ERROR} STREQUAL "NOTFOUND" AND ${STRING_LENGTH} GREATER ${MAX_LENGTH})
|
||||
list(APPEND PROPERTY_ERROR "Length of property '${PROPERTY}' is greater than the maximum of ${MAX_LENGTH}")
|
||||
endif()
|
||||
string(JSON ENUM_LIST ERROR_VARIABLE JSON_ERROR GET ${PROPERTY_SCHEMA} enum)
|
||||
if(${JSON_ERROR} STREQUAL "NOTFOUND")
|
||||
set(FOUND_IN_ENUM_LIST FALSE)
|
||||
string(JSON ENUM_LENGTH LENGTH ${ENUM_LIST})
|
||||
math(EXPR MAX "${ENUM_LENGTH} - 1")
|
||||
foreach(IDX RANGE ${MAX})
|
||||
string(JSON ENUM GET ${PROPERTY_SCHEMA} enum ${IDX})
|
||||
if(${ENUM} STREQUAL ${PROPERTY})
|
||||
set(FOUND_IN_ENUM_LIST TRUE)
|
||||
endif()
|
||||
endforeach()
|
||||
if(NOT ${FOUND_IN_ENUM_LIST})
|
||||
list(APPEND PROPERTY_ERROR "Property '${PROPERTY}' is not defined in the schema's enum: ${ENUM_LIST}")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
message(VERBOSE "Unknown type '${PROPERTY_TYPE}'")
|
||||
endif()
|
||||
else()
|
||||
string(JSON PROPERTY_ONEOF ERROR_VARIABLE JSON_ERROR GET ${PROPERTY_SCHEMA} oneOf)
|
||||
if(${JSON_ERROR} STREQUAL "NOTFOUND")
|
||||
set(TYPE_SUCCESS FALSE)
|
||||
string(JSON NUM_ONEOF LENGTH ${PROPERTY_ONEOF})
|
||||
math(EXPR MAX "${NUM_ONEOF} - 1")
|
||||
set(ONEOF_ERRORS)
|
||||
foreach(IDX RANGE ${MAX})
|
||||
string(JSON PROPERTY_SCHEMA GET ${PROPERTY_ONEOF} ${IDX})
|
||||
validate_property(${PROPERTY} ${PROPERTY_SCHEMA} ONEOF_ERROR)
|
||||
if(NOT DEFINED ONEOF_ERROR)
|
||||
set(TYPE_SUCCESS TRUE)
|
||||
else()
|
||||
list(APPEND ONEOF_ERRORS "${ONEOF_ERROR}\n")
|
||||
endif()
|
||||
endforeach()
|
||||
if(NOT TYPE_SUCCESS)
|
||||
list(APPEND PROPERTY_ERROR "Could not validate oneOf type '${PROPERTY}' :\n${ONEOF_ERRORS}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
set(${PROPERTY_ERROR_STR} ${PROPERTY_ERROR} PARENT_SCOPE)
|
||||
endfunction()
|
||||
@@ -1,2 +0,0 @@
|
||||
target_sources(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/ADCv3/hal_adc_lld.c)
|
||||
target_include_directories(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/ADCv3)
|
||||
@@ -1,2 +0,0 @@
|
||||
target_sources(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/CANv1/hal_can_lld.c)
|
||||
target_include_directories(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/CANv1)
|
||||
@@ -1,2 +0,0 @@
|
||||
target_sources(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/DACv1/hal_dac_lld.c)
|
||||
target_include_directories(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/DACv1)
|
||||
@@ -1,2 +0,0 @@
|
||||
target_sources(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/DMAv1/stm32_dma.c)
|
||||
target_include_directories(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/DMAv1)
|
||||
@@ -1,2 +0,0 @@
|
||||
target_sources(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/EXTIv1/stm32_exti.c)
|
||||
target_include_directories(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/EXTIv1)
|
||||
@@ -1,2 +0,0 @@
|
||||
target_sources(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/GPIOv2/hal_pal_lld.c)
|
||||
target_include_directories(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/GPIOv2)
|
||||
@@ -1,7 +0,0 @@
|
||||
if(${USE_HAL_I2C_FALLBACK})
|
||||
target_sources(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/I2C/hal_i2c_lld.c)
|
||||
target_include_directories(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/I2C)
|
||||
else()
|
||||
target_sources(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/I2Cv2/hal_i2c_lld.c)
|
||||
target_include_directories(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/I2Cv2)
|
||||
endif()
|
||||
@@ -1,2 +0,0 @@
|
||||
target_sources(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/RTCv2/hal_rtc_lld.c)
|
||||
target_include_directories(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/RTCv2)
|
||||
@@ -1,5 +0,0 @@
|
||||
target_sources(qmk PUBLIC
|
||||
${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/SPIv2/hal_i2s_lld.c
|
||||
${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/SPIv2/hal_spi_v2_lld.c
|
||||
)
|
||||
target_include_directories(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/SPIv2)
|
||||
@@ -1,2 +0,0 @@
|
||||
target_sources(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/SYSTICKv1/hal_st_lld.c)
|
||||
target_include_directories(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/SYSTICKv1)
|
||||
@@ -1,6 +0,0 @@
|
||||
target_sources(qmk PUBLIC
|
||||
${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/TIMv1/hal_gpt_lld.c
|
||||
${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/TIMv1/hal_icu_lld.c
|
||||
${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/TIMv1/hal_pwm_lld.c
|
||||
)
|
||||
target_include_directories(qmk PUBLIC ${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/TIMv1)
|
||||
@@ -1,9 +0,0 @@
|
||||
target_sources(qmk PUBLIC
|
||||
${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/USARTv2/hal_serial_lld.c
|
||||
${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/USARTv2/hal_sio_lld.c
|
||||
${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/USARTv2/hal_uart_lld.c
|
||||
)
|
||||
target_include_directories(qmk PUBLIC
|
||||
${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/USART
|
||||
${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/USARTv2
|
||||
)
|
||||
@@ -1,6 +0,0 @@
|
||||
target_sources(qmk PUBLIC
|
||||
${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/USBv1/hal_usb_lld.c
|
||||
)
|
||||
target_include_directories(qmk PUBLIC
|
||||
${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/USBv1
|
||||
)
|
||||
@@ -1,6 +0,0 @@
|
||||
target_sources(qmk PUBLIC
|
||||
${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/xWDGv1/hal_wdg_lld.c
|
||||
)
|
||||
target_include_directories(qmk PUBLIC
|
||||
${CHIBIOS}/os/hal/ports/${MCU_PORT_NAME}/LLD/xWDGv1
|
||||
)
|
||||
@@ -1,10 +0,0 @@
|
||||
# os/common/ports/ARMv7/compilers/GCC/mk/port.mk
|
||||
target_sources(qmk PUBLIC
|
||||
${CHIBIOS}/os/common/ports/ARMv7-M/chcore.c
|
||||
${CHIBIOS}/os/common/ports/ARMv7-M/compilers/GCC/chcoreasm.S
|
||||
)
|
||||
target_include_directories(qmk PUBLIC
|
||||
${CHIBIOS}/os/common/portability/GCC
|
||||
${CHIBIOS}/os/common/ports/ARM-common
|
||||
${CHIBIOS}/os/common/ports/ARMv7-M
|
||||
)
|
||||
@@ -1,25 +0,0 @@
|
||||
# os/hal/ports/STM32/STM32F3xx/platform.mk
|
||||
target_sources(qmk PUBLIC
|
||||
${CHIBIOS}/os/hal/ports/common/ARMCMx/nvic.c
|
||||
${CHIBIOS}/os/hal/ports/STM32/STM32F3xx/stm32_isr.c
|
||||
${CHIBIOS}/os/hal/ports/STM32/STM32F3xx/hal_lld.c
|
||||
${CHIBIOS}/os/hal/ports/STM32/STM32F3xx/hal_efl_lld.c
|
||||
)
|
||||
target_include_directories(qmk PUBLIC
|
||||
${CHIBIOS}/os/hal/ports/common/ARMCMx
|
||||
${CHIBIOS}/os/hal/ports/STM32/STM32F3xx
|
||||
)
|
||||
include(chibios/LLD/ADCv3)
|
||||
include(chibios/LLD/CANv1)
|
||||
include(chibios/LLD/DACv1)
|
||||
include(chibios/LLD/DMAv1)
|
||||
include(chibios/LLD/EXTIv1)
|
||||
include(chibios/LLD/GPIOv2)
|
||||
include(chibios/LLD/I2Cv2)
|
||||
include(chibios/LLD/RTCv2)
|
||||
include(chibios/LLD/SPIv2)
|
||||
include(chibios/LLD/SYSTICKv1)
|
||||
include(chibios/LLD/TIMv1)
|
||||
include(chibios/LLD/USARTv2)
|
||||
include(chibios/LLD/USBv1)
|
||||
include(chibios/LLD/xWDGv1)
|
||||
@@ -1,32 +0,0 @@
|
||||
option(BACKLIGHT_ENABLE "" TRUE)
|
||||
set(BACKLIGHT_DRIVER "pwm" CACHE STRING "Backlight driver")
|
||||
set_property(CACHE BACKLIGHT_DRIVER PROPERTY STRINGS pwm timer software custom)
|
||||
|
||||
string(JSON BACKLIGHT_PIN ERROR_VARIABLE NO_BACKLIGHT_PIN GET ${QMK_KEYBOARD_INFO_JSON_STRING} backlight pin)
|
||||
if(${BACKLIGHT_ENABLE} AND NOT ${BACKLIGHT_PIN} STREQUAL "backlight-NOTFOUND")
|
||||
target_sources(qmk PUBLIC
|
||||
quantum/backlight/backlight.c
|
||||
quantum/process_keycode/process_backlight.c
|
||||
)
|
||||
target_compile_definitions(qmk PUBLIC
|
||||
BACKLIGHT_ENABLE
|
||||
BACKLIGHT_PIN=${BACKLIGHT_PIN}
|
||||
)
|
||||
if(${BACKLIGHT_DRIVER} STREQUAL "custom")
|
||||
target_compile_definitions(qmk PUBLIC BACKLIGHT_CUSTOM_DRIVER)
|
||||
else()
|
||||
target_sources(qmk PUBLIC quantum/backlight/backlight_driver_common.c)
|
||||
if(${BACKLIGHT_DRIVER} STREQUAL "pwm")
|
||||
target_sources(qmk PUBLIC quantum/backlight/backlight_${QMK_PLATFORM}.c)
|
||||
else()
|
||||
target_sources(qmk PUBLIC quantum/backlight/backlight_${BACKLIGHT_DRIVER}.c)
|
||||
endif()
|
||||
endif()
|
||||
target_include_directories(qmk PUBLIC quantum/backlight)
|
||||
target_include_directories(qmk PUBLIC drivers/oled)
|
||||
# target_link_libraries(backlight qmk)
|
||||
# target_include_directories(backlight PUBLIC quantum/backlight)
|
||||
# target_include_directories(quantum PUBLIC quantum/backlight)
|
||||
# target_link_libraries(backlight ${QMK_TARGET})
|
||||
# target_link_libraries(backlight quantum)
|
||||
endif()
|
||||
@@ -1,70 +0,0 @@
|
||||
set(EEPROM_DRIVER "vendor" CACHE STRING "EEPROM driver")
|
||||
set_property(CACHE EEPROM_DRIVER PROPERTY STRINGS vendor custom transient i2c spi wear_leveling legacy_stm32_flash)
|
||||
set(WEAR_LEVELING_DRIVER "none" CACHE STRING "EEPROM wear-leveling driver")
|
||||
set_property(CACHE WEAR_LEVELING_DRIVER PROPERTY STRINGS custom embedded_flash spi_flash rp2040_flash legacy)
|
||||
|
||||
target_compile_definitions(qmk PUBLIC
|
||||
EEPROM_ENABLE
|
||||
)
|
||||
target_include_directories(qmk PUBLIC
|
||||
platforms/${QMK_PLATFORM}/drivers/eeprom
|
||||
drivers/eeprom
|
||||
platforms/common
|
||||
)
|
||||
|
||||
if(${EEPROM_DRIVER} STREQUAL "wear_leveling")
|
||||
target_compile_definitions(qmk PUBLIC
|
||||
EEPROM_DRIVER
|
||||
EEPROM_WEAR_LEVELING
|
||||
)
|
||||
target_sources(qmk PUBLIC
|
||||
drivers/eeprom/eeprom_driver.c
|
||||
drivers/eeprom/eeprom_wear_leveling.c
|
||||
)
|
||||
elseif(${EEPROM_DRIVER} STREQUAL "vendor")
|
||||
target_compile_definitions(qmk PUBLIC
|
||||
EEPROM_VENDOR
|
||||
)
|
||||
if(${QMK_PLATFORM} STREQUAL "chibios")
|
||||
if(${QMK_MCU} MATCHES "STM32F[1-9].*" OR ${QMK_MCU} MATCHES "WB32.*" OR ${QMK_MCU} MATCHES "GD32.*")
|
||||
target_compile_definitions(qmk PUBLIC
|
||||
EEPROM_DRIVER
|
||||
EEPROM_WEAR_LEVELING
|
||||
)
|
||||
target_sources(qmk PUBLIC
|
||||
drivers/eeprom/eeprom_driver.c
|
||||
drivers/eeprom/eeprom_wear_leveling.c
|
||||
)
|
||||
set(WEAR_LEVELING_DRIVER "embedded_flash")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT ${WEAR_LEVELING_DRIVER} STREQUAL "none")
|
||||
set(FNV_ENABLE TRUE)
|
||||
target_compile_definitions(qmk PUBLIC
|
||||
WEAR_LEVELING_ENABLE
|
||||
)
|
||||
target_include_directories(qmk PUBLIC
|
||||
platforms/${QMK_PLATFORM}/drivers/wear_leveling
|
||||
drivers/wear_leveling
|
||||
quantum/wear_leveling
|
||||
)
|
||||
target_sources(qmk PUBLIC quantum/wear_leveling/wear_leveling.c)
|
||||
|
||||
if(${WEAR_LEVELING_DRIVER} STREQUAL "embedded_flash")
|
||||
target_compile_definitions(qmk PUBLIC
|
||||
HAL_USE_EFL
|
||||
WEAR_LEVELING_EMBEDDED_FLASH
|
||||
)
|
||||
target_sources(qmk PUBLIC
|
||||
platforms/${QMK_PLATFORM}/drivers/wear_leveling/wear_leveling_efl.c
|
||||
)
|
||||
# target_compile_options(qmk PUBLIC
|
||||
# -include ${CMAKE_SOURCE_DIR}/platforms/${QMK_PLATFORM}/drivers/wear_leveling/wear_leveling_efl_config.h
|
||||
# )
|
||||
target_precompile_headers(qmk PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/platforms/${QMK_PLATFORM}/drivers/wear_leveling/wear_leveling_efl_config.h
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,9 +0,0 @@
|
||||
if(${FNV_ENABLE})
|
||||
target_compile_definitions(qmk PUBLIC FNV_ENABLE)
|
||||
target_include_directories(qmk PUBLIC lib/fnv)
|
||||
target_sources(qmk PUBLIC
|
||||
lib/fnv/qmk_fnv_type_validation.c
|
||||
lib/fnv/hash_32a.c
|
||||
lib/fnv/hash_64a.c
|
||||
)
|
||||
endif()
|
||||
@@ -1,9 +0,0 @@
|
||||
message(STATUS "Custom Matrix: ${CUSTOM_MATRIX}")
|
||||
set(CUSTOM_MATRIX "no" CACHE STRING "Custom matrix-scanning")
|
||||
set_property(CACHE CUSTOM_MATRIX PROPERTY STRINGS yes lite no)
|
||||
if(NOT ${CUSTOM_MATRIX} STREQUAL yes)
|
||||
target_sources(qmk PUBLIC quantum/matrix_common.c)
|
||||
if(NOT ${CUSTOM_MATRIX} STREQUAL lite)
|
||||
target_sources(qmk PUBLIC quantum/matrix.c)
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,10 +0,0 @@
|
||||
option(OLED_ENABLE "" OFF)
|
||||
if(${OLED_ENABLE})
|
||||
target_sources(qmk PUBLIC
|
||||
drivers/oled/ssd1306_sh1106.c
|
||||
platforms/${QMK_PLATFORM}/drivers/i2c_master.c)
|
||||
target_compile_definitions(qmk PUBLIC OLED_ENABLE)
|
||||
target_include_directories(qmk PUBLIC drivers)
|
||||
target_include_directories(qmk PUBLIC drivers/oled)
|
||||
target_include_directories(qmk PUBLIC platforms/${QMK_PLATFORM}/drivers)
|
||||
endif()
|
||||
@@ -1,144 +0,0 @@
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
|
||||
|
||||
include(ResolveToolchain)
|
||||
|
||||
set(QMK_TOOLCHAIN "arm-none-eabi")
|
||||
set(QMK_PLATFORM "chibios")
|
||||
set(QMK_PROTOCOL "chibios")
|
||||
set(QMK_EXTENSION ".bin")
|
||||
|
||||
if(UNIX)
|
||||
set(OS_SUFFIX "")
|
||||
elseif(WIN32)
|
||||
set(OS_SUFFIX ".exe")
|
||||
endif()
|
||||
|
||||
find_toolchain(arm-none-eabi TOOLCHAIN_ROOT)
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_PROCESSOR arm)
|
||||
set(CMAKE_CROSS_COMPILING 1)
|
||||
|
||||
set(CMAKE_C_COMPILER "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-gcc${OS_SUFFIX}" CACHE PATH "gcc" FORCE)
|
||||
set(CMAKE_CXX_COMPILER "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-g++${OS_SUFFIX}" CACHE PATH "g++" FORCE)
|
||||
set(CMAKE_AR "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-ar${OS_SUFFIX}" CACHE PATH "ar" FORCE)
|
||||
set(CMAKE_AS "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-as${OS_SUFFIX}" CACHE PATH "as" FORCE)
|
||||
set(CMAKE_LINKER "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-ld${OS_SUFFIX}" CACHE PATH "linker" FORCE)
|
||||
set(CMAKE_NM "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-nm${OS_SUFFIX}" CACHE PATH "nm" FORCE)
|
||||
set(CMAKE_OBJCOPY "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-objcopy${OS_SUFFIX}" CACHE PATH "objcopy" FORCE)
|
||||
set(CMAKE_OBJDUMP "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-objdump${OS_SUFFIX}" CACHE PATH "objdump" FORCE)
|
||||
set(CMAKE_STRIP "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-strip${OS_SUFFIX}" CACHE PATH "strip" FORCE)
|
||||
set(CMAKE_RANLIB "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-ranlib${OS_SUFFIX}" CACHE PATH "ranlib" FORCE)
|
||||
set(CMAKE_SIZE "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-size${OS_SUFFIX}" CACHE PATH "size" FORCE)
|
||||
|
||||
find_program(CMAKE_MAKE_PROGRAM NAME make
|
||||
PATHS
|
||||
"${CMAKE_SOURCE_DIR}/toolchains/avr-gcc-12.1.0-x64-windows/bin/"
|
||||
"${CMAKE_SOURCE_DIR}/toolchains/avr-gcc-12.1.0-x64-linux/bin/"
|
||||
/usr/bin/
|
||||
/usr/local/bin
|
||||
/bin/
|
||||
)
|
||||
|
||||
add_compile_options(
|
||||
$<$<COMPILE_LANGUAGE:C>:-std=gnu11>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-std=gnu++14>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>
|
||||
# -flto
|
||||
-Os
|
||||
-Wall
|
||||
-Wstrict-prototypes
|
||||
# -fcommon
|
||||
# -g
|
||||
|
||||
-fomit-frame-pointer
|
||||
-ffunction-sections
|
||||
-fdata-sections
|
||||
-fno-common
|
||||
-fshort-wchar
|
||||
-fno-builtin-printf
|
||||
# -funsigned-char
|
||||
# -funsigned-bitfields
|
||||
# -ffunction-sections
|
||||
# -fdata-sections
|
||||
# -fpack-struct
|
||||
# -fshort-enums
|
||||
# -fno-builtin-printf
|
||||
# $<$<COMPILE_LANGUAGE:C>:-fno-inline-small-functions>
|
||||
# $<$<COMPILE_LANGUAGE:C>:-fno-strict-aliasing>
|
||||
# $<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions>
|
||||
)
|
||||
|
||||
add_link_options(
|
||||
-Wl,--gc-sections
|
||||
-nostartfiles
|
||||
-Wl,--no-wchar-size-warning
|
||||
--specs=nano.specs
|
||||
-lm
|
||||
)
|
||||
|
||||
macro(add_qmk_executable target_name)
|
||||
|
||||
set(elf_file ${target_name}.elf)
|
||||
set(map_file ${target_name}.map)
|
||||
set(bin_file ${target_name}.bin)
|
||||
set(lst_file ${target_name}.lst)
|
||||
|
||||
add_link_options(
|
||||
-Wl,-Map=${map_file},--cref
|
||||
)
|
||||
|
||||
# create elf file
|
||||
add_executable(qmk ${ARGN})
|
||||
# add_executable(${elf_file} ${ARGN})
|
||||
# target_link_libraries(${elf_file} qmk)
|
||||
|
||||
set_target_properties(qmk
|
||||
PROPERTIES
|
||||
OUTPUT_NAME ${elf_file}
|
||||
)
|
||||
|
||||
# generate the lst file
|
||||
add_custom_command(
|
||||
OUTPUT ${lst_file}
|
||||
COMMAND ${CMAKE_OBJDUMP} -h -S ${elf_file} > ${lst_file}
|
||||
DEPENDS qmk
|
||||
)
|
||||
|
||||
# add_custom_command(
|
||||
# OUTPUT "print-size-${elf_file}"
|
||||
|
||||
# COMMAND
|
||||
# ${CMAKE_SIZE} ${elf_file}
|
||||
|
||||
# DEPENDS ${elf_file}
|
||||
# )
|
||||
|
||||
# add_custom_command(
|
||||
# OUTPUT "print-size-${bin_file}"
|
||||
|
||||
# COMMAND
|
||||
# ${CMAKE_SIZE} ${bin_file} sizeafter
|
||||
|
||||
# DEPENDS ${bin_file}
|
||||
# )
|
||||
|
||||
add_custom_command(
|
||||
TARGET qmk
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_OBJCOPY} -O binary ${elf_file} ${CMAKE_SOURCE_DIR}/build/${bin_file}
|
||||
# COMMAND ${CMAKE_COMMAND} -E copy ${elf_file} ${CMAKE_SOURCE_DIR}/build/${elf_file}
|
||||
# COMMAND ${CMAKE_COMMAND} -E copy ${lst_file} ${CMAKE_SOURCE_DIR}/build/${lst_file}
|
||||
# COMMAND ${CMAKE_COMMAND} -E copy ${map_file} ${CMAKE_SOURCE_DIR}/build/${map_file}
|
||||
)
|
||||
|
||||
# build the intel hex file for the device
|
||||
add_custom_target(${target_name} ALL
|
||||
DEPENDS ${elf_file} ${lst_file}
|
||||
)
|
||||
|
||||
set_target_properties(${target_name}
|
||||
PROPERTIES
|
||||
OUTPUT_NAME ${bin_file}
|
||||
)
|
||||
endmacro(add_qmk_executable)
|
||||
@@ -1,182 +0,0 @@
|
||||
#
|
||||
# AVR GCC Toolchain file
|
||||
#
|
||||
# @author Natesh Narain
|
||||
# @since Feb 06 2016
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
|
||||
|
||||
include(ResolveToolchain)
|
||||
|
||||
set(QMK_TOOLCHAIN "avr")
|
||||
set(QMK_PLATFORM "avr")
|
||||
set(QMK_PROTOCOL "lufa")
|
||||
set(QMK_EXTENSION ".hex")
|
||||
|
||||
if(UNIX)
|
||||
set(OS_SUFFIX "")
|
||||
elseif(WIN32)
|
||||
set(OS_SUFFIX ".exe")
|
||||
endif()
|
||||
|
||||
find_toolchain(avr TOOLCHAIN_ROOT)
|
||||
|
||||
# setup the AVR compiler variables
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_PROCESSOR avr)
|
||||
set(CMAKE_CROSS_COMPILING 1)
|
||||
|
||||
set(CMAKE_C_COMPILER "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-gcc${OS_SUFFIX}" CACHE PATH "gcc" FORCE)
|
||||
set(CMAKE_CXX_COMPILER "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-g++${OS_SUFFIX}" CACHE PATH "g++" FORCE)
|
||||
set(CMAKE_AR "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-ar${OS_SUFFIX}" CACHE PATH "ar" FORCE)
|
||||
set(CMAKE_AS "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-as${OS_SUFFIX}" CACHE PATH "as" FORCE)
|
||||
set(CMAKE_LINKER "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-ld${OS_SUFFIX}" CACHE PATH "linker" FORCE)
|
||||
set(CMAKE_NM "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-nm${OS_SUFFIX}" CACHE PATH "nm" FORCE)
|
||||
set(CMAKE_OBJCOPY "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-objcopy${OS_SUFFIX}" CACHE PATH "objcopy" FORCE)
|
||||
set(CMAKE_OBJDUMP "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-objdump${OS_SUFFIX}" CACHE PATH "objdump" FORCE)
|
||||
set(CMAKE_STRIP "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-strip${OS_SUFFIX}" CACHE PATH "strip" FORCE)
|
||||
set(CMAKE_RANLIB "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-ranlib${OS_SUFFIX}" CACHE PATH "ranlib" FORCE)
|
||||
set(AVR_SIZE "${TOOLCHAIN_ROOT}/${QMK_TOOLCHAIN}-size${OS_SUFFIX}" CACHE PATH "size" FORCE)
|
||||
|
||||
# set(CMAKE_EXE_LINKER_FLAGS "-L /usr/lib/gcc/avr/4.8.2")
|
||||
|
||||
# avr uploader config
|
||||
find_program(AVR_UPLOAD
|
||||
NAME
|
||||
avrdude
|
||||
PATHS
|
||||
/usr/bin/
|
||||
$ENV{AVR_ROOT}
|
||||
)
|
||||
|
||||
find_program(CMAKE_MAKE_PROGRAM NAME make
|
||||
PATHS
|
||||
"${CMAKE_SOURCE_DIR}/toolchains/avr-gcc-12.1.0-x64-windows/bin/"
|
||||
"${CMAKE_SOURCE_DIR}/toolchains/avr-gcc-12.1.0-x64-linux/bin/"
|
||||
/usr/bin/
|
||||
/usr/local/bin
|
||||
/bin/
|
||||
)
|
||||
|
||||
# setup the avr exectable macro
|
||||
|
||||
# set(AVR_LINKER_LIBS "-lc -lm -lgcc -Wl,-lprintf_flt -Wl,-u,vfprintf")
|
||||
|
||||
add_compile_options(
|
||||
$<$<COMPILE_LANGUAGE:C>:-std=gnu11>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-std=gnu++14>
|
||||
-flto
|
||||
# -mrelax
|
||||
-Os
|
||||
-Wall
|
||||
-Wstrict-prototypes
|
||||
-fcommon
|
||||
# -g
|
||||
$<$<BOOL:${WIN32}>:--param=min-pagesize=0>
|
||||
-funsigned-char
|
||||
-funsigned-bitfields
|
||||
-ffunction-sections
|
||||
-fdata-sections
|
||||
-fpack-struct
|
||||
-fshort-enums
|
||||
-mcall-prologues
|
||||
-fno-builtin-printf
|
||||
$<$<COMPILE_LANGUAGE:C>:-fno-inline-small-functions>
|
||||
$<$<COMPILE_LANGUAGE:C>:-fno-strict-aliasing>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions>
|
||||
)
|
||||
|
||||
add_compile_definitions(
|
||||
F_CPU=16000000
|
||||
F_USB=16000000UL
|
||||
__AVR_ATmega32U4__
|
||||
LTO_ENABLE
|
||||
)
|
||||
|
||||
add_link_options(
|
||||
-Wl,--gc-sections
|
||||
)
|
||||
|
||||
macro(add_qmk_executable target_name)
|
||||
|
||||
set(elf_file ${target_name}.elf)
|
||||
set(map_file ${target_name}.map)
|
||||
set(hex_file ${target_name}.hex)
|
||||
set(lst_file ${target_name}.lst)
|
||||
|
||||
add_compile_options(
|
||||
-mmcu=${QMK_MCU}
|
||||
)
|
||||
|
||||
add_link_options(
|
||||
-mmcu=${QMK_MCU}
|
||||
-Wl,-Map=${map_file}
|
||||
)
|
||||
|
||||
# create elf file
|
||||
# add_executable(${elf_file} ${ARGN})
|
||||
# target_link_libraries(${elf_file} qmk)
|
||||
|
||||
add_executable(qmk ${ARGN})
|
||||
set_target_properties(qmk
|
||||
PROPERTIES
|
||||
OUTPUT_NAME ${elf_file}
|
||||
)
|
||||
|
||||
|
||||
# set_target_properties(${elf_file}
|
||||
# PROPERTIES
|
||||
# COMPILE_FLAGS "-mmcu=${QMK_MCU} ${COMPILE_OPTIONS}"
|
||||
# LINK_FLAGS "-mmcu=${QMK_MCU} ${LINK_OPTIONS}"
|
||||
# )
|
||||
|
||||
# add_custom_target(compileOptions
|
||||
# COMMAND cmake -P ${CMAKE_SOURCE_DIR}/cmake/WriteCompileOptions.cmake
|
||||
# COMMENT "Writing compile_flags.txt"
|
||||
# )
|
||||
|
||||
# generate the lst file
|
||||
add_custom_command(
|
||||
OUTPUT ${lst_file}
|
||||
COMMAND ${CMAKE_OBJDUMP} -h -S ${elf_file} > ${lst_file}
|
||||
DEPENDS ${elf_file}
|
||||
)
|
||||
|
||||
# create hex file
|
||||
add_custom_command(
|
||||
OUTPUT ${hex_file}
|
||||
# COMMAND ${CMAKE_OBJCOPY} -j .text -j .data -O ihex ${elf_file} ${hex_file}
|
||||
COMMAND ${CMAKE_OBJCOPY} -O ihex -R .eeprom -R .fuse -R .lock -R .signature ${elf_file} ${hex_file}
|
||||
DEPENDS ${elf_file}
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "print-size-${elf_file}"
|
||||
COMMAND ${AVR_SIZE} ${elf_file}
|
||||
DEPENDS ${elf_file}
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "print-size-${hex_file}"
|
||||
COMMAND ${AVR_SIZE} ${hex_file}
|
||||
DEPENDS ${hex_file}
|
||||
)
|
||||
|
||||
add_custom_target(copy_hex
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${hex_file} ${CMAKE_SOURCE_DIR}/build/${hex_file}
|
||||
DEPENDS ${hex_file}
|
||||
)
|
||||
|
||||
# build the intel hex file for the device
|
||||
add_custom_target(${target_name} ALL
|
||||
DEPENDS ${hex_file} ${lst_file} "print-size-${elf_file}" "print-size-${hex_file}" copy_hex
|
||||
)
|
||||
|
||||
set_target_properties(${target_name}
|
||||
PROPERTIES
|
||||
OUTPUT_NAME ${hex_file}
|
||||
)
|
||||
|
||||
|
||||
endmacro(add_qmk_executable)
|
||||
@@ -1,16 +0,0 @@
|
||||
if(${USE_PICOLIBC})
|
||||
add_compile_options(
|
||||
--specs=picolibc.specs
|
||||
)
|
||||
add_compile_definitions(USE_PICOLIBC)
|
||||
add_link_options(
|
||||
-Wl,--defsym=__heap_start=__heap_base__,--defsym=__heap_end=__heap_end__
|
||||
)
|
||||
endif()
|
||||
|
||||
add_compile_options(
|
||||
-march=${MCU_ARCH}
|
||||
-mabi=${MCU_ABI}
|
||||
-mcmodel=${MCU_CMODEL}
|
||||
-mstrict-align
|
||||
)
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"olkb/planck/rev3": "@jackhumbert/test_keyboard",
|
||||
"olkb/planck/rev6": "planck/rev6"
|
||||
}
|
||||
@@ -129,7 +129,7 @@
|
||||
"TAPPING_FORCE_HOLD": {"info_key": "tapping.force_hold", "value_type": "bool", "deprecated": true},
|
||||
"TAPPING_FORCE_HOLD_PER_KEY": {"info_key": "tapping.force_hold_per_key", "value_type": "bool", "deprecated": true},
|
||||
"IGNORE_MOD_TAP_INTERRUPT": {"info_key": "_deprecated.ignore_mod_tap_interrupt", "value_type": "bool", "deprecated": true},
|
||||
"IGNORE_MOD_TAP_INTERRUPT_PER_KEY": {"info_key": "_invalid.ignore_mod_tap_interrupt_per_key", "invalid": true},
|
||||
"IGNORE_MOD_TAP_INTERRUPT_PER_KEY": {"info_key": "_invalid.ignore_mod_tap_interrupt_per_key", "invalid": true}
|
||||
|
||||
// USB params, need to mark as failure when specified in config.h, rather than deprecated
|
||||
"PRODUCT_ID": {"info_key": "usb.pid", "value_type": "hex", "deprecated": true, "replace_with": "`usb.pid` in info.json"},
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
},
|
||||
"hex_number_2d": {
|
||||
"type": "string",
|
||||
"pattern": "^0x[0-9A-F][0-9A-F]$"
|
||||
"pattern": "^0x[0-9A-F]{2}$"
|
||||
},
|
||||
"hex_number_4d": {
|
||||
"type": "string",
|
||||
"pattern": "^0x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]$"
|
||||
"pattern": "^0x[0-9A-F]{4}$"
|
||||
},
|
||||
"bcd_version": {
|
||||
"type": "string",
|
||||
"pattern": "^[0-9][0-9]?\\.[0-9]\\.[0-9]$"
|
||||
"pattern": "^[0-9]{1,2}\\.[0-9]\\.[0-9]$"
|
||||
},
|
||||
"text_identifier": {
|
||||
"type": "string",
|
||||
@@ -83,15 +83,15 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[A-K]\\d\\d?$"
|
||||
"pattern": "^[A-K]\\d{1,2}$"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^LINE_PIN\\d\\d?$"
|
||||
"pattern": "^LINE_PIN\\d{1,2}$"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^GP\\d\\d?$"
|
||||
"pattern": "^GP\\d{1,2}$"
|
||||
},
|
||||
{
|
||||
"type": "integer"
|
||||
|
||||
+43
-10
@@ -46,16 +46,7 @@ Before starting, you will want to make sure that you have all of the build tools
|
||||
|
||||
This part is super simple. However, there is some configuration that we need to do to ensure things are configured correctly.
|
||||
|
||||
### Configuring VS Code
|
||||
|
||||
First, we need to set up IntelliSense. This isn't strictly required, but it will make your life a LOT easier. To do this, we need to create the `.vscode/c_cpp_properties.json` file in the QMK Firmware folder, You can do this all manually, but I've done most of the work already.
|
||||
|
||||
Grab [this file](https://gist.github.com/drashna/48e2c49ce877be592a1650f91f8473e8) and save it. You may need to edit this file, if you didn't install MSYS2 to the default location, or are using WSL/LxSS.
|
||||
|
||||
Once you have saved this file, you will need to reload VS Code, if it was already running.
|
||||
|
||||
?> You should see an `extensions.json` and `settings.json` file in the `.vscode` folder, as well.
|
||||
|
||||
#### MSYS2 Setup
|
||||
|
||||
Now, we will set up the MSYS2 window to show up in VSCode as the integrated terminal. This has a number of advantages. Mostly, you can control+click on errors and jump to those files. This makes debugging much easier. It's also nice, in that you don't have to jump to another window.
|
||||
|
||||
@@ -110,8 +101,50 @@ This installs a bunch of Git related tools that may make using Git with QMK Firm
|
||||
Restart once you've installed any extensions
|
||||
|
||||
# Configure VS Code for QMK
|
||||
|
||||
1. Click <kbd><kbd>File</kbd> > <kbd>Open Folder</kbd></kbd>
|
||||
2. Open the QMK Firmware folder that you cloned from GitHub.
|
||||
3. Click <kbd><kbd>File</kbd> > <kbd>Save Workspace As...</kbd></kbd>
|
||||
|
||||
## Configuring VS Code
|
||||
|
||||
Using the [standard `compile_commands.json` database](https://clang.llvm.org/docs/JSONCompilationDatabase.html), we can get VS code C/C++ extension to use the exact same includes and defines used for your keyboard and keymap.
|
||||
|
||||
1. Run `qmk generate-compilation-database -kb <keyboard> -km <keymap>` to generate the `compile_commands.json`.
|
||||
1. Create `.vscode/c_cpp_properties.json` with the following content:
|
||||
```
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "qmk",
|
||||
"compilerArgs": ["-mmcu=atmega32u4"],
|
||||
"compilerPath": "/usr/bin/avr-gcc",
|
||||
"cStandard": "gnu11",
|
||||
"cppStandard": "gnu++14",
|
||||
"compileCommands": "${workspaceFolder}/compile_commands.json",
|
||||
"intelliSenseMode": "linux-gcc-arm",
|
||||
"browse": {
|
||||
"path": [
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"limitSymbolsToIncludedHeaders": true,
|
||||
"databaseFilename": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
```
|
||||
|
||||
Change values in `.vscode/c_cpp_properties.json` for your environment:
|
||||
|
||||
1. Copy the `-mmcu` argument from `compile_commands.json` into your `compilerArgs`. This is to work around a [bug in vscode c/c++ extension](https://github.com/microsoft/vscode-cpptools/issues/6478).
|
||||
1. Use the `compilerPath` from `compile_commands.json`.
|
||||
1. Modify `cStandard`, `cppStandard` and `intelliSenseMode` values to the correct values for your platform. See [this section](https://code.visualstudio.com/docs/cpp/c-cpp-properties-schema-reference#_configuration-properties) for reference. For WSL, it should still be gcc-x64.
|
||||
|
||||
And now you're ready to code QMK Firmware in VS Code
|
||||
|
||||
|
||||
## Troubleshooting VSCode C/C++ extension
|
||||
|
||||
If the defines are not matching what you expect, open the source code and run action `C/C++: Log Diagnostics`. This will list the exact list of defines and include paths defined in `compile_commands.json`, and if it's not part of your compilation database, it will tell you so.
|
||||
@@ -1,43 +0,0 @@
|
||||
include(ExternalProject)
|
||||
include(AddKeyboard)
|
||||
|
||||
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/build/targets")
|
||||
file(WRITE "${CMAKE_SOURCE_DIR}/build/targets" "")
|
||||
endif()
|
||||
|
||||
# if(DEFINED QMK_KEYBOARD_FOLDER)
|
||||
# if(NOT DEFINED QMK_KEYMAP_FOLDER)
|
||||
# set(QMK_KEYMAP_FOLDER "default")
|
||||
# endif()
|
||||
# add_keyboard(${QMK_KEYBOARD_FOLDER} ${QMK_KEYMAP_FOLDER})
|
||||
# endif()
|
||||
|
||||
# file(GLOB_RECURSE KEYBOARDS **/CMakeLists.txt)
|
||||
|
||||
# foreach(KEYBOARD_CMAKE ${KEYBOARDS})
|
||||
# get_filename_component(KEYBOARD_FOLDER_ABS "${KEYBOARD_CMAKE}" DIRECTORY)
|
||||
# file(RELATIVE_PATH KEYBOARD_FOLDER "${CMAKE_SOURCE_DIR}/keyboards" "${KEYBOARD_FOLDER_ABS}")
|
||||
# add_keyboard(${KEYBOARD_FOLDER} "default")
|
||||
# endforeach()
|
||||
|
||||
file(STRINGS "${CMAKE_SOURCE_DIR}/build/targets" TARGETS)
|
||||
|
||||
while(TARGETS)
|
||||
list(POP_FRONT TARGETS LINE)
|
||||
if (LINE MATCHES "(.+)\\|(.+)\\|(.+):(.+)\\|(.+)")
|
||||
set(KEYBOARD_FOLDER ${CMAKE_MATCH_3})
|
||||
set(KEYMAP_FOLDER ${CMAKE_MATCH_4})
|
||||
add_keyboard(${KEYBOARD_FOLDER} ${KEYMAP_FOLDER})
|
||||
endif()
|
||||
endwhile()
|
||||
|
||||
# list all keyboards in build/all_keyboards
|
||||
|
||||
file(GLOB_RECURSE POSSIBLE_KEYBOARDS **/info.json)
|
||||
|
||||
file(WRITE "${CMAKE_SOURCE_DIR}/build/all_keyboards" "")
|
||||
foreach(KEYBOARD_INFO ${POSSIBLE_KEYBOARDS})
|
||||
get_filename_component(KEYBOARD_FOLDER_ABS "${KEYBOARD_INFO}" DIRECTORY)
|
||||
file(RELATIVE_PATH KEYBOARD_FOLDER "${CMAKE_SOURCE_DIR}/keyboards" "${KEYBOARD_FOLDER_ABS}")
|
||||
file(APPEND "${CMAKE_SOURCE_DIR}/build/all_keyboards" "${KEYBOARD_FOLDER}\n")
|
||||
endforeach()
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"manufacturer": "ButterKeebs",
|
||||
"keyboard_name": "PocketPad",
|
||||
"maintainer": "qmk",
|
||||
"diode_direction": "ROW2COL",
|
||||
|
||||
"usb": {
|
||||
"device_version": "1.0.0",
|
||||
"pid": "0x1475",
|
||||
"vid": "0xFEED"
|
||||
},
|
||||
|
||||
"features": {
|
||||
"bootmagic": true,
|
||||
"command": false,
|
||||
"console": false,
|
||||
"extrakey": true,
|
||||
"mousekey": true,
|
||||
"nkro": true
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["F1", "C7", "D5", "B7"],
|
||||
"rows": ["F7", "F6", "F5", "F4", "B1"]
|
||||
},
|
||||
|
||||
"processor": "atmega32u4",
|
||||
"bootloader": "atmel-dfu",
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"layout": [
|
||||
{"x": 0, "y": 0, "matrix": [0,0]},
|
||||
{"x": 1, "y": 0, "matrix": [0,1]},
|
||||
{"x": 2, "y": 0, "matrix": [0,2]},
|
||||
{"x": 3, "y": 0, "matrix": [0,3]},
|
||||
|
||||
{"x": 0, "y": 1, "matrix": [1,0]},
|
||||
{"x": 1, "y": 1, "matrix": [1,1]},
|
||||
{"x": 2, "y": 1, "matrix": [1,2]},
|
||||
{"x": 3, "y": 1, "matrix": [1,3]},
|
||||
|
||||
{"x": 0, "y": 2, "matrix": [2,0]},
|
||||
{"x": 1, "y": 2, "matrix": [2,1]},
|
||||
{"x": 2, "y": 2, "matrix": [2,2]},
|
||||
{"x": 3, "y": 2, "matrix": [2,3]},
|
||||
|
||||
{"x": 0, "y": 3, "matrix": [3,0]},
|
||||
{"x": 1, "y": 3, "matrix": [3,1]},
|
||||
{"x": 2, "y": 3, "matrix": [3,2]},
|
||||
{"x": 3, "y": 3, "matrix": [3,3]},
|
||||
|
||||
{"x": 0, "y": 4, "matrix": [4,0]},
|
||||
{"x": 1, "y": 4, "matrix": [4,1]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// ButterKeebs <butterkeebs@github>
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
LAYOUT(
|
||||
KC_NUM_LOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS,
|
||||
KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS,
|
||||
KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_ENTER,
|
||||
KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_DOT,
|
||||
KC_F, KC_KP_0)
|
||||
};
|
||||
@@ -0,0 +1,27 @@
|
||||
# PocketPad
|
||||
|
||||

|
||||
|
||||
*The PocketPad is a tiny 18 key macropad/numpad using 6mm tactile switches.*
|
||||
|
||||
* Keyboard Maintainer: [ButterKeebs](https://github.com/butterkeebs)
|
||||
* Hardware Supported: *Supports current V1.0.0 PocketPad PCB and Elite C / pin compatible MCU boards.*
|
||||
* Hardware Availability: *Currently not for sale*
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make butterkeebs/pocketpad:default
|
||||
|
||||
Flashing example for this keyboard:
|
||||
|
||||
make butterkeebs/pocketpad:default:flash
|
||||
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||
|
||||
## Bootloader
|
||||
|
||||
Enter the bootloader in 3 ways:
|
||||
|
||||
* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
|
||||
* **Physical reset button**: Briefly press the button on the back of the PCB. (Not available on Revision 1.0.0 PCB)
|
||||
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available
|
||||
@@ -0,0 +1 @@
|
||||
# This file intentionally blank
|
||||
+7
-11
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2022 HorrorTroll <https://github.com/HorrorTroll>
|
||||
/* Copyright 2023 Citrus Lab
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -13,15 +13,11 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "led/flower_blooming/flower_blooming.h"
|
||||
// The pin connected to the data pin of the LEDs
|
||||
#define RGBLIGHT_LAYERS//允许您定义可打开或关闭的照明层。非常适合显示当前键盘层或大写锁定状态。
|
||||
#define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF//如果已定义,则即使 RGB 光源处于关闭状态,也会显示照明图层。
|
||||
|
||||
static HSV FLOWER_BLOOMING_math(HSV hsv, uint8_t i, uint8_t time) {
|
||||
if (g_led_config.point[i].y > k_rgb_matrix_center.y)
|
||||
hsv.h = g_led_config.point[i].x * 3 - g_led_config.point[i].y * 3 + time;
|
||||
else
|
||||
hsv.h = g_led_config.point[i].x * 3 - g_led_config.point[i].y * 3 - time;
|
||||
return hsv;
|
||||
}
|
||||
|
||||
bool FLOWER_BLOOMING(effect_params_t* params) { return effect_runner_bloom(params, &FLOWER_BLOOMING_math); }
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
#define LOCKING_RESYNC_ENABLE//尝试使开关状态与键盘指示灯状态保持一致
|
||||
@@ -0,0 +1,28 @@
|
||||
/* Copyright 2023 Citrus Lab
|
||||
*
|
||||
* This program 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 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "quantum.h"
|
||||
|
||||
//Indicator light function
|
||||
bool led_update_kb(led_t led_state) {
|
||||
if (led_update_user(led_state)) {
|
||||
if (led_state.caps_lock) {
|
||||
rgblight_setrgb_at(255, 255, 255, 0); //white
|
||||
} else {
|
||||
rgblight_setrgb_at(0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"keyboard_name": "Erdnuss65",
|
||||
"manufacturer": "Citrus Lab",
|
||||
"processor": "STM32F103",
|
||||
"bootloader": "stm32duino",
|
||||
"maintainer": "ctt",
|
||||
"usb": {
|
||||
"vid": "0x636C",
|
||||
"pid": "0x6374",
|
||||
"device_version": "0.0.1"
|
||||
},
|
||||
|
||||
"matrix_pins": {
|
||||
"rows":
|
||||
["B10","B1", "B0","A7","A6"],
|
||||
"cols":
|
||||
["B12","B14","B15","A8","B13","B3","B4","B5","A1","A2","A0","A3","A4","A5","B11"]
|
||||
},
|
||||
|
||||
"diode_direction": "COL2ROW",
|
||||
|
||||
"features": {
|
||||
"bootmagic": true,
|
||||
"mousekey": true,
|
||||
"extrakey": true,
|
||||
"console": false,
|
||||
"command": false,
|
||||
"nkro": true,
|
||||
"backlight": false,
|
||||
"rgblight": true,
|
||||
"audio": false
|
||||
},
|
||||
"rgblight": {
|
||||
"pin": "A15",
|
||||
"led_count": 1
|
||||
},
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"layout": [
|
||||
{"label": "ESC K00 (B10,B12)", "matrix": [0, 0], "x": 0, "y": 0},
|
||||
{"label": "1 K01 (B10,B14)", "matrix": [0, 1], "x": 1, "y": 0},
|
||||
{"label": "2 K02 (B10,B15)", "matrix": [0, 2], "x": 2, "y": 0},
|
||||
{"label": "3 K03 (B10,A8)", "matrix": [0, 3], "x": 3, "y": 0},
|
||||
{"label": "4 K04 (B10,B13)", "matrix": [0, 4], "x": 4, "y": 0},
|
||||
{"label": "5 K05 (B10,B3)", "matrix": [0, 5], "x": 5, "y": 0},
|
||||
{"label": "6 K06 (B10,B4)", "matrix": [0, 6], "x": 6, "y": 0},
|
||||
{"label": "7 K07 (B10,B5)", "matrix": [0, 7], "x": 7, "y": 0},
|
||||
{"label": "8 K08 (B10,A1)", "matrix": [0, 8], "x": 8, "y": 0},
|
||||
{"label": "9 K09 (B10,A2)", "matrix": [0, 9], "x": 9, "y": 0},
|
||||
{"label": "0 K0A (B10,A0)", "matrix": [0, 10], "x": 10, "y": 0},
|
||||
{"label": "- K0B (B10,A3)", "matrix": [0, 11], "x": 11, "y": 0},
|
||||
{"label": "= K0C (B10,A4)", "matrix": [0, 12], "x": 12, "y": 0},
|
||||
{"label": "BACKSPACE K0D (B10,A5)", "matrix": [0, 13], "x": 13, "y": 0, "w": 2},
|
||||
{"label": "INS (B10,B11)", "matrix": [0, 14], "x": 15, "y": 0},
|
||||
{"label": "TAB (B1,B12)", "matrix": [1, 0], "x": 0, "y": 1, "w": 1.5},
|
||||
{"label": "Q (B1,B14)", "matrix": [1, 1], "x": 1.5, "y": 1},
|
||||
{"label": "W (B1,B15)", "matrix": [1, 2], "x": 2.5, "y": 1},
|
||||
{"label": "E (B1,A8)", "matrix": [1, 3], "x": 3.5, "y": 1},
|
||||
{"label": "R (B1,B13)", "matrix": [1, 4], "x": 4.5, "y": 1},
|
||||
{"label": "T (B1,B3)", "matrix": [1, 5], "x": 5.5, "y": 1},
|
||||
{"label": "Y (B1,B4)", "matrix": [1, 6], "x": 6.5, "y": 1},
|
||||
{"label": "U (B1,B5)", "matrix": [1, 7], "x": 7.5, "y": 1},
|
||||
{"label": "I (B1,A1)", "matrix": [1, 8], "x": 8.5, "y": 1},
|
||||
{"label": "O (B1,A2)", "matrix": [1, 9], "x": 9.5, "y": 1},
|
||||
{"label": "P (B1,A0)", "matrix": [1, 10], "x": 10.5, "y": 1},
|
||||
{"label": "[ (B1,A3)", "matrix": [1, 11], "x": 11.5, "y": 1},
|
||||
{"label": "] (B1,A4)", "matrix": [1, 12], "x": 12.5, "y": 1},
|
||||
{"label": "\" (B1,A5)", "matrix": [1, 13], "x": 13.5, "y": 1, "w": 1.5},
|
||||
{"label": "DEL (B1,B11)", "matrix": [1, 14], "x": 15, "y": 1},
|
||||
{"label": "CAPSLOCK (B0,B12)", "matrix": [2, 0], "x": 0, "y": 2, "w": 1.25},
|
||||
{"label": "A (B0,B14)", "matrix": [2, 1], "x": 1.75, "y": 2},
|
||||
{"label": "S (B0,B15)", "matrix": [2, 2], "x": 2.75, "y": 2},
|
||||
{"label": "D (B0,A8)", "matrix": [2, 3], "x": 3.75, "y": 2},
|
||||
{"label": "F (B0,B13)", "matrix": [2, 4], "x": 4.75, "y": 2},
|
||||
{"label": "G (B0,B3)", "matrix": [2, 5], "x": 5.75, "y": 2},
|
||||
{"label": "H (B0,B4)", "matrix": [2, 6], "x": 6.75, "y": 2},
|
||||
{"label": "J (B0,B5)", "matrix": [2, 7], "x": 7.75, "y": 2},
|
||||
{"label": "K (B0,A1)", "matrix": [2, 8], "x": 8.75, "y": 2},
|
||||
{"label": "L (B0,A2)", "matrix": [2, 9], "x": 9.75, "y": 2},
|
||||
{"label": "; (B0,A0)", "matrix": [2, 10], "x": 10.75, "y": 2},
|
||||
{"label": "' (B0,A3)", "matrix": [2, 11], "x": 11.75, "y": 2},
|
||||
{"label": "ENTER (B0,A5)", "matrix": [2, 13], "x": 12.75, "y": 2, "w": 2.25},
|
||||
{"label": "PGUP (B0,B11)", "matrix": [2, 14], "x": 15, "y": 2},
|
||||
{"label": "LSHIFT (A7,B12)", "matrix": [3, 0], "x": 0, "y": 3, "w": 2.25},
|
||||
{"label": "Z (A7,B14)", "matrix": [3, 1], "x": 2.25, "y": 3},
|
||||
{"label": "X (A7,B15)", "matrix": [3, 2], "x": 3.25, "y": 3},
|
||||
{"label": "C (A7,A8)", "matrix": [3, 3], "x": 4.25, "y": 3},
|
||||
{"label": "V (A7,B13)", "matrix": [3, 4], "x": 5.25, "y": 3},
|
||||
{"label": "B (A7,B3)", "matrix": [3, 5], "x": 6.25, "y": 3},
|
||||
{"label": "N (A7,B4)", "matrix": [3, 6], "x": 7.25, "y": 3},
|
||||
{"label": "M (A7,B5)", "matrix": [3, 7], "x": 8.25, "y": 3},
|
||||
{"label": ", (A7,A1)", "matrix": [3, 8], "x": 9.25, "y": 3},
|
||||
{"label": ". (A7,A2)", "matrix": [3, 9], "x": 10.25, "y": 3},
|
||||
{"label": "/ (A7,A0)", "matrix": [3, 10], "x": 11.25, "y": 3},
|
||||
{"label": "RSHIFT (A7,A4)", "matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75},
|
||||
{"label": "UP (A7,A5)", "matrix": [3, 13], "x": 14, "y": 3},
|
||||
{"label": "PGDN (A7,B11)", "matrix": [3, 14], "x": 15, "y": 3},
|
||||
{"label": "LCTRL (A6,B12)", "matrix": [4, 0], "x": 0, "y": 4, "w": 1.5},
|
||||
{"label": "WIN (A6,B14)", "matrix": [4, 1], "x": 1.5, "y": 4},
|
||||
{"label": "ALT (A6,B15)", "matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.5},
|
||||
{"label": "SPACE (A6,A8)", "matrix": [4, 3], "x": 4, "y": 4, "w": 7},
|
||||
{"label": "FN (A6,A0)", "matrix": [4, 10], "x": 11, "y": 4, "w": 1.5},
|
||||
{"label": "LEFT (A6,A4)", "matrix": [4, 12], "x": 13, "y": 4},
|
||||
{"label": "DOWN (A6,A5)", "matrix": [4, 13], "x": 14, "y": 4},
|
||||
{"label": "RIGHT (A6,B11)", "matrix": [4, 14], "x": 15, "y": 4}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// Copyright 2023 Citrus Lab
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[0] = LAYOUT(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL,
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_PGDN,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
|
||||
[1] = LAYOUT(
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_MPRV,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______, _______, RESET, KC_MNXT,
|
||||
_______, _______, _______, _______, _______, _______, _______, KC_CALC, _______, _______, _______, _______, _______, KC_HOME,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MYCM, KC_VOLU, KC_END,
|
||||
_______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, KC_MPLY
|
||||
)
|
||||
};
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
// Copyright 2023 Citrus Lab
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[0] = LAYOUT(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL,
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_PGDN,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
|
||||
[1] = LAYOUT(
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_MPRV,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______, _______, RESET, KC_MNXT,
|
||||
_______, _______, _______, _______, _______, _______, _______, KC_CALC, _______, _______, _______, _______, _______, KC_HOME,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MYCM, KC_VOLU, KC_END,
|
||||
_______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, KC_MPLY
|
||||
),
|
||||
|
||||
[2] = LAYOUT(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[3] = LAYOUT(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
VIA_ENABLE = yes
|
||||
@@ -0,0 +1,22 @@
|
||||
# Erdnuss65
|
||||
|
||||
* Keyboard Maintainer: [Citrus Lab](https://github.com/ctt-t)
|
||||
* Hardware Supported: STM32F103C8T6
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make citrus/erdnuss65:default
|
||||
|
||||
Flashing example for this keyboard:
|
||||
|
||||
make citrus/erdnuss65:default:flash
|
||||
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||
|
||||
## Bootloader
|
||||
|
||||
Enter the bootloader in 3 ways:
|
||||
|
||||
* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
|
||||
* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead
|
||||
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available
|
||||
@@ -0,0 +1,2 @@
|
||||
# Enter lower-power sleep mode when on the ChibiOS idle thread
|
||||
OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE
|
||||
@@ -0,0 +1,2 @@
|
||||
# Citrus Lab
|
||||
QMK folders for PCB commissions.
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
This is the c configuration file for the keymap
|
||||
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
Copyright 2015 Jack Humbert
|
||||
|
||||
This program 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 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define TAPPING_FORCE_HOLD
|
||||
#define TAPPING_TERM 300
|
||||
|
||||
#undef RGBLED_NUM
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
#define RGBLIGHT_EFFECT_SNAKE
|
||||
#define RGBLIGHT_EFFECT_KNIGHT
|
||||
#define RGBLIGHT_EFFECT_CHRISTMAS
|
||||
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
#define RGBLIGHT_EFFECT_RGB_TEST
|
||||
#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
#define RGBLIGHT_EFFECT_TWINKLE
|
||||
#define RGBLED_NUM 27
|
||||
#define RGBLIGHT_LIMIT_VAL 120
|
||||
#define RGBLIGHT_HUE_STEP 10
|
||||
#define RGBLIGHT_SAT_STEP 17
|
||||
#define RGBLIGHT_VAL_STEP 17
|
||||
@@ -0,0 +1,38 @@
|
||||
// Copyright 2021 Shane Dowling (@shano)
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
#define KC_ESCC MT(MOD_LCTL, KC_ESC)
|
||||
#define KC_ENTS MT(MOD_LSFT, KC_ENT)
|
||||
#define KC_FN MO(_FN)
|
||||
|
||||
enum layers {
|
||||
_QWERTY,
|
||||
_FN,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_QWERTY] = LAYOUT(
|
||||
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||
KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_BSPC,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
KC_LSFT, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT,
|
||||
//|----+----+----+----+----+----+ |----+----+----+----+----+----|
|
||||
KC_ESCC, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_ESC ,
|
||||
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
|
||||
KC_LALT,KC_LGUI,KC_SPC , KC_ENTS,KC_FN,KC_FN
|
||||
// `----+----+----' `+---+----+----'c
|
||||
),
|
||||
[_FN] = LAYOUT(
|
||||
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||
_______,KC_1, KC_2 ,KC_3, KC_4,KC_5, KC_6,KC_7,KC_8,KC_9,KC_0,KC_BSPC,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
_______,KC_EXCLAIM,KC_AT,KC_HASH,KC_DOLLAR,KC_PERCENT, KC_LEFT,KC_DOWN, KC_UP ,KC_RIGHT,KC_LBRC,KC_RBRC,
|
||||
//|----+----+----+----+----+----+ |----+----+----+----+----+----|
|
||||
_______, KC_CIRCUMFLEX , KC_AMPR , KC_ASTERISK , KC_LEFT_PAREN , KC_RIGHT_PAREN , KC_MINUS,KC_PLUS,KC_EQL,KC_PIPE,KC_GRAVE,KC_BACKSLASH,
|
||||
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
|
||||
_______,_______,_______ , _______,_______,_______
|
||||
// `----+----+----' `----+----+----'
|
||||
)
|
||||
};
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# MD40: Minimally Disruptive 40% Keymap
|
||||
|
||||
This keymap is an attempt to go from a standard keyboard layout to a 40% keyboard with minimal disruption.
|
||||
|
||||
Some aims:
|
||||
- Two layers only
|
||||
- Existing keyboard positions where possible
|
||||
- Exceptions where it's not possible
|
||||
- Exceptions where it makes sense
|
||||
|
||||
Supports crkbd only.
|
||||
|
||||
## Base Layer
|
||||
|
||||

|
||||
|
||||
## Fn Layer
|
||||
|
||||

|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
|
||||
MOUSEKEY_ENABLE = no # Mouse keys
|
||||
NKRO_ENABLE = no # Enable N-Key Rollover
|
||||
@@ -7,3 +7,7 @@
|
||||
#define TAPPING_TERM 230
|
||||
#define IGNORE_MOD_TAP_INTERRUPT
|
||||
|
||||
// Handle master/slave detection on low cost Promicro
|
||||
#ifdef __AVR__
|
||||
# define SPLIT_USB_DETECT
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* This program 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 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/* key matrix size, only 1x4 are used in current state.
|
||||
IO expander setup would allow up to 1x16 + 1 from the MCU */
|
||||
#define MATRIX_ROWS 1
|
||||
#define MATRIX_COLS 17
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"manufacturer": "Geistmaschine",
|
||||
"keyboard_name": "Macropod",
|
||||
"maintainer": "ebastler",
|
||||
"bootloader": "atmel-dfu",
|
||||
"processor": "atmega32u4",
|
||||
"url": "https://geistmaschine.io/",
|
||||
"usb": {
|
||||
"device_version": "1.0.0",
|
||||
"pid": "0x0004",
|
||||
"vid": "0x676D"
|
||||
},
|
||||
"features": {
|
||||
"bootmagic": true,
|
||||
"command": false,
|
||||
"console": false,
|
||||
"extrakey": true,
|
||||
"mousekey": false,
|
||||
"nkro": false,
|
||||
"encoder": true
|
||||
},
|
||||
"encoder": {
|
||||
"rotary": [
|
||||
{
|
||||
"pin_a": "D3",
|
||||
"pin_b": "D5",
|
||||
"resolution": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
"layouts": {
|
||||
"LAYOUT_fourkey": {
|
||||
"layout": [
|
||||
{"x":0, "y":0, "matrix":[0,0] },
|
||||
{"x":0, "y":1.25, "matrix":[0,1] },
|
||||
{"x":0, "y":2.25, "matrix":[0,2] },
|
||||
{"x":0, "y":3.25, "matrix":[0,3] }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/* Copyright 2023 Moritz Plattner
|
||||
*
|
||||
* This program 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 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_fourkey (
|
||||
LT(1, KC_MUTE), KC_MPRV, KC_MPLY, KC_MNXT
|
||||
),
|
||||
|
||||
[1] = LAYOUT_fourkey (
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
|
||||
};
|
||||
|
||||
#if defined(ENCODER_MAP_ENABLE)
|
||||
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
|
||||
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
[1] = { ENCODER_CCW_CW(KC_MRWD, KC_MFFD) },
|
||||
};
|
||||
#endif
|
||||
@@ -0,0 +1 @@
|
||||
ENCODER_MAP_ENABLE = yes
|
||||
@@ -0,0 +1,35 @@
|
||||
/* Copyright 2023 Moritz Plattner
|
||||
*
|
||||
* This program 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 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_fourkey (
|
||||
LT(1, KC_MUTE), KC_MPRV, KC_MPLY, KC_MNXT
|
||||
),
|
||||
|
||||
[1] = LAYOUT_fourkey (
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
|
||||
};
|
||||
|
||||
#if defined(ENCODER_MAP_ENABLE)
|
||||
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
|
||||
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
[1] = { ENCODER_CCW_CW(KC_MRWD, KC_MFFD) },
|
||||
};
|
||||
#endif
|
||||
@@ -0,0 +1,2 @@
|
||||
ENCODER_MAP_ENABLE = yes
|
||||
VIA_ENABLE = yes
|
||||
@@ -0,0 +1,21 @@
|
||||
// Copyright 2022 QMK
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
// This will be overridden by encoder map in all default keymaps, but serves as a catch-all for user keymaps that may omit the map.
|
||||
#if defined (ENCODER_ENABLE) && !defined (ENCODER_MAP_ENABLE)
|
||||
bool encoder_update_kb(uint8_t index, bool clockwise) {
|
||||
if (!encoder_update_user(index, clockwise)) {
|
||||
return false; /* Don't process further events if user function exists and returns false */
|
||||
}
|
||||
if (index == 0) { /* First encoder */
|
||||
if (clockwise) {
|
||||
tap_code_delay(KC_VOLU, 10);
|
||||
} else {
|
||||
tap_code_delay(KC_VOLD, 10);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,87 @@
|
||||
/* Copyright 2023 ebastler and elpekenin
|
||||
*
|
||||
* This program 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 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "pca9555.h"
|
||||
#include "quantum.h"
|
||||
|
||||
// PCA9555 i2c address, 0x20: A0 = 0, A1 = 0, A2 = 0
|
||||
#define IC1 0x20
|
||||
|
||||
// Define how long to wait to reach the IO expander after connection loss again
|
||||
// Since this board is modular, it should not spam unnecessary i2c requests if used without a module
|
||||
#define RETRY_TIMESPAN 2000
|
||||
|
||||
typedef enum {
|
||||
PLUGGED,
|
||||
DOUBTFUL,
|
||||
UNPLUGGED
|
||||
} expander_status_t;
|
||||
|
||||
void pca9555_setup(void) {
|
||||
// Initialize the expander, no need to set ports to inputs as that is the default behavior
|
||||
pca9555_init(IC1);
|
||||
}
|
||||
|
||||
void matrix_init_custom(void) {
|
||||
// Encoder pushbutton on the MCU is connected to PD2
|
||||
setPinInputHigh(D2);
|
||||
pca9555_setup();
|
||||
}
|
||||
|
||||
bool matrix_scan_custom(matrix_row_t current_matrix[]) {
|
||||
static expander_status_t status = DOUBTFUL;
|
||||
static uint32_t retry_timer = 0;
|
||||
|
||||
// initialize one byte filled with 1
|
||||
uint8_t pin_states = 0xFF;
|
||||
|
||||
|
||||
if (status != UNPLUGGED || timer_elapsed32(retry_timer) > RETRY_TIMESPAN) {
|
||||
// If the chip was unplugged before, it needs to be re-initialized
|
||||
if(status==UNPLUGGED) {
|
||||
pca9555_setup();
|
||||
}
|
||||
// Read the entire port into this byte, 1 = not pressed, 0 = pressed
|
||||
bool ret = pca9555_readPins(IC1, PCA9555_PORT0, &pin_states);
|
||||
|
||||
// Update state
|
||||
if (ret) {
|
||||
status = PLUGGED;
|
||||
} else {
|
||||
switch (status) {
|
||||
case PLUGGED:
|
||||
status = DOUBTFUL;
|
||||
break;
|
||||
|
||||
case DOUBTFUL:
|
||||
status = UNPLUGGED;
|
||||
break;
|
||||
|
||||
// If we've diagnosed as unplugged, update timer to not read I2C
|
||||
case UNPLUGGED:
|
||||
retry_timer = timer_read32();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Shift pin states by 1 to make room for the switch connected to the MCU, then OR them together and invert (as QMK uses inverted logic compared to the electrical levels)
|
||||
matrix_row_t data = ~(pin_states << 1 | readPin(D2));
|
||||
|
||||
bool changed = current_matrix[0] != data;
|
||||
current_matrix[0] = data;
|
||||
|
||||
return changed;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
# Geistmaschine Macropod
|
||||
|
||||

|
||||
|
||||
Macropod is a modular macropad, designed around a central big encoder with a magnetic connector for modularity. The default module uses three MX style keys.
|
||||
* Keyboard Maintainer: [ebastler](https://github.com/ebastler)
|
||||
* Hardware Supported: Macropod rev1
|
||||
* Hardware Availability: [geistmaschine.io](https://geistmaschine.io/)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
qmk compile -kb geistmaschine/macropod -km default
|
||||
|
||||
Flashing example for this keyboard:
|
||||
|
||||
qmk flash -kb geistmaschine/macropod -km default
|
||||
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||
|
||||
## Bootloader
|
||||
|
||||
Enter the bootloader in 2 ways:
|
||||
|
||||
* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (the knob on the main module) and plug in the keyboard
|
||||
* **Physical reset button**: Briefly tap the button marked "RST" on the back of the main module PCB
|
||||
@@ -0,0 +1,5 @@
|
||||
CUSTOM_MATRIX = lite
|
||||
|
||||
VPATH += drivers/gpio
|
||||
SRC += pca9555.c matrix.c
|
||||
QUANTUM_LIB_SRC += i2c_master.c
|
||||
@@ -0,0 +1,84 @@
|
||||
/* Copyright 2021 Glorious, LLC <salman@pcgamingrace.com>
|
||||
* Modified 2022 by rustedaperture for qmk_firmware
|
||||
*
|
||||
* This program 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 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define SLIDER_PIN B0
|
||||
#define MIDI_ADVANCED
|
||||
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
#define SPI_DRIVER SPIDQ
|
||||
#define SPI_SCK_PIN B3
|
||||
#define SPI_MOSI_PIN B5
|
||||
#define SPI_MISO_PIN B4
|
||||
|
||||
#define DRIVER_1_CS B12
|
||||
#define DRIVER_1_EN A15
|
||||
#define DRIVER_1_PW_EN B13
|
||||
|
||||
#define DRIVER_COUNT 1
|
||||
|
||||
#define RGB_MATRIX_LED_COUNT 31
|
||||
|
||||
#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B6
|
||||
#define WEAR_LEVELING_BACKING_SIZE 2048
|
||||
|
||||
#define ENABLE_RGB_MATRIX_ALPHAS_MODS
|
||||
#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
|
||||
#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
|
||||
#define ENABLE_RGB_MATRIX_BREATHING
|
||||
#define ENABLE_RGB_MATRIX_BAND_SAT
|
||||
#define ENABLE_RGB_MATRIX_BAND_VAL
|
||||
#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
|
||||
#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
|
||||
#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
|
||||
#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
|
||||
#define ENABLE_RGB_MATRIX_CYCLE_ALL
|
||||
#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
|
||||
#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
|
||||
#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
|
||||
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
|
||||
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
|
||||
#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
|
||||
#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
|
||||
#define ENABLE_RGB_MATRIX_DUAL_BEACON
|
||||
#define ENABLE_RGB_MATRIX_RAINBOW_BEACON
|
||||
#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
|
||||
#define ENABLE_RGB_MATRIX_RAINDROPS
|
||||
#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
|
||||
#define ENABLE_RGB_MATRIX_HUE_BREATHING
|
||||
#define ENABLE_RGB_MATRIX_HUE_PENDULUM
|
||||
#define ENABLE_RGB_MATRIX_HUE_WAVE
|
||||
#define ENABLE_RGB_MATRIX_PIXEL_RAIN
|
||||
#define ENABLE_RGB_MATRIX_PIXEL_FLOW
|
||||
#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
|
||||
#define ENABLE_RGB_MATRIX_TYPING_HEATMAP
|
||||
#define ENABLE_RGB_MATRIX_DIGITAL_RAIN
|
||||
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
|
||||
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE
|
||||
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
|
||||
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
|
||||
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
|
||||
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
|
||||
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
|
||||
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
|
||||
#define ENABLE_RGB_MATRIX_SPLASH
|
||||
#define ENABLE_RGB_MATRIX_MULTISPLASH
|
||||
#define ENABLE_RGB_MATRIX_SOLID_SPLASH
|
||||
#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
|
||||
+10
-6
@@ -1,4 +1,5 @@
|
||||
/* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll>
|
||||
/* Copyright 2021 Glorious, LLC <salman@pcgamingrace.com>
|
||||
* Modified 2022 by rustedaperture for qmk_firmware
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -13,10 +14,13 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
static HSV COOL_DIAGONAL_math(HSV hsv, uint8_t i, uint8_t time) {
|
||||
hsv.h = (g_led_config.point[i].x / 4) - g_led_config.point[i].y - time;
|
||||
return hsv;
|
||||
}
|
||||
#define HAL_USE_SPI TRUE
|
||||
#define SPI_USE_WAIT TRUE
|
||||
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
|
||||
#define HAL_USE_ADC TRUE
|
||||
|
||||
bool COOL_DIAGONAL(effect_params_t* params) { return effect_runner_i(params, &COOL_DIAGONAL_math); }
|
||||
|
||||
#include_next <halconf.h>
|
||||
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"keyboard_name": "GMMK Numpad",
|
||||
"manufacturer": "Glorious",
|
||||
"url": "https://www.gloriousgaming.com/products/gmmk-numpad",
|
||||
"maintainer": "GloriousThrall",
|
||||
"usb": {
|
||||
"vid": "0x320F",
|
||||
"pid": "0x5088",
|
||||
"device_version": "0.0.1"
|
||||
},
|
||||
"encoder": {
|
||||
"rotary": [
|
||||
{"pin_a": "A2", "pin_b": "A1"}
|
||||
]
|
||||
},
|
||||
"processor": "WB32F3G71",
|
||||
"bootloader": "wb32-dfu",
|
||||
"diode_direction": "ROW2COL",
|
||||
"matrix_pins": {
|
||||
"rows": ["A3", "A4", "A5", "A6", "A7"],
|
||||
"cols": ["B7", "B1", "B10", "B11"]
|
||||
},
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"layout": [
|
||||
{"label": "NUM", "matrix": [0, 0], "x": 0, "y": 0},
|
||||
{"label": "/", "matrix": [0, 1], "x": 1, "y": 0},
|
||||
{"label": "*", "matrix": [0, 2], "x": 2, "y": 0},
|
||||
{"label": "-", "matrix": [0, 3], "x": 3, "y": 0},
|
||||
|
||||
{"label": "7", "matrix": [1, 0], "x": 0, "y": 1},
|
||||
{"label": "8", "matrix": [1, 1], "x": 1, "y": 1},
|
||||
{"label": "9", "matrix": [1, 2], "x": 2, "y": 1},
|
||||
{"label": "+", "matrix": [1, 3], "x": 3, "y": 1, "h": 2},
|
||||
|
||||
{"label": "4", "matrix": [2, 0], "x": 0, "y": 2},
|
||||
{"label": "5", "matrix": [2, 1], "x": 1, "y": 2},
|
||||
{"label": "6", "matrix": [2, 2], "x": 2, "y": 2},
|
||||
{"label": "CALC", "matrix": [2, 3], "x": 3, "y": 2},
|
||||
|
||||
{"label": "1", "matrix": [3, 0], "x": 0, "y": 3},
|
||||
{"label": "2", "matrix": [3, 1], "x": 1, "y": 3},
|
||||
{"label": "3", "matrix": [3, 2], "x": 2, "y": 3},
|
||||
{"label": "RET", "matrix": [3, 3], "x": 3, "y": 3, "h": 2},
|
||||
|
||||
{"label": "0", "matrix": [4, 0], "x": 0, "y": 4, "w": 2},
|
||||
{"label": ".", "matrix": [4, 3], "x": 3, "y": 4}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/* Copyright 2021 Glorious, LLC <salman@pcgamingrace.com>
|
||||
* Modified 2022 by rustedaperture for qmk_firmware
|
||||
|
||||
This program 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 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "analog.h"
|
||||
#include "qmk_midi.h"
|
||||
|
||||
// clang-format off
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
// NUM / * -
|
||||
// 7 8 9 +
|
||||
// 4 5 6 ENCODER
|
||||
// 1 2 3 RET
|
||||
// 0 .
|
||||
|
||||
[0] = LAYOUT(
|
||||
MO(1), KC_PSLS, KC_PAST, KC_PMNS,
|
||||
KC_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
KC_P4, KC_P5, KC_P6, KC_CALC,
|
||||
KC_P1, KC_P2, KC_P3, KC_PENT,
|
||||
KC_P0, KC_PDOT
|
||||
),
|
||||
[1] = LAYOUT(
|
||||
_______, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
KC_P7, RGB_VAI, KC_P9, KC_PPLS,
|
||||
RGB_RMOD, KC_P5, RGB_MOD, KC_CALC,
|
||||
KC_P1, RGB_VAD, KC_P3, KC_PENT,
|
||||
RGB_TOG, QK_BOOT
|
||||
)
|
||||
};
|
||||
|
||||
// Potentiometer Slider, MIDI Control
|
||||
|
||||
uint8_t divisor = 0;
|
||||
|
||||
void slider(void) {
|
||||
if (divisor++) { /* only run the slider function 1/256 times it's called */
|
||||
return;
|
||||
}
|
||||
midi_send_cc(&midi_device, 2, 0x3E, 0x7F + (analogReadPin(SLIDER_PIN) >> 3));
|
||||
}
|
||||
|
||||
void housekeeping_task_user(void) {
|
||||
slider();
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
/* Copyright 2021 Glorious, LLC <salman@pcgamingrace.com>
|
||||
Modified 2022 by rustedaperture for qmk_firmware
|
||||
This program 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 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "analog.h"
|
||||
#include "qmk_midi.h"
|
||||
|
||||
// clang-format off
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
// NUM / * -
|
||||
// 7 8 9 +
|
||||
// 4 5 6 ENCODER
|
||||
// 1 2 3 RET
|
||||
// 0 .
|
||||
|
||||
[0] = LAYOUT(
|
||||
MO(1), KC_PSLS, KC_PAST, KC_PMNS,
|
||||
KC_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
KC_P4, KC_P5, KC_P6, KC_CALC,
|
||||
KC_P1, KC_P2, KC_P3, KC_PENT,
|
||||
KC_P0, KC_PDOT
|
||||
),
|
||||
[1] = LAYOUT(
|
||||
_______, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
KC_P7, RGB_VAI, KC_P9, KC_PPLS,
|
||||
RGB_RMOD, KC_P5, RGB_MOD, KC_CALC,
|
||||
KC_P1, RGB_VAD, KC_P3, KC_PENT,
|
||||
RGB_TOG, QK_BOOT
|
||||
),
|
||||
[2] = LAYOUT(
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______
|
||||
),
|
||||
[3] = LAYOUT(
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______
|
||||
),
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
|
||||
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
[1] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
[2] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
[3] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }
|
||||
};
|
||||
|
||||
// Potentiometer Slider, MIDI Control
|
||||
|
||||
uint8_t divisor = 0;
|
||||
|
||||
void slider(void) {
|
||||
if (divisor++) { /* only run the slider function 1/256 times it's called */
|
||||
return;
|
||||
}
|
||||
midi_send_cc(&midi_device, 2, 0x3E, 0x7F + (analogReadPin(SLIDER_PIN) >> 3));
|
||||
}
|
||||
|
||||
void housekeeping_task_user(void) {
|
||||
slider();
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
VIA_ENABLE=yes
|
||||
ENCODER_MAP_ENABLE=yes
|
||||
@@ -0,0 +1,133 @@
|
||||
// Copyright 2023 Cameron Varley (@RustedAperture)
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
/*
|
||||
* scan matrix
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "wait.h"
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "debounce.h"
|
||||
#include "quantum.h"
|
||||
|
||||
/* matrix state(1:on, 0:off) */
|
||||
extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
|
||||
extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
|
||||
|
||||
static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||
static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||
#define MATRIX_ROW_SHIFTER ((matrix_row_t)1)
|
||||
|
||||
static inline void setPinOutput_writeLow(pin_t pin) {
|
||||
ATOMIC_BLOCK_FORCEON {
|
||||
setPinOutput(pin);
|
||||
writePinLow(pin);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void setPinOutput_writeHigh(pin_t pin) {
|
||||
ATOMIC_BLOCK_FORCEON {
|
||||
setPinOutput(pin);
|
||||
writePinHigh(pin);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void setPinInputHigh_atomic(pin_t pin) {
|
||||
ATOMIC_BLOCK_FORCEON {
|
||||
setPinInputHigh(pin);
|
||||
}
|
||||
}
|
||||
|
||||
static inline uint8_t readMatrixPin(pin_t pin) {
|
||||
if (pin != NO_PIN) {
|
||||
return readPin(pin);
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
static bool select_col(uint8_t col) {
|
||||
pin_t pin = col_pins[col];
|
||||
if (pin != NO_PIN) {
|
||||
setPinOutput_writeLow(pin);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void unselect_col(uint8_t col) {
|
||||
pin_t pin = col_pins[col];
|
||||
if (pin != NO_PIN) {
|
||||
# ifdef MATRIX_UNSELECT_DRIVE_HIGH
|
||||
setPinOutput_writeHigh(pin);
|
||||
# else
|
||||
setPinInputHigh_atomic(pin);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
||||
static void unselect_cols(void) {
|
||||
for (uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||
unselect_col(x);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
__attribute__((weak)) void matrix_init_custom(void) {
|
||||
unselect_cols();
|
||||
for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||
if (row_pins[x] != NO_PIN) {
|
||||
setPinInputHigh_atomic(row_pins[x]);
|
||||
}
|
||||
}
|
||||
setPinInputHigh_atomic(B8);
|
||||
}
|
||||
|
||||
__attribute__((weak)) void matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col, matrix_row_t row_shifter) { // Start with a clear matrix row
|
||||
bool key_pressed = false;
|
||||
|
||||
// Select col
|
||||
if (!select_col(current_col)) { // select col
|
||||
return; // skip NO_PIN col
|
||||
}
|
||||
matrix_output_select_delay();
|
||||
|
||||
// For each row...
|
||||
for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) {
|
||||
// Check row pin state
|
||||
if (current_col == 3 && row_index == 2 && readMatrixPin(B8) == 1) {
|
||||
current_matrix[row_index] |= row_shifter;
|
||||
key_pressed = !readMatrixPin(B8);
|
||||
} else if (readMatrixPin(row_pins[row_index]) == 0) {
|
||||
// Pin LO, set col bit
|
||||
current_matrix[row_index] |= row_shifter;
|
||||
key_pressed = true;
|
||||
} else {
|
||||
// Pin HI, clear col bit
|
||||
current_matrix[row_index] &= ~row_shifter;
|
||||
}
|
||||
}
|
||||
|
||||
// Unselect col
|
||||
unselect_col(current_col);
|
||||
matrix_output_unselect_delay(current_col, key_pressed); // wait for all Row signals to go HIGH
|
||||
}
|
||||
|
||||
bool matrix_scan_custom(matrix_row_t current_matrix[]) {
|
||||
static matrix_row_t temp_matrix[MATRIX_ROWS] = {0};
|
||||
|
||||
matrix_row_t row_shifter = MATRIX_ROW_SHIFTER;
|
||||
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
|
||||
matrix_read_rows_on_col(temp_matrix, current_col, row_shifter);
|
||||
}
|
||||
|
||||
bool changed = memcmp(current_matrix, temp_matrix, sizeof(temp_matrix)) != 0;
|
||||
if (changed) {
|
||||
memcpy(current_matrix, temp_matrix, sizeof(temp_matrix));
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
+9
-8
@@ -1,4 +1,5 @@
|
||||
/* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll>
|
||||
/* Copyright 2021 Glorious, LLC <salman@pcgamingrace.com>
|
||||
* Modified 2022 by rustedaperture for qmk_firmware
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -14,12 +15,12 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "led/rainbow_reactive_simple/rainbow_reactive_simple.h"
|
||||
#pragma once
|
||||
|
||||
static HSV RAINBOW_REACTIVE_SIMPLE_math(HSV hsv, uint8_t i, uint8_t time, uint16_t offset) {
|
||||
hsv.h = g_led_config.point[i].x - time;
|
||||
hsv.v = scale8(255 - offset, hsv.v);
|
||||
return hsv;
|
||||
}
|
||||
#include_next <mcuconf.h>
|
||||
|
||||
bool RAINBOW_REACTIVE_SIMPLE(effect_params_t* params) { return effect_rainbow_reactive(params, &RAINBOW_REACTIVE_SIMPLE_math); }
|
||||
#undef WB32_SPI_USE_QSPI
|
||||
#define WB32_SPI_USE_QSPI TRUE
|
||||
|
||||
// #undef WB32_ADC_USE_ADC1
|
||||
#define WB32_ADC_USE_ADC1 TRUE
|
||||
@@ -0,0 +1,136 @@
|
||||
/* Copyright 2021 Glorious, LLC <salman@pcgamingrace.com>
|
||||
* Modified 2022 by rustedaperture for qmk_firmware
|
||||
*
|
||||
* This program 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 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
|
||||
const aw_led g_aw_leds[RGB_MATRIX_LED_COUNT] = {
|
||||
/* Each AW20216 channel is controlled by a register at some offset between 0x00
|
||||
* and 0xD7 inclusive.
|
||||
* See drivers/awinic/aw20216.h for the mapping between register offsets and
|
||||
* driver pin locations.
|
||||
* driver
|
||||
* | R location
|
||||
* | | G location
|
||||
* | | | B location
|
||||
* | | | | */
|
||||
{0, CS4_SW1, CS5_SW1, CS6_SW1 }, // 0 NUM
|
||||
{0, CS4_SW2, CS5_SW2, CS6_SW2 }, // 1 /
|
||||
{0, CS7_SW1, CS8_SW1, CS9_SW1 }, // 2 *
|
||||
{0, CS7_SW2, CS8_SW2, CS9_SW2 }, // 3 -
|
||||
{0, CS4_SW3, CS5_SW3, CS6_SW3 }, // 4 7
|
||||
{0, CS4_SW4, CS5_SW4, CS6_SW4 }, // 5 8
|
||||
{0, CS7_SW3, CS8_SW3, CS9_SW3 }, // 6 9
|
||||
{0, CS7_SW4, CS8_SW4, CS9_SW4 }, // 7 +
|
||||
{0, CS4_SW5, CS5_SW5, CS6_SW5 }, // 8 4
|
||||
{0, CS4_SW6, CS5_SW6, CS6_SW6 }, // 9 5
|
||||
{0, CS7_SW5, CS8_SW5, CS9_SW5 }, // 10 6
|
||||
{0, CS4_SW7, CS5_SW7, CS6_SW7 }, // 11 1
|
||||
{0, CS4_SW8, CS5_SW8, CS6_SW8 }, // 12 2
|
||||
{0, CS7_SW7, CS8_SW7, CS9_SW7 }, // 13 3
|
||||
{0, CS7_SW8, CS8_SW8, CS9_SW8 }, // 14 ENTER
|
||||
{0, CS4_SW9, CS5_SW9, CS6_SW9 }, // 15 0
|
||||
{0, CS7_SW9, CS8_SW9, CS9_SW9 }, // 16 .
|
||||
{0, CS1_SW1, CS2_SW1, CS3_SW1 }, // 17 LED18
|
||||
{0, CS1_SW2, CS2_SW2, CS3_SW2 }, // 18 LED19
|
||||
{0, CS1_SW3, CS2_SW3, CS3_SW3 }, // 19 LED20
|
||||
{0, CS1_SW4, CS2_SW4, CS3_SW4 }, // 20 LED21
|
||||
{0, CS1_SW5, CS2_SW5, CS3_SW5 }, // 21 LED22
|
||||
{0, CS1_SW6, CS2_SW6, CS3_SW6 }, // 22 LED23
|
||||
{0, CS1_SW7, CS2_SW7, CS3_SW7 }, // 23 LED24
|
||||
{0, CS10_SW1, CS11_SW1, CS12_SW1 }, // 24 LED27
|
||||
{0, CS10_SW2, CS11_SW2, CS12_SW2 }, // 25 LED28
|
||||
{0, CS10_SW3, CS11_SW3, CS12_SW3 }, // 26 LED29
|
||||
{0, CS10_SW4, CS11_SW4, CS12_SW4 }, // 27 LED30
|
||||
{0, CS10_SW5, CS11_SW5, CS12_SW5 }, // 28 LED31
|
||||
{0, CS10_SW6, CS11_SW6, CS12_SW6 }, // 29 LED32
|
||||
{0, CS10_SW7, CS11_SW7, CS12_SW7 }, // 30 LED33
|
||||
};
|
||||
|
||||
led_config_t g_led_config = {{
|
||||
{ 0, 1, 2, 3 },
|
||||
{ 4, 5, 6, 7 },
|
||||
{ 8, 9, 10, NO_LED},
|
||||
{ 11, 12, 13, 14 },
|
||||
{ 15, NO_LED, NO_LED, 16 }
|
||||
}, {
|
||||
{45, 0 }, // 0 NUM
|
||||
{90, 0 }, // 1 /
|
||||
{134, 0 }, // 2 *
|
||||
{179, 0 }, // 3 -
|
||||
{45, 16 }, // 4 7
|
||||
{90, 16 }, // 5 8
|
||||
{134, 16 }, // 6 9
|
||||
{179, 24 }, // 7 +
|
||||
{45, 32 }, // 8 4
|
||||
{90, 32 }, // 9 5
|
||||
{134, 32 }, // 10 6
|
||||
{45, 48 }, // 11 1
|
||||
{90, 48 }, // 12 2
|
||||
{134, 48 }, // 13 3
|
||||
{179, 56 }, // 14 ENTER
|
||||
{67, 64 }, // 15 0
|
||||
{134, 64 }, // 16 .
|
||||
{0, 0 }, // 17 LED18
|
||||
{0, 11 }, // 18 LED19
|
||||
{0, 21 }, // 19 LED20
|
||||
{0, 32 }, // 20 LED21
|
||||
{0, 43 }, // 21 LED22
|
||||
{0, 53 }, // 22 LED23
|
||||
{0, 64 }, // 23 LED24
|
||||
{224, 0 }, // 24 LED27
|
||||
{224, 11 }, // 25 LED28
|
||||
{224, 21 }, // 26 LED29
|
||||
{224, 32 }, // 27 LED30
|
||||
{224, 43 }, // 28 LED31
|
||||
{224, 53 }, // 29 LED32
|
||||
{224, 64 } // 30 LED33
|
||||
}, {
|
||||
4, 4, 4, 4,
|
||||
4, 4, 4, 4,
|
||||
4, 4, 4,
|
||||
4, 4, 4, 4,
|
||||
4, 4,
|
||||
2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 2
|
||||
} };
|
||||
|
||||
# ifdef DRIVER_1_PW_EN
|
||||
|
||||
void keyboard_pre_init_user(void) {
|
||||
wait_ms(2000);
|
||||
setPinOutput(DRIVER_1_PW_EN);
|
||||
writePinHigh(DRIVER_1_PW_EN);
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef ENCODER_ENABLE
|
||||
bool encoder_update_kb(uint8_t index, bool clockwise) {
|
||||
if (!encoder_update_user(index, clockwise)) {
|
||||
return false;
|
||||
}
|
||||
if (clockwise) {
|
||||
tap_code_delay(KC_VOLU, 10);
|
||||
} else {
|
||||
tap_code_delay(KC_VOLD, 10);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
+4
-9
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2022 HorrorTroll <https://github.com/HorrorTroll>
|
||||
/* Copyright 2022 by rustedaperture
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -16,11 +16,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
/* Forcing to use NKRO instead 6KRO */
|
||||
#define FORCE_NKRO
|
||||
|
||||
#define DYNAMIC_KEYMAP_LAYER_COUNT 2
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
#define RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE
|
||||
#endif
|
||||
#ifndef TAP_CODE_DELAY
|
||||
# define TAP_CODE_DELAY 10
|
||||
#endif
|
||||
@@ -0,0 +1,40 @@
|
||||
# GMMK NUMPAD
|
||||
|
||||

|
||||
|
||||
A 17 Key macropad made and sold by Glorious LLC, equipped with a WB32 microcontroller, with support for a rotary encoder.
|
||||
|
||||
* Keyboard Maintainer: [GloriousThrall](https://github.com/GloriousThrall)
|
||||
* Hardware Supported: GMMK Numpad
|
||||
* Hardware Availability: [GloriousPCGaming.com](https://www.gloriousgaming.com/products/gmmk-numpad)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make gmmk/numpad:default
|
||||
|
||||
Flashing example for this keyboard:
|
||||
|
||||
make gmmk/numpad:default:flash
|
||||
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||
|
||||
## Bootloader
|
||||
|
||||
Enter the bootloader in 3 ways:
|
||||
|
||||
* **Bootmagic reset**: Hold down the Num key and plug in the keyboard
|
||||
* **Keycode in layout**: Press the Num+Del key which is mapped to `QK_BOOT`
|
||||
* **Physical switch**: Pinhole located ubnde the zero key press while inserting the USB
|
||||
* **From Glorious Core Firmware**: Press Enter+Plus at the same time while plugging in the USB
|
||||
|
||||
## Slider
|
||||
|
||||
The slider is currently compatible with [Midi2Vol](https://github.com/jesusvallejo/Midi2Vol), [Midi Mixer (Windows)](https://github.com/jpwilliams/midi-mixer-releases/releases), [Midi2Lightroom (Mac)](https://rsjaffe.github.io/MIDI2LR/), and [ControllerMate (Mac)](https://www.orderedbytes.com/controllermate/)
|
||||
|
||||
## Encoder Button
|
||||
|
||||
The Button is set to KC_CALC by default and is located at 2,3 on the matrix
|
||||
|
||||
## Broken
|
||||
|
||||
* Bluetooth functionality
|
||||
@@ -0,0 +1,26 @@
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = no # Console for debug
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Enable N-Key Rollover
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||
AUDIO_ENABLE = no # Audio output
|
||||
ENCODER_ENABLE = yes
|
||||
KEYBOARD_SHARED_EP = yes
|
||||
MIDI_ENABLE = yes
|
||||
|
||||
RGB_MATRIX_ENABLE = yes
|
||||
RGB_MATRIX_DRIVER = AW20216
|
||||
|
||||
EEPROM_DRIVER = wear_leveling
|
||||
WEAR_LEVELING_DRIVER = spi_flash
|
||||
|
||||
LTO_ENABLE = yes
|
||||
|
||||
SRC += analog.c \
|
||||
matrix.c
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2021 Gopolar
|
||||
/* Copyright 2023 Gopolar
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -20,6 +20,11 @@
|
||||
#include "lib/logo.h"
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <lib/lib8tion/lib8tion.h>
|
||||
|
||||
led_config_t g_led_config = { {
|
||||
{ 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, NO_LED, 74, 73, 72 },
|
||||
{ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71 },
|
||||
@@ -50,6 +55,62 @@ led_config_t g_led_config = { {
|
||||
// Underglow (88 -> 99)
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
|
||||
} };
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case RGB_TOG:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): {
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_UNDERGLOW): {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_kb(void) {
|
||||
if (!rgb_matrix_indicators_user()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
HSV hsv = rgb_matrix_config.hsv;
|
||||
uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1));
|
||||
hsv.h = time;
|
||||
RGB rgb = hsv_to_rgb(hsv);
|
||||
|
||||
if (host_keyboard_led_state().caps_lock) {
|
||||
rgb_matrix_set_color(25, rgb.r, rgb.g, rgb.b);
|
||||
} else if (!(rgb_matrix_get_flags() & LED_FLAG_INDICATOR)) {
|
||||
rgb_matrix_set_color(25, 0, 0, 0);
|
||||
}
|
||||
|
||||
if (host_keyboard_led_state().scroll_lock) {
|
||||
rgb_matrix_set_color(73, rgb.r, rgb.g, rgb.b);
|
||||
} else if (!(rgb_matrix_get_flags() & LED_FLAG_INDICATOR)) {
|
||||
rgb_matrix_set_color(73, 0, 0, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll>
|
||||
/* Copyright 2023 HorrorTroll <https://github.com/HorrorTroll>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,11 +19,6 @@
|
||||
// OLED animation
|
||||
#include "oled/bongocat.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <lib/lib8tion/lib8tion.h>
|
||||
|
||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
||||
@@ -34,22 +29,6 @@ enum layer_names {
|
||||
_FN,
|
||||
};
|
||||
|
||||
enum user_rgb_mode {
|
||||
RGB_MODE_ALL,
|
||||
RGB_MODE_KEYLIGHT,
|
||||
RGB_MODE_UNDERGLOW,
|
||||
RGB_MODE_NONE,
|
||||
};
|
||||
|
||||
typedef union {
|
||||
uint32_t raw;
|
||||
struct {
|
||||
uint8_t rgb_mode :8;
|
||||
};
|
||||
} user_config_t;
|
||||
|
||||
user_config_t user_config;
|
||||
|
||||
// enum layer_keycodes { };
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
@@ -121,94 +100,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
),
|
||||
};
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
user_config.raw = eeconfig_read_user();
|
||||
switch (user_config.rgb_mode) {
|
||||
case RGB_MODE_ALL:
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
break;
|
||||
case RGB_MODE_KEYLIGHT:
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
break;
|
||||
case RGB_MODE_UNDERGLOW:
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
break;
|
||||
case RGB_MODE_NONE:
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case RGB_TOG:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
user_config.rgb_mode = RGB_MODE_KEYLIGHT;
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): {
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
user_config.rgb_mode = RGB_MODE_UNDERGLOW;
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_UNDERGLOW): {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
user_config.rgb_mode = RGB_MODE_NONE;
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
user_config.rgb_mode = RGB_MODE_ALL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
eeconfig_update_user(user_config.raw);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_user(void) {
|
||||
HSV hsv = rgb_matrix_config.hsv;
|
||||
uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1));
|
||||
hsv.h = time;
|
||||
RGB rgb = hsv_to_rgb(hsv);
|
||||
|
||||
if ((rgb_matrix_get_flags() & LED_FLAG_KEYLIGHT)) {
|
||||
if (host_keyboard_led_state().caps_lock) {
|
||||
rgb_matrix_set_color(25, rgb.r, rgb.g, rgb.b);
|
||||
}
|
||||
if (host_keyboard_led_state().scroll_lock) {
|
||||
rgb_matrix_set_color(73, rgb.r, rgb.g, rgb.b);
|
||||
}
|
||||
} else {
|
||||
if (host_keyboard_led_state().caps_lock) {
|
||||
rgb_matrix_set_color(25, rgb.r, rgb.g, rgb.b);
|
||||
} else {
|
||||
rgb_matrix_set_color(25, 0, 0, 0);
|
||||
}
|
||||
if (host_keyboard_led_state().scroll_lock) {
|
||||
rgb_matrix_set_color(73, rgb.r, rgb.g, rgb.b);
|
||||
} else {
|
||||
rgb_matrix_set_color(73, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
bool oled_task_user(void) {
|
||||
led_t led_usb_state = host_keyboard_led_state();
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
# Keymap with VIA and Bongo Cat on OLED
|
||||
|
||||
Keymap is default 87 qwerty, with TKL 7u-spacebar layout
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2021 Gopolar
|
||||
/* Copyright 2023 Gopolar
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,11 +19,6 @@
|
||||
// OLED animation
|
||||
#include "lib/wave.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <lib/lib8tion/lib8tion.h>
|
||||
|
||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
||||
@@ -31,22 +26,6 @@
|
||||
|
||||
// enum layer_names { };
|
||||
|
||||
enum user_rgb_mode {
|
||||
RGB_MODE_ALL,
|
||||
RGB_MODE_KEYLIGHT,
|
||||
RGB_MODE_UNDERGLOW,
|
||||
RGB_MODE_NONE,
|
||||
};
|
||||
|
||||
typedef union {
|
||||
uint32_t raw;
|
||||
struct {
|
||||
uint8_t rgb_mode :8;
|
||||
};
|
||||
} user_config_t;
|
||||
|
||||
user_config_t user_config;
|
||||
|
||||
// enum layer_keycodes { };
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
@@ -170,94 +149,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
),
|
||||
};
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
user_config.raw = eeconfig_read_user();
|
||||
switch (user_config.rgb_mode) {
|
||||
case RGB_MODE_ALL:
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
break;
|
||||
case RGB_MODE_KEYLIGHT:
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
break;
|
||||
case RGB_MODE_UNDERGLOW:
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
break;
|
||||
case RGB_MODE_NONE:
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case RGB_TOG:
|
||||
if (record->event.pressed) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
user_config.rgb_mode = RGB_MODE_KEYLIGHT;
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): {
|
||||
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
user_config.rgb_mode = RGB_MODE_UNDERGLOW;
|
||||
}
|
||||
break;
|
||||
case (LED_FLAG_UNDERGLOW): {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
user_config.rgb_mode = RGB_MODE_NONE;
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
rgb_matrix_enable_noeeprom();
|
||||
user_config.rgb_mode = RGB_MODE_ALL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
eeconfig_update_user(user_config.raw);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rgb_matrix_indicators_user(void) {
|
||||
HSV hsv = rgb_matrix_config.hsv;
|
||||
uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1));
|
||||
hsv.h = time;
|
||||
RGB rgb = hsv_to_rgb(hsv);
|
||||
|
||||
if ((rgb_matrix_get_flags() & LED_FLAG_KEYLIGHT)) {
|
||||
if (host_keyboard_led_state().caps_lock) {
|
||||
rgb_matrix_set_color(25, rgb.r, rgb.g, rgb.b);
|
||||
}
|
||||
if (host_keyboard_led_state().scroll_lock) {
|
||||
rgb_matrix_set_color(73, rgb.r, rgb.g, rgb.b);
|
||||
}
|
||||
} else {
|
||||
if (host_keyboard_led_state().caps_lock) {
|
||||
rgb_matrix_set_color(25, rgb.r, rgb.g, rgb.b);
|
||||
} else {
|
||||
rgb_matrix_set_color(25, 0, 0, 0);
|
||||
}
|
||||
if (host_keyboard_led_state().scroll_lock) {
|
||||
rgb_matrix_set_color(73, rgb.r, rgb.g, rgb.b);
|
||||
} else {
|
||||
rgb_matrix_set_color(73, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
static void render_layer_info(void) {
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
/* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll>
|
||||
*
|
||||
* This program 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 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define DYNAMIC_KEYMAP_LAYER_COUNT 2
|
||||
#define NO_ACTION_ONESHOT
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
/* RGB Matrix effect */
|
||||
#undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
|
||||
#undef ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
|
||||
#undef ENABLE_RGB_MATRIX_BAND_SAT
|
||||
#undef ENABLE_RGB_MATRIX_BAND_VAL
|
||||
#undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
|
||||
#undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
|
||||
#undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
|
||||
#undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
|
||||
#undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
|
||||
#undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
|
||||
#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
|
||||
#undef ENABLE_RGB_MATRIX_DUAL_BEACON
|
||||
#undef ENABLE_RGB_MATRIX_RAINBOW_BEACON
|
||||
#undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
|
||||
#undef ENABLE_RGB_MATRIX_RAINDROPS
|
||||
#undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
|
||||
#undef ENABLE_RGB_MATRIX_HUE_WAVE
|
||||
#undef ENABLE_RGB_MATRIX_PIXEL_RAIN
|
||||
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
|
||||
#undef ENABLE_RGB_MATRIX_SPLASH
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_SPLASH
|
||||
#undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
|
||||
#endif
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll>
|
||||
/* Copyright 2023 HorrorTroll <https://github.com/HorrorTroll>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -16,7 +16,8 @@
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
#include "keymap_stuff.h"
|
||||
#include "horrortroll.h"
|
||||
#include "oled/oled_stuff.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user