@ -0,0 +1,11 @@ | |||
{ | |||
"files.associations": { | |||
"stdint.h": "c", | |||
"stdint-gcc.h": "c", | |||
"leds.h": "c", | |||
"stdbool.h": "c", | |||
"*.tcc": "c", | |||
"math.h": "c", | |||
"state.h": "c" | |||
} | |||
} |
@ -1,51 +1,51 @@ | |||
{ | |||
"keyboard_name": "Replicazeron", | |||
"manufacturer": "9R", | |||
"url": "", | |||
"url": "https://github.com/9R/replicazeron", | |||
"maintainer": "9R", | |||
"usb": { | |||
"vid": "0x4142", | |||
"pid": "0x2305", | |||
"device_version": "0.0.1" | |||
}, | |||
"diode_direction": "COL2ROW", | |||
"layouts": { | |||
"LAYOUT": { | |||
"layout": [ | |||
{"label":"K04", "x":1.75, "y":1, "w":1.25, "matrix": [0,0]}, | |||
{"label":"K10", "x":3, "y":1, "w":1.25, "matrix": [0,1]}, | |||
{"label":"K16", "x":4.25, "y":1, "w":1.25, "matrix": [0,2]}, | |||
{"label":"K22", "x":5.5, "y":1, "w":1.25, "matrix": [0,3]}, | |||
{"label":"dwn", "x":9.5, "y":2.75, "w":1.25, "matrix": [0,4]}, | |||
{"label":"K04", "x":1.75, "y":0.25, "w":1.25, "matrix": [0,0]}, | |||
{"label":"K10", "x":3, "y":0.25, "w":1.25, "matrix": [0,1]}, | |||
{"label":"K16", "x":4.25, "y":0.25, "w":1.25, "matrix": [0,2]}, | |||
{"label":"K22", "x":5.5, "y":0.25, "w":1.25, "matrix": [0,3]}, | |||
{"label":"dwn", "x":9.5, "y":2, "w":1.25, "matrix": [0,4]}, | |||
{"label":"K03", "x":1.75, "y":1.7, "h":1.25, "w":1.25, "matrix": [1,0]}, | |||
{"label":"K09", "x":3, "y":1.7, "h":1.25, "w":1.25, "matrix": [1,1]}, | |||
{"label":"K15", "x":4.25, "y":1.7, "h":1.25, "w":1.25, "matrix": [1,2]}, | |||
{"label":"K21", "x":5.5, "y":1.7, "h":1.25, "w":1.25, "matrix": [1,3]}, | |||
{"label":"lft", "x":8.25, "y":1.75, "w":1.25, "matrix": [1,4]}, | |||
{"label":"K03", "x":1.75, "y":1, "h":1.25, "w":1.25, "matrix": [1,0]}, | |||
{"label":"K09", "x":3, "y":1, "h":1.25, "w":1.25, "matrix": [1,1]}, | |||
{"label":"K15", "x":4.25, "y":1, "h":1.25, "w":1.25, "matrix": [1,2]}, | |||
{"label":"K21", "x":5.5, "y":1, "h":1.25, "w":1.25, "matrix": [1,3]}, | |||
{"label":"lft", "x":8.25, "y":1, "w":1.25, "matrix": [1,4]}, | |||
{"label":"K02", "x":1.75, "y":3.25, "h":1.25, "w":1.25, "matrix": [2,0]}, | |||
{"label":"K08", "x":3, "y":3.25, "h":1.25, "w":1.25, "matrix": [2,1]}, | |||
{"label":"K14", "x":4.25, "y":3.25, "h":1.25, "w":1.25, "matrix": [2,2]}, | |||
{"label":"K20", "x":5.5, "y":3.25, "h":1.25, "w":1.25, "matrix": [2,3]}, | |||
{"label":"ent", "x":9.5, "y":1.75, "w":1.25, "matrix": [2,4]}, | |||
{"label":"K02", "x":1.75, "y":2.5, "h":1.25, "w":1.25, "matrix": [2,0]}, | |||
{"label":"K08", "x":3, "y":2.5, "h":1.25, "w":1.25, "matrix": [2,1]}, | |||
{"label":"K14", "x":4.25, "y":2.5, "h":1.25, "w":1.25, "matrix": [2,2]}, | |||
{"label":"K20", "x":5.5, "y":2.5, "h":1.25, "w":1.25, "matrix": [2,3]}, | |||
{"label":"ent", "x":9.5, "y":1, "w":1.25, "matrix": [2,4]}, | |||
{"label":"K01", "x":1.75, "y":4.5, "w":1.25, "matrix": [3,0]}, | |||
{"label":"K07", "x":3, "y":4.5, "w":1.25, "matrix": [3,1]}, | |||
{"label":"K13", "x":4.25, "y":4.5, "w":1.25, "matrix": [3,2]}, | |||
{"label":"K19", "x":5.5, "y":4.5, "w":1.25, "matrix": [3,3]}, | |||
{"label":"rgt", "x":10.75, "y":1.75, "w":1.25, "matrix": [3,4]}, | |||
{"label":"K01", "x":1.75, "y":3.75, "w":1.25, "matrix": [3,0]}, | |||
{"label":"K07", "x":3, "y":3.75, "w":1.25, "matrix": [3,1]}, | |||
{"label":"K13", "x":4.25, "y":3.75, "w":1.25, "matrix": [3,2]}, | |||
{"label":"K19", "x":5.5, "y":3.75, "w":1.25, "matrix": [3,3]}, | |||
{"label":"rgt", "x":10.75, "y":1, "w":1.25, "matrix": [3,4]}, | |||
{"label":"K00", "x":1.75, "y":5.5, "w":1.25, "matrix": [4,0]}, | |||
{"label":"K06", "x":3, "y":5.5, "w":1.25, "matrix": [4,1]}, | |||
{"label":"K12", "x":4.25, "y":5.5, "w":1.25, "matrix": [4,2]}, | |||
{"label":"K18", "x":5.5, "y":5.5, "w":1.25, "matrix": [4,3]}, | |||
{"label":"up ", "x":9.5, "y":0.75, "w":1.25, "matrix": [4,4]}, | |||
{"label":"K00", "x":1.75, "y":4.75, "w":1.25, "matrix": [4,0]}, | |||
{"label":"K06", "x":3, "y":4.75, "w":1.25, "matrix": [4,1]}, | |||
{"label":"K12", "x":4.25, "y":4.75, "w":1.25, "matrix": [4,2]}, | |||
{"label":"K18", "x":5.5, "y":4.75, "w":1.25, "matrix": [4,3]}, | |||
{"label":"up ", "x":9.5, "y":0, "w":1.25, "matrix": [4,4]}, | |||
{"label":"K05", "x":0, "y":3.25, "w":1.75, "matrix": [5,0]}, | |||
{"label":"lyr", "x":7.5, "y":5, "w":1.5, "matrix": [5,1]}, | |||
{"label":"K17", "x":10.75, "y":4.75, "w":1.5, "matrix": [5,2]}, | |||
{"label":"K23", "x":6.75, "y":3.25, "w":1.5, "matrix": [5,3]}, | |||
{"label":"spc", "x":10.75, "y":3.75, "w":1.25, "matrix": [5,4]} | |||
{"label":"K05", "x":0, "y":2.5, "w":1.75, "matrix": [5,0]}, | |||
{"label":"lyr", "x":7.5, "y":4.25, "w":1.5, "matrix": [5,1]}, | |||
{"label":"K17", "x":10.75, "y":4, "w":1.5, "matrix": [5,2]}, | |||
{"label":"K23", "x":6.75, "y":2.5, "w":1.5, "matrix": [5,3]}, | |||
{"label":"spc", "x":10.75, "y":3, "w":1.25, "matrix": [5,4]} | |||
] | |||
} | |||
} | |||
@ -1,2 +0,0 @@ | |||
# Replicazeron Gamepad | |||
Default layout with 2 axies thumbstick |
@ -1,15 +0,0 @@ | |||
ifeq ($(strip $(LEDS_ENABLE)), yes) | |||
OPT_DEFS += -DLEDS_ENABLE | |||
SRC += ../common/leds.c | |||
endif | |||
ifeq ($(strip $(OLED_ENABLE)), yes) | |||
SRC += ../common/oled.c | |||
endif | |||
ifeq ($(strip $(THUMBSTICK_ENABLE)), yes) | |||
# POINTING_DEVICE_ENABLE = yes | |||
OPT_DEFS += -DTHUMBSTICK_ENABLE | |||
SRC += analog.c | |||
SRC += ../common/thumbstick.c | |||
endif |
@ -1,2 +0,0 @@ | |||
# Replicazeron Gamepad - via layout | |||
VIA layout with 2 axies thumbstick |
@ -1,16 +1 @@ | |||
VIA_ENABLE = yes | |||
ifeq ($(strip $(LEDS_ENABLE)), yes) | |||
OPT_DEFS += -DLEDS_ENABLE | |||
SRC += ../common/leds.c | |||
endif | |||
ifeq ($(strip $(OLED_ENABLE)), yes) | |||
SRC += ../common/oled.c | |||
endif | |||
ifeq ($(strip $(THUMBSTICK_ENABLE)), yes) | |||
# POINTING_DEVICE_ENABLE = yes | |||
OPT_DEFS += -DTHUMBSTICK_ENABLE | |||
SRC += analog.c | |||
SRC += ../common/thumbstick.c | |||
endif |
@ -1,9 +1,11 @@ | |||
{ | |||
"usb": { | |||
"device_version": "0.0.1" | |||
}, | |||
"matrix_pins": { | |||
"cols": [ "C6", "D4", "D7", "E6", "F7" ], | |||
"rows": [ "B1", "B3", "B2", "B6", "B5", "B4" ] | |||
"cols": ["C6", "D4", "D7", "E6", "F7"], | |||
"rows": ["B1", "B3", "B2", "B6", "B5", "B4"] | |||
}, | |||
"diode_direction": "COL2ROW", | |||
"processor": "atmega32u4", | |||
"bootloader": "qmk-dfu" | |||
} |
@ -1,17 +0,0 @@ | |||
/* Copyright 2023 9R | |||
* | |||
* 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" |
@ -1,29 +1,6 @@ | |||
# Build Options | |||
# change yes to no to disable | |||
# | |||
BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite | |||
MOUSEKEY_ENABLE = no # Mouse keys | |||
EXTRAKEY_ENABLE = no # Audio control and System control | |||
CONSOLE_ENABLE = no # Console for debug | |||
COMMAND_ENABLE = no # Commands for debug and configuration | |||
NKRO_ENABLE = no # Enable N-Key Rollover | |||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | |||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | |||
AUDIO_ENABLE = no # Audio output | |||
TAP_DANCE_ENABLE = no # Tap Dance | |||
JOYSTICK_ENABLE = yes | |||
JOYSTICK_DRIVER = analog | |||
OLED_ENABLE = yes | |||
OLED_DRIVER = SSD1306 | |||
LTO_ENABLE = yes | |||
########## | |||
QMK_SETTINGS = yes | |||
LEDS_ENABLE = yes | |||
THUMBSTICK_ENABLE = yes | |||
SRC += ../common/state.c | |||
BOOTMAGIC_ENABLE = no | |||
CONSOLE_ENABLE = no | |||
EXTRAKEY_ENABLE = no | |||
MOUSEKEY_ENABLE = no | |||
NKRO_ENABLE = no | |||
RGBLIGHT_ENABLE = no |
@ -0,0 +1,104 @@ | |||
/* Copyright 2023 9R | |||
* | |||
* 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 | |||
controller_state_t controller_state; | |||
#ifdef JOYSTICK_ENABLE | |||
// FIXME: Can't you use the builtin/default joytstick configuration for scanning it? | |||
joystick_config_t joystick_axes[JOYSTICK_AXIS_COUNT] = { | |||
JOYSTICK_AXIS_IN(B0, 0, 512, 1023), | |||
JOYSTICK_AXIS_IN(B1, 0, 512, 1023) | |||
}; | |||
#endif | |||
#ifdef THUMBSTICK_ENABLE | |||
void housekeeping_tak_user(void) { | |||
if (controller_state.wasdMode) { | |||
thumbstick(controller_state); | |||
} | |||
} | |||
#endif | |||
void keyboard_post_init_kb(void) { | |||
// Customise these values to desired behaviour | |||
debug_enable = true; | |||
debug_matrix = true; | |||
// debug_keyboard = true; | |||
// debug_mouse = true; | |||
#ifdef LEDS_ENABLE | |||
init_leds(); | |||
#endif // LEDS_ENABLE | |||
#ifdef THUMBSTICK_ENABLE | |||
init_wasd_state(); | |||
#endif // THUMBSTICK_ENABLE | |||
// FIXME: This was inside the thumbstick's ifdef, moved it out assuming it was a typo | |||
controller_state = init_state(); | |||
keyboard_post_init_user(); | |||
} | |||
#ifdef OLED_ENABLE | |||
bool oled_task_kb(void) { | |||
if (!oled_task_user()) { | |||
return false; | |||
} | |||
draw_oled(controller_state); | |||
return false; | |||
} | |||
#endif | |||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | |||
if (!process_record_user(keycode, record)) { | |||
return false; | |||
} | |||
if (keycode == JOYMODE && record->event.pressed) { | |||
if (!controller_state.wasdMode) { | |||
controller_state.wasdMode = true; | |||
} else if (controller_state.wasdMode && !controller_state.wasdShiftMode) { | |||
controller_state.wasdShiftMode = true; | |||
} else { | |||
controller_state.wasdMode = false; | |||
controller_state.wasdShiftMode = false; | |||
} | |||
} else if (keycode == AUTORUN && record->event.pressed) { | |||
if (!controller_state.autoRun) { | |||
controller_state.autoRun = true; | |||
register_code(KC_W); | |||
} else { | |||
controller_state.autoRun = false; | |||
unregister_code(KC_W); | |||
} | |||
} | |||
return true; | |||
}; | |||
layer_state_t layer_state_set_kb(layer_state_t state) { | |||
controller_state.highestActiveLayer = get_highest_layer(state) ; | |||
#ifdef LEDS_ENABLE | |||
set_leds(controller_state.highestActiveLayer) ; | |||
#endif // LEDS_ENABLE | |||
return state; | |||
} |
@ -0,0 +1,31 @@ | |||
AUDIO_ENABLE = no | |||
BACKLIGHT_ENABLE = no | |||
COMMAND_ENABLE = no | |||
JOYSTICK_ENABLE = yes | |||
JOYSTICK_DRIVER = analog | |||
LTO_ENABLE = yes # FIXME: If im not mistaken, this can cause issues on ARM (ie STM32) | |||
OLED_ENABLE = yes | |||
TAP_DANCE_ENABLE = no | |||
LEDS_ENABLE = yes | |||
THUMBSTICK_ENABLE = yes | |||
SRC += common/state.c | |||
# redirect compilation against "handwired/replicazeron" to the stm32 variant | |||
DEFAULT_FOLDER = handwired/replicazeron/stm32f103 | |||
ifeq ($(strip $(LEDS_ENABLE)), yes) | |||
OPT_DEFS += -DLEDS_ENABLE | |||
SRC += common/leds.c | |||
endif | |||
ifeq ($(strip $(OLED_ENABLE)), yes) | |||
SRC += common/oled.c | |||
endif | |||
ifeq ($(strip $(THUMBSTICK_ENABLE)), yes) | |||
OPT_DEFS += -DTHUMBSTICK_ENABLE | |||
SRC += analog.c \ | |||
common/thumbstick.c | |||
endif |
@ -1,9 +1,11 @@ | |||
{ | |||
"usb": { | |||
"device_version": "0.0.2" | |||
}, | |||
"matrix_pins": { | |||
"cols": ["A7", "A6", "A5", "A4", "B4"], | |||
"rows": [ "B15", "A8", "A9", "A10", "A15", "B3" ] | |||
"rows": ["B15", "A8", "A9", "A10", "A15", "B3"] | |||
}, | |||
"diode_direction": "COL2ROW", | |||
"processor": "STM32F103", | |||
"bootloader": "stm32duino" | |||
} |
@ -1,33 +1,9 @@ | |||
# 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 = yes # 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 = yes # Enable keyboard RGB underglow | |||
AUDIO_ENABLE = no # Audio output | |||
TAP_DANCE_ENABLE = no # Tap Dance | |||
JOYSTICK_ENABLE = yes | |||
JOYSTICK_DRIVER = analog | |||
OLED_ENABLE = yes | |||
OLED_DRIVER = SSD1306 | |||
OLED_BRIGHTNESS = 32 | |||
LTO_ENABLE = yes | |||
BOOTMAGIC_ENABLE = yes | |||
CONSOLE_ENABLE = yes | |||
EXTRAKEY_ENABLE = yes | |||
MOUSEKEY_ENABLE = yes | |||
NKRO_ENABLE = yes | |||
RGBLIGHT_ENABLE = yes | |||
# Enter lower-power sleep mode when on the ChibiOS idle thread | |||
OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE | |||
########## | |||
QMK_SETTINGS = yes | |||
LEDS_ENABLE = yes | |||
THUMBSTICK_ENABLE = yes | |||
SRC += ../common/state.c |
@ -1,17 +0,0 @@ | |||
/* Copyright 2023 9R | |||
* | |||
* 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" |