CA66 R1/R2 Cleanup (#6678)

* fixup readme to adhere to QMK standards and to also have more information

* use pragma once

* strip out the custom bootmagic lite routine as it is the same as QMK's default bootmagic lite routine. Also add the caps lock led indicator

* turn on bootmagic lite

* update default keymap

* Update keyboards/playkbtw/ca66/ca66.c

Co-Authored-By: fauxpark <fauxpark@gmail.com>

* remove lines 4 thru 37 and add bootloader
This commit is contained in:
MechMerlin 2019-09-07 01:04:48 -07:00 committed by fauxpark
parent ac8f8a8914
commit fc5fb2fc15
6 changed files with 28 additions and 107 deletions

View File

@ -1,30 +1,12 @@
#include "ca66.h" #include "ca66.h"
#include "config.h"
void bootmagic_lite(void) void led_set_kb(uint8_t usb_led) {
{ // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
// The lite version of TMK's bootmagic. if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
// 100% less potential for accidentally making the writePinHigh(D1);
// keyboard do stupid things. } else {
writePinLow(D1);
}
// We need multiple scans because debouncing can't be turned off. led_set_user(usb_led);
matrix_scan();
wait_ms(DEBOUNCE);
matrix_scan();
// If the Esc (matrix 0,0) is held down on power up,
// reset the EEPROM valid state and jump to bootloader.
if ( matrix_get_row(0) & (1<<0) )
{
// Set the TMK/QMK EEPROM state as invalid.
eeconfig_disable();
// Jump to bootloader.
bootloader_jump();
}
}
void matrix_init_kb(void)
{
bootmagic_lite();
matrix_init_user();
} }

View File

@ -1,5 +1,4 @@
#ifndef CA66_H #pragma once
#define CA66_H
#include "quantum.h" #include "quantum.h"
@ -16,5 +15,3 @@
{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \
{ KC_NO, K401, K402, K403, K404, KC_NO, K406, KC_NO, K408, K409, K410, K411, K412, K413, K414 } \ { KC_NO, K401, K402, K403, K404, KC_NO, K406, KC_NO, K408, K409, K410, K411, K412, K413, K414 } \
} }
#endif

View File

@ -1,5 +1,4 @@
#ifndef CONFIG_H #pragma once
#define CONFIG_H
#include "config_common.h" #include "config_common.h"
@ -15,7 +14,7 @@
#define MATRIX_ROWS 5 #define MATRIX_ROWS 5
#define MATRIX_COLS 15 #define MATRIX_COLS 15
/* key matrix pins */ /* key matrix pins 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14*/
#define MATRIX_ROW_PINS { F5, F4, F1, B0, B3 } #define MATRIX_ROW_PINS { F5, F4, F1, B0, B3 }
#define MATRIX_COL_PINS { F7, C7, C6, B6, B5, B4, D7, D6, D4, D5, D3, D2, F6, B7, E6 } #define MATRIX_COL_PINS { F7, C7, C6, B6, B5, B4, D7, D6, D4, D5, D3, D2, F6, B7, E6 }
#define UNUSED_PINS #define UNUSED_PINS
@ -45,5 +44,3 @@
#define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8 #define RGBLIGHT_VAL_STEP 8
#endif #endif
#endif

View File

@ -16,21 +16,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LSFT, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, RGB_HUI, KC_END, KC_LSFT, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, RGB_HUI, KC_END,
KC_LCTL, KC_LGUI, KC_LALT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SAD, RGB_HUD, RGB_SAI), KC_LCTL, KC_LGUI, KC_LALT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SAD, RGB_HUD, RGB_SAI),
}; };
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
DDRD |= (1 << 1); PORTD &= ~(1 << 1);
} else {
DDRD &= ~(1 << 1); PORTD &= ~(1 << 1);
}
}

View File

@ -1,10 +1,11 @@
CA66 # CA66
==
Custom 65% Custom 65%
This QMK firmware handles both PCBs from Round 1 and from Round 2.
Keyboard Maintainer: QMK Community Keyboard Maintainer: QMK Community
Hardware Supported: CA66 Hardware Supported: CA66 R1/R2
Hardware Availability: [Play Keyboard](http://play-keyboard.store/) Hardware Availability: [Play Keyboard](http://play-keyboard.store/)
@ -12,4 +13,4 @@ Make example for this keyboard (after setting up your build environment):
make playkbtw/ca66:default make playkbtw/ca66:default
See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. 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).

View File

@ -1,56 +1,18 @@
# MCU name # MCU name
MCU = atmega32u4 MCU = atmega32u4
# Processor frequency. BOOTLOADER = atmel-dfu
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in *bytes*
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options # Build Options
# comment out to disable the options. # comment out to disable the options.
# #
BOOTMAGIC_ENABLE ?= no BOOTMAGIC_ENABLE = lite
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE ?= no # Console for debug(+400) CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE ?= no # Commands for debug and configuration COMMAND_ENABLE = no # Commands for debug and configuration
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
AUDIO_ENABLE ?= no AUDIO_ENABLE = no
RGBLIGHT_ENABLE ?= yes RGBLIGHT_ENABLE = yes