From 4c1760883e2e0ed710348f02bc791786ed0c1b04 Mon Sep 17 00:00:00 2001 From: James Churchill Date: Sat, 6 Apr 2019 02:20:43 +1000 Subject: Update ps2avrgb template to use standard matrix/i2c code (#4957) * Update ps2avrgb template to use standard matrix/i2c code * Default to an 8x11 matrix in the ps2avrgb template --- quantum/template/avr/template.c | 30 ++++++---- quantum/template/ps2avrgb/config.h | 13 ++-- quantum/template/ps2avrgb/i2c.c | 106 --------------------------------- quantum/template/ps2avrgb/i2c.h | 27 --------- quantum/template/ps2avrgb/matrix.c | 112 ----------------------------------- quantum/template/ps2avrgb/rules.mk | 4 +- quantum/template/ps2avrgb/template.c | 77 ++++++++++++++++++++++-- 7 files changed, 99 insertions(+), 270 deletions(-) delete mode 100644 quantum/template/ps2avrgb/i2c.c delete mode 100644 quantum/template/ps2avrgb/i2c.h delete mode 100644 quantum/template/ps2avrgb/matrix.c (limited to 'quantum/template') diff --git a/quantum/template/avr/template.c b/quantum/template/avr/template.c index 1e4ce26cd1..86dc69abce 100644 --- a/quantum/template/avr/template.c +++ b/quantum/template/avr/template.c @@ -15,29 +15,37 @@ */ #include "%KEYBOARD%.h" +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up + // put your keyboard start-up code here + // runs once when the firmware starts up - matrix_init_user(); + matrix_init_user(); } void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) + // put your looping keyboard code here + // runs every cycle (a lot) - matrix_scan_user(); + matrix_scan_user(); } bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware - return process_record_user(keycode, record); + return process_record_user(keycode, record); } void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - led_set_user(usb_led); + led_set_user(usb_led); } + +*/ diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index 01cdf932ed..8d9a993cf1 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -21,17 +21,20 @@ along with this program. If not, see . #define VENDOR_ID 0x20A0 #define PRODUCT_ID 0x422D +#define DEVICE_VER 0x0001 #define MANUFACTURER You #define PRODUCT %KEYBOARD% +#define DESCRIPTION A custom keyboard #define RGBLED_NUM 16 -#define MATRIX_ROWS 2 -#define MATRIX_COLS 3 +#define MATRIX_ROWS 8 +#define MATRIX_COLS 11 -#define MATRIX_ROW_PINS { D0, D5 } -#define MATRIX_COL_PINS { F1, F0, B0 } -#define UNUSED_PINS +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5 } +// #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, C1, C0, D7 } +#define UNUSED_PINS {} #define DIODE_DIRECTION COL2ROW #define DEBOUNCING_DELAY 5 diff --git a/quantum/template/ps2avrgb/i2c.c b/quantum/template/ps2avrgb/i2c.c deleted file mode 100644 index e8c4455ad1..0000000000 --- a/quantum/template/ps2avrgb/i2c.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2016 Luiz Ribeiro - -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 . -*/ - -// Please do not modify this file - -#include -#include - -#include "i2c.h" - -void i2c_set_bitrate(uint16_t bitrate_khz) { - uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); - if (bitrate_div >= 16) { - bitrate_div = (bitrate_div - 16) / 2; - } - TWBR = bitrate_div; -} - -void i2c_init(void) { - // set pull-up resistors on I2C bus pins - PORTC |= 0b11; - - i2c_set_bitrate(400); - - // enable TWI (two-wire interface) - TWCR |= (1 << TWEN); - - // enable TWI interrupt and slave address ACK - TWCR |= (1 << TWIE); - TWCR |= (1 << TWEA); -} - -uint8_t i2c_start(uint8_t address) { - // reset TWI control register - TWCR = 0; - - // begin transmission and wait for it to end - TWCR = (1< - -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 . -*/ - -// Please do not modify this file - -#ifndef __I2C_H__ -#define __I2C_H__ - -void i2c_init(void); -void i2c_set_bitrate(uint16_t bitrate_khz); -uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); - -#endif diff --git a/quantum/template/ps2avrgb/matrix.c b/quantum/template/ps2avrgb/matrix.c deleted file mode 100644 index 245813dfd2..0000000000 --- a/quantum/template/ps2avrgb/matrix.c +++ /dev/null @@ -1,112 +0,0 @@ -/* -Copyright 2017 Luiz Ribeiro - -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 . -*/ - -#include -#include - -#include "matrix.h" - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -static uint8_t debouncing = DEBOUNCE; - -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -void matrix_set_row_status(uint8_t row); -uint8_t bit_reverse(uint8_t x); - -void matrix_init(void) { - // all outputs for rows high - DDRB = 0xFF; - PORTB = 0xFF; - // all inputs for columns - DDRA = 0x00; - DDRC &= ~(0x111111<<2); - DDRD &= ~(1< 7 - (~PINA) & 0xFF - ) | ( - // cols 8..13, PORTC 7 -> 0 - bit_reverse((~PINC) & 0xFF) << 8 - ) | ( - // col 14, PORTD 7 - ((~PIND) & (1 << PIND7)) << 7 - ); - - if (matrix_debouncing[row] != cols) { - matrix_debouncing[row] = cols; - debouncing = DEBOUNCE; - } - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - matrix_scan_quantum(); - - return 1; -} - -// declarations -void matrix_set_row_status(uint8_t row) { - DDRB = (1 << row); - PORTB = ~(1 << row); -} - -uint8_t bit_reverse(uint8_t x) { - x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa); - x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); - x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); - return x; -} - -inline matrix_row_t matrix_get_row(uint8_t row) { - return matrix[row]; -} - -void matrix_print(void) { -} diff --git a/quantum/template/ps2avrgb/rules.mk b/quantum/template/ps2avrgb/rules.mk index bcd7dff999..191a138446 100644 --- a/quantum/template/ps2avrgb/rules.mk +++ b/quantum/template/ps2avrgb/rules.mk @@ -42,9 +42,7 @@ RGBLIGHT_CUSTOM_DRIVER = yes OPT_DEFS = -DDEBUG_LEVEL=0 -# custom matrix setup -CUSTOM_MATRIX = yes -SRC = matrix.c i2c.c +SRC += i2c_master.c # programming options PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/quantum/template/ps2avrgb/template.c b/quantum/template/ps2avrgb/template.c index 08156c562c..3f920de48c 100644 --- a/quantum/template/ps2avrgb/template.c +++ b/quantum/template/ps2avrgb/template.c @@ -13,13 +13,78 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "%KEYBOARD%.h" -#include -#include "action_layer.h" -#include "i2c.h" -#include "quantum.h" +#ifdef RGBLIGHT_ENABLE + +#include +#include "i2c_master.h" +#include "rgblight.h" + +extern rgblight_config_t rgblight_config; + +void matrix_init_kb(void) { + i2c_init(); + // call user level keymaps, if any + matrix_init_user(); +} + +// custom RGB driver +void rgblight_set(void) { + if (!rgblight_config.enable) { + memset(led, 0, 3 * RGBLED_NUM); + } + + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); +} + +bool rgb_init = false; + +void matrix_scan_kb(void) { + // if LEDs were previously on before poweroff, turn them back on + if (rgb_init == false && rgblight_config.enable) { + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); + rgb_init = true; + } + + rgblight_task(); + matrix_scan_user(); +} + +#endif -__attribute__ ((weak)) -void matrix_scan_user(void) { +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); } + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ -- cgit v1.2.3 From 2df82514ab9e33342d985e7b6065c3b921402391 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 11 Apr 2019 15:39:40 -0700 Subject: Update ps2avrgb readme template (#5584) - fix markdown formatting on macOS instructions (close code block) - update package install commands - set python3 - use pip3 to install pyusb - fix typo (extra backtick on bootloadhid package install line) - update Keyboard Maintainer line (now unified with AVR template) --- quantum/template/ps2avrgb/readme.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/ps2avrgb/readme.md b/quantum/template/ps2avrgb/readme.md index feec722a52..ef24deb8f7 100644 --- a/quantum/template/ps2avrgb/readme.md +++ b/quantum/template/ps2avrgb/readme.md @@ -4,7 +4,7 @@ A short description of the keyboard/project -Keyboard Maintainer: [You](https://github.com/yourusername) +Keyboard Maintainer: [%YOUR_NAME%](https://github.com/yourusername) Hardware Supported: The PCBs, controllers supported Hardware Availability: links to where you can find this hardware @@ -34,10 +34,10 @@ macOS: ``` 3. Install the following packages: ``` - brew install python - brew install pyusb - brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb - + brew install python3 + pip3 install pyusb + brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + ``` 4. Place your keyboard into reset. 5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. -- cgit v1.2.3 From 3da8d46a07167fc862e90b6bb232812d5cb64651 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Thu, 2 May 2019 23:59:29 +0900 Subject: If RGBLIGHT_EFFECT_BREATHE_CENTER is undefined, use fixed breathe table instead of exp() and sin() (#5484) * If RGBLIGHT_EFFECT_BREATHE_CENTER is undefined, use fixed breathe table instead of exp() and sin() * Change rgblight breathing table size to be easily selectable. add RGBLIGHT_BREATHE_TABLE_SIZE macro for customize breathing effect. --- quantum/template/avr/config.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'quantum/template') diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index a9bb754821..48d7afb149 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -77,6 +77,12 @@ along with this program. If not, see . // #define RGBLIGHT_EFFECT_STATIC_GRADIENT // #define RGBLIGHT_EFFECT_RGB_TEST // #define RGBLIGHT_EFFECT_ALTERNATING +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 // #endif /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -- cgit v1.2.3 From 4c14b5832a7598d19a6a1196aaaafd473f7ed920 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Fri, 3 May 2019 17:26:29 -0700 Subject: Fix up ps2avrgb templates (#5606) * fix up ps2avrgb templates * set backlight enable to no as per review comments * add back no_uart --- quantum/template/ps2avrgb/readme.md | 2 ++ quantum/template/ps2avrgb/rules.mk | 4 ++-- quantum/template/ps2avrgb/usbconfig.h | 5 +---- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/ps2avrgb/readme.md b/quantum/template/ps2avrgb/readme.md index ef24deb8f7..1449b278cd 100644 --- a/quantum/template/ps2avrgb/readme.md +++ b/quantum/template/ps2avrgb/readme.md @@ -16,6 +16,8 @@ Flashing ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. +**Reset Key:** Hold down the key located at `K00`, commonly programmed as `Esc` while plugging in the keyboard. + Windows: 1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). 2. Place your keyboard into reset. diff --git a/quantum/template/ps2avrgb/rules.mk b/quantum/template/ps2avrgb/rules.mk index 191a138446..bd0eed0527 100644 --- a/quantum/template/ps2avrgb/rules.mk +++ b/quantum/template/ps2avrgb/rules.mk @@ -31,13 +31,13 @@ F_CPU = 12000000 BOOTLOADER = bootloadHID # build options -BOOTMAGIC_ENABLE = full +BOOTMAGIC_ENABLE = no MOUSEKEY_ENABLE = no EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = no +RGBLIGHT_ENABLE = yes RGBLIGHT_CUSTOM_DRIVER = yes OPT_DEFS = -DDEBUG_LEVEL=0 diff --git a/quantum/template/ps2avrgb/usbconfig.h b/quantum/template/ps2avrgb/usbconfig.h index d2d848fcdc..54a7d20f14 100644 --- a/quantum/template/ps2avrgb/usbconfig.h +++ b/quantum/template/ps2avrgb/usbconfig.h @@ -8,8 +8,7 @@ * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ */ -#ifndef __usbconfig_h_included__ -#define __usbconfig_h_included__ +#pragma once #include "config.h" @@ -392,5 +391,3 @@ section at the end of this file). /* #define USB_INTR_PENDING EIFR */ #define USB_INTR_PENDING_BIT INTF1 #define USB_INTR_VECTOR INT1_vect - -#endif /* __usbconfig_h_included__ */ -- cgit v1.2.3 From 83afae31ed64ba577a4bd0336131598196d3e8c7 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 23 May 2019 17:42:06 -0700 Subject: Fix up Debouncing in AVR Templates (#5964) --- quantum/template/avr/config.h | 2 +- quantum/template/ps2avrgb/config.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index 48d7afb149..c13784ba15 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -86,7 +86,7 @@ along with this program. If not, see . // #endif /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index 8d9a993cf1..d954fec961 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -37,7 +37,7 @@ along with this program. If not, see . #define UNUSED_PINS {} #define DIODE_DIRECTION COL2ROW -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 #define NO_BACKLIGHT_CLOCK #define BACKLIGHT_LEVELS 1 -- cgit v1.2.3 From 8b1cdd1e3d27cce830c36f9604e5f69337b2c83e Mon Sep 17 00:00:00 2001 From: fauxpark Date: Tue, 9 Jul 2019 07:07:36 +1000 Subject: Add copyright year placeholders to new keyboard script (#6280) * Add copyright year placeholders to new keyboard script * More copyright header tweaks --- quantum/template/avr/config.h | 2 +- quantum/template/avr/template.c | 2 +- quantum/template/base/keymaps/default/config.h | 2 +- quantum/template/base/keymaps/default/keymap.c | 2 +- quantum/template/base/template.h | 2 +- quantum/template/ps2avrgb/config.h | 2 +- quantum/template/ps2avrgb/rules.mk | 15 --------------- quantum/template/ps2avrgb/template.c | 2 +- quantum/template/ps2avrgb/usbconfig.h | 10 ---------- 9 files changed, 7 insertions(+), 32 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index c13784ba15..1e41a2d31d 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -1,5 +1,5 @@ /* -Copyright 2019 %YOUR_NAME% +Copyright %YEAR% %YOUR_NAME% 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 diff --git a/quantum/template/avr/template.c b/quantum/template/avr/template.c index 86dc69abce..e852a42c40 100644 --- a/quantum/template/avr/template.c +++ b/quantum/template/avr/template.c @@ -1,4 +1,4 @@ -/* Copyright 2019 %YOUR_NAME% +/* Copyright %YEAR% %YOUR_NAME% * * 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 diff --git a/quantum/template/base/keymaps/default/config.h b/quantum/template/base/keymaps/default/config.h index 44382016a1..5b00c8956f 100644 --- a/quantum/template/base/keymaps/default/config.h +++ b/quantum/template/base/keymaps/default/config.h @@ -1,4 +1,4 @@ -/* Copyright 2019 %YOUR_NAME% +/* Copyright %YEAR% %YOUR_NAME% * * 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 diff --git a/quantum/template/base/keymaps/default/keymap.c b/quantum/template/base/keymaps/default/keymap.c index 482a445448..0e9fad357f 100644 --- a/quantum/template/base/keymaps/default/keymap.c +++ b/quantum/template/base/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2019 %YOUR_NAME% +/* Copyright %YEAR% %YOUR_NAME% * * 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 diff --git a/quantum/template/base/template.h b/quantum/template/base/template.h index 5b5076c476..2e531b1fd4 100644 --- a/quantum/template/base/template.h +++ b/quantum/template/base/template.h @@ -1,4 +1,4 @@ -/* Copyright 2019 %YOUR_NAME% +/* Copyright %YEAR% %YOUR_NAME% * * 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 diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index d954fec961..320d71fcbc 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -1,5 +1,5 @@ /* -Copyright 2017 Luiz Ribeiro +Copyright %YEAR% %YOUR_NAME% 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 diff --git a/quantum/template/ps2avrgb/rules.mk b/quantum/template/ps2avrgb/rules.mk index bd0eed0527..98a920e182 100644 --- a/quantum/template/ps2avrgb/rules.mk +++ b/quantum/template/ps2avrgb/rules.mk @@ -1,18 +1,3 @@ -# Copyright 2019 Luiz Ribeiro -# -# 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 . - # MCU name MCU = atmega32a PROTOCOL = VUSB diff --git a/quantum/template/ps2avrgb/template.c b/quantum/template/ps2avrgb/template.c index 3f920de48c..07f27bbb22 100644 --- a/quantum/template/ps2avrgb/template.c +++ b/quantum/template/ps2avrgb/template.c @@ -1,4 +1,4 @@ -/* Copyright 2019 %YOUR_NAME% +/* Copyright %YEAR% %YOUR_NAME% * * 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 diff --git a/quantum/template/ps2avrgb/usbconfig.h b/quantum/template/ps2avrgb/usbconfig.h index 54a7d20f14..465db3a134 100644 --- a/quantum/template/ps2avrgb/usbconfig.h +++ b/quantum/template/ps2avrgb/usbconfig.h @@ -1,13 +1,3 @@ -/* Name: usbconfig.h - * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers - * Author: Christian Starkjohann - * Creation Date: 2005-04-01 - * Tabsize: 4 - * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH - * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ - */ - #pragma once #include "config.h" -- cgit v1.2.3 From ba42a5ae68a59ad514027d819c6b58ee86944e75 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Tue, 16 Jul 2019 17:26:38 +1000 Subject: Remove commented out MCUs in rules.mk (#5884) --- quantum/template/avr/rules.mk | 1 - 1 file changed, 1 deletion(-) (limited to 'quantum/template') diff --git a/quantum/template/avr/rules.mk b/quantum/template/avr/rules.mk index 383a3594b4..bc370be039 100644 --- a/quantum/template/avr/rules.mk +++ b/quantum/template/avr/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. -- cgit v1.2.3 From a32f7e1a25a8a200d838aa8256ffe39708fbd723 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Tue, 16 Jul 2019 17:56:36 +1000 Subject: Store backlight breathing state in EEPROM (#6105) * Store backlight breathing state in EEPROM * Reduce backlight_config.level from 6 bits to 4 (max 15 "on" levels) * Error out if BACKLIGHT_LEVELS is > 15 * Remove mention of default backlight pin in rules.mk template * Remove pointless comment --- quantum/template/avr/config.h | 2 -- quantum/template/avr/rules.mk | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index 1e41a2d31d..fc65bb5976 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -91,8 +91,6 @@ along with this program. If not, see . /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST -/* number of backlight levels */ - /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/quantum/template/avr/rules.mk b/quantum/template/avr/rules.mk index bc370be039..133c9e363b 100644 --- a/quantum/template/avr/rules.mk +++ b/quantum/template/avr/rules.mk @@ -70,7 +70,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE = no # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) UNICODE_ENABLE = no # Unicode -- cgit v1.2.3 From a2e91ebec910d31a9f32cc56924ef3d6f0291e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Sat, 20 Jul 2019 22:21:40 +0200 Subject: Update IS_COMMAND definitions to use MOD_MASK_SHIFT (#6348) * Update IS_COMMAND definition in templates to use MOD_MASK_SHIFT * Update IS_COMMAND in docs * Update IS_COMMAND default definition in tmk_core * Update table in Command docs based on suggestion Co-Authored-By: fauxpark --- quantum/template/avr/config.h | 2 +- quantum/template/ps2avrgb/config.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index fc65bb5976..0fc7cf9cb9 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -136,7 +136,7 @@ along with this program. If not, see . /* key combination for magic key command */ /* defined by default; to change, uncomment and set to the combination you want */ -// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) +// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT) /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index 320d71fcbc..9117bf1f91 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -47,7 +47,7 @@ along with this program. If not, see . /* key combination for magic key command */ /* defined by default; to change, uncomment and set to the combination you want */ -// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) +// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT) /* Bootmagic Lite key configuration */ // #define BOOTMAGIC_LITE_ROW 0 -- cgit v1.2.3 From 0bd03150e5952978e0a7044dcfea1bb617c2390d Mon Sep 17 00:00:00 2001 From: fauxpark Date: Sat, 27 Jul 2019 10:37:33 +1000 Subject: Remove NO_BACKLIGHT_CLOCK (#6418) --- quantum/template/ps2avrgb/config.h | 1 - 1 file changed, 1 deletion(-) (limited to 'quantum/template') diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index 9117bf1f91..3ab841d745 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -39,7 +39,6 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 -#define NO_BACKLIGHT_CLOCK #define BACKLIGHT_LEVELS 1 #define RGBLIGHT_ANIMATIONS -- cgit v1.2.3 From 405dea01bef215a0b79524e4ff74364f1bcfeadf Mon Sep 17 00:00:00 2001 From: fauxpark Date: Fri, 9 Aug 2019 07:09:54 +1000 Subject: Add some defaults for ATmega32A to mcu_selection.mk (#6253) * Add some defaults for ATmega32A to mcu_selection.mk * Remove boilerplate from templates * Relax INTERRUPT_CONTROL_ENDPOINT and PROGRAM_CMD * Apply suggestions from code review Co-Authored-By: Drashna Jaelre --- quantum/template/avr/rules.mk | 36 ------------------------------------ quantum/template/ps2avrgb/rules.mk | 11 ----------- 2 files changed, 47 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/avr/rules.mk b/quantum/template/avr/rules.mk index 133c9e363b..50deba92cf 100644 --- a/quantum/template/avr/rules.mk +++ b/quantum/template/avr/rules.mk @@ -1,42 +1,6 @@ # MCU name MCU = atmega32u4 -# Processor frequency. -# 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 - # Bootloader selection # Teensy halfkay diff --git a/quantum/template/ps2avrgb/rules.mk b/quantum/template/ps2avrgb/rules.mk index 98a920e182..a3ac9bd75a 100644 --- a/quantum/template/ps2avrgb/rules.mk +++ b/quantum/template/ps2avrgb/rules.mk @@ -1,13 +1,5 @@ # MCU name MCU = atmega32a -PROTOCOL = VUSB - -# unsupported features for now -NO_UART = yes -NO_SUSPEND_POWER_DOWN = yes - -# processor frequency -F_CPU = 12000000 # Bootloader # This definition is optional, and if your keyboard supports multiple bootloaders of @@ -28,6 +20,3 @@ RGBLIGHT_CUSTOM_DRIVER = yes OPT_DEFS = -DDEBUG_LEVEL=0 SRC += i2c_master.c - -# programming options -PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex -- cgit v1.2.3 From 802c5755065a4519caa24c120c09010f2da56c41 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Sat, 17 Aug 2019 17:29:00 +1000 Subject: Remove backslashes from template keymap (#6548) --- quantum/template/base/keymaps/default/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/base/keymaps/default/keymap.c b/quantum/template/base/keymaps/default/keymap.c index 0e9fad357f..5eeedd45ef 100644 --- a/quantum/template/base/keymaps/default/keymap.c +++ b/quantum/template/base/keymaps/default/keymap.c @@ -23,8 +23,8 @@ enum custom_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( /* Base */ - KC_A, KC_1, KC_H, \ - KC_TAB, KC_SPC \ + KC_A, KC_1, KC_H, + KC_TAB, KC_SPC ), }; -- cgit v1.2.3 From 51bcadf38cfccc08b287554ab17e21624abf55b8 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 24 Aug 2019 16:35:11 +0100 Subject: Add 'bootloadHID' flash target (#5587) * Add 'bootloadHID' flash target * Prep for flash target * Add :flash support * Align bootloader wait messages Co-Authored-By: Drashna Jaelre * Update template to suggest use of :flash --- quantum/template/ps2avrgb/readme.md | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/ps2avrgb/readme.md b/quantum/template/ps2avrgb/readme.md index 1449b278cd..9d3ca0006f 100644 --- a/quantum/template/ps2avrgb/readme.md +++ b/quantum/template/ps2avrgb/readme.md @@ -12,35 +12,10 @@ Make example for this keyboard (after setting up your build environment): make %KEYBOARD%:default -Flashing - -ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. - -**Reset Key:** Hold down the key located at `K00`, commonly programmed as `Esc` while plugging in the keyboard. - -Windows: -1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). -2. Place your keyboard into reset. -3. Press the `Find Device` button and ensure that your keyboard is found. -4. Press the `Open .hex File` button and locate the `.hex` file you created. -5. Press the `Flash Device` button and wait for the process to complete. - -macOS: -1. Install homebrew by typing the following: - ``` - /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - ``` -2. Install `crosspack-avr`. - ``` - brew cask install crosspack-avr - ``` -3. Install the following packages: - ``` - brew install python3 - pip3 install pyusb - brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb - ``` -4. Place your keyboard into reset. -5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. +Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](flashing_bootloadhid.md)) + + make %KEYBOARD%:default:flash + +**Reset Key**: Hold down the key located at *LOCATION*, commonly programmed as *KEY* while plugging in the keyboard. 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). -- cgit v1.2.3 From b624f32f944acdc59dcb130674c09090c5c404cb Mon Sep 17 00:00:00 2001 From: skullY Date: Fri, 30 Aug 2019 11:19:03 -0700 Subject: clang-format changes --- quantum/template/avr/config.h | 22 +++--- quantum/template/base/keymaps/default/keymap.c | 61 +++++++--------- quantum/template/base/template.h | 10 +-- quantum/template/ps2avrgb/config.h | 21 +++--- quantum/template/ps2avrgb/template.c | 36 +++++----- quantum/template/ps2avrgb/usbconfig.h | 96 +++++++++++++------------- 6 files changed, 117 insertions(+), 129 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index 0fc7cf9cb9..713d6be3a5 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -20,12 +20,12 @@ along with this program. If not, see . #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER %YOUR_NAME% -#define PRODUCT %KEYBOARD% -#define DESCRIPTION A custom keyboard +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER % YOUR_NAME % +#define PRODUCT % KEYBOARD % +#define DESCRIPTION A custom keyboard /* key matrix size */ #define MATRIX_ROWS 2 @@ -40,9 +40,11 @@ along with this program. If not, see . * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) * -*/ -#define MATRIX_ROW_PINS { D0, D5 } -#define MATRIX_COL_PINS { F1, F0, B0 } + */ +#define MATRIX_ROW_PINS \ + { D0, D5 } +#define MATRIX_COL_PINS \ + { F1, F0, B0 } #define UNUSED_PINS /* COL2ROW, ROW2COL*/ @@ -51,7 +53,7 @@ along with this program. If not, see . /* * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. */ -#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING diff --git a/quantum/template/base/keymaps/default/keymap.c b/quantum/template/base/keymaps/default/keymap.c index 5eeedd45ef..308cb92a77 100644 --- a/quantum/template/base/keymaps/default/keymap.c +++ b/quantum/template/base/keymaps/default/keymap.c @@ -16,48 +16,37 @@ #include QMK_KEYBOARD_H // Defines the keycodes used by our macros in process_record_user -enum custom_keycodes { - QMKBEST = SAFE_RANGE, - QMKURL -}; +enum custom_keycodes { QMKBEST = SAFE_RANGE, QMKURL }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( /* Base */ - KC_A, KC_1, KC_H, - KC_TAB, KC_SPC - ), + [0] = LAYOUT(/* Base */ + KC_A, KC_1, KC_H, KC_TAB, KC_SPC), }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QMKBEST: - if (record->event.pressed) { - // when keycode QMKBEST is pressed - SEND_STRING("QMK is the best thing ever!"); - } else { - // when keycode QMKBEST is released - } - break; - case QMKURL: - if (record->event.pressed) { - // when keycode QMKURL is pressed - SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); - } else { - // when keycode QMKURL is released - } - break; - } - return true; + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; } -void matrix_init_user(void) { - -} +void matrix_init_user(void) {} -void matrix_scan_user(void) { +void matrix_scan_user(void) {} -} - -void led_set_user(uint8_t usb_led) { - -} +void led_set_user(uint8_t usb_led) {} diff --git a/quantum/template/base/template.h b/quantum/template/base/template.h index 2e531b1fd4..595da73c60 100644 --- a/quantum/template/base/template.h +++ b/quantum/template/base/template.h @@ -25,11 +25,5 @@ * The second converts the arguments into a two-dimensional array which * represents the switch matrix. */ -#define LAYOUT( \ - k00, k01, k02, \ - k10, k11 \ -) \ -{ \ - { k00, k01, k02 }, \ - { k10, KC_NO, k11 }, \ -} +#define LAYOUT(k00, k01, k02, k10, k11) \ + { {k00, k01, k02}, {k10, KC_NO, k11}, } diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index 3ab841d745..a780a10afc 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -19,22 +19,25 @@ along with this program. If not, see . #include "config_common.h" -#define VENDOR_ID 0x20A0 -#define PRODUCT_ID 0x422D -#define DEVICE_VER 0x0001 -#define MANUFACTURER You -#define PRODUCT %KEYBOARD% -#define DESCRIPTION A custom keyboard +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D +#define DEVICE_VER 0x0001 +#define MANUFACTURER You +#define PRODUCT % KEYBOARD % +#define DESCRIPTION A custom keyboard #define RGBLED_NUM 16 #define MATRIX_ROWS 8 #define MATRIX_COLS 11 -#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } -#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5 } +#define MATRIX_ROW_PINS \ + { B0, B1, B2, B3, B4, B5, B6, B7 } +#define MATRIX_COL_PINS \ + { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5 } // #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, C1, C0, D7 } -#define UNUSED_PINS {} +#define UNUSED_PINS \ + {} #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 diff --git a/quantum/template/ps2avrgb/template.c b/quantum/template/ps2avrgb/template.c index 07f27bbb22..efc8517485 100644 --- a/quantum/template/ps2avrgb/template.c +++ b/quantum/template/ps2avrgb/template.c @@ -18,38 +18,38 @@ #ifdef RGBLIGHT_ENABLE -#include -#include "i2c_master.h" -#include "rgblight.h" +# include +# include "i2c_master.h" +# include "rgblight.h" extern rgblight_config_t rgblight_config; void matrix_init_kb(void) { - i2c_init(); - // call user level keymaps, if any - matrix_init_user(); + i2c_init(); + // call user level keymaps, if any + matrix_init_user(); } // custom RGB driver void rgblight_set(void) { - if (!rgblight_config.enable) { - memset(led, 0, 3 * RGBLED_NUM); - } + if (!rgblight_config.enable) { + memset(led, 0, 3 * RGBLED_NUM); + } - i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); } bool rgb_init = false; void matrix_scan_kb(void) { - // if LEDs were previously on before poweroff, turn them back on - if (rgb_init == false && rgblight_config.enable) { - i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); - rgb_init = true; - } - - rgblight_task(); - matrix_scan_user(); + // if LEDs were previously on before poweroff, turn them back on + if (rgb_init == false && rgblight_config.enable) { + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); + rgb_init = true; + } + + rgblight_task(); + matrix_scan_user(); } #endif diff --git a/quantum/template/ps2avrgb/usbconfig.h b/quantum/template/ps2avrgb/usbconfig.h index 465db3a134..9ef232f045 100644 --- a/quantum/template/ps2avrgb/usbconfig.h +++ b/quantum/template/ps2avrgb/usbconfig.h @@ -14,15 +14,15 @@ section at the end of this file). /* ---------------------------- Hardware Config ---------------------------- */ -#define USB_CFG_IOPORTNAME D +#define USB_CFG_IOPORTNAME D /* This is the port where the USB bus is connected. When you configure it to * "B", the registers PORTB, PINB and DDRB will be used. */ -#define USB_CFG_DMINUS_BIT 3 +#define USB_CFG_DMINUS_BIT 3 /* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. * This may be any bit in the port. */ -#define USB_CFG_DPLUS_BIT 2 +#define USB_CFG_DPLUS_BIT 2 /* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. * This may be any bit in the port. Please note that D+ must also be connected * to interrupt pin INT0! [You can also use other interrupts, see section @@ -31,7 +31,7 @@ section at the end of this file). * interrupt, the USB interrupt will also be triggered at Start-Of-Frame * markers every millisecond.] */ -#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +#define USB_CFG_CLOCK_KHZ (F_CPU / 1000) /* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code * require no crystal, they tolerate +/- 1% deviation from the nominal @@ -40,7 +40,7 @@ section at the end of this file). * Since F_CPU should be defined to your actual clock rate anyway, you should * not need to modify this setting. */ -#define USB_CFG_CHECK_CRC 0 +#define USB_CFG_CHECK_CRC 0 /* Define this to 1 if you want that the driver checks integrity of incoming * data packets (CRC checks). CRC checks cost quite a bit of code size and are * currently only available for 18 MHz crystal clock. You must choose @@ -63,18 +63,18 @@ section at the end of this file). /* --------------------------- Functional Range ---------------------------- */ -#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 /* Define this to 1 if you want to compile a version with two endpoints: The * default control endpoint 0 and an interrupt-in endpoint (any other endpoint * number). */ -#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 /* Define this to 1 if you want to compile a version with three endpoints: The * default control endpoint 0, an interrupt-in endpoint 3 (or the number * configured below) and a catch-all default interrupt-in endpoint as above. * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. */ -#define USB_CFG_EP3_NUMBER 3 +#define USB_CFG_EP3_NUMBER 3 /* If the so-called endpoint 3 is used, it can now be configured to any other * endpoint number (except 0) with this macro. Default if undefined is 3. */ @@ -84,13 +84,13 @@ section at the end of this file). * Since the token is toggled BEFORE sending any data, the first packet is * sent with the oposite value of this configuration! */ -#define USB_CFG_IMPLEMENT_HALT 0 +#define USB_CFG_IMPLEMENT_HALT 0 /* Define this to 1 if you also want to implement the ENDPOINT_HALT feature * for endpoint 1 (interrupt endpoint). Although you may not need this feature, * it is required by the standard. We have made it a config option because it * bloats the code considerably. */ -#define USB_CFG_SUPPRESS_INTR_CODE 0 +#define USB_CFG_SUPPRESS_INTR_CODE 0 /* Define this to 1 if you want to declare interrupt-in endpoints, but don't * want to send any data over them. If this macro is defined to 1, functions * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if @@ -98,48 +98,48 @@ section at the end of this file). * (e.g. HID), but never want to send any data. This option saves a couple * of bytes in flash memory and the transmit buffers in RAM. */ -#define USB_CFG_INTR_POLL_INTERVAL 1 +#define USB_CFG_INTR_POLL_INTERVAL 1 /* If you compile a version with endpoint 1 (interrupt-in), this is the poll * interval. The value is in milliseconds and must not be less than 10 ms for * low speed devices. */ -#define USB_CFG_IS_SELF_POWERED 0 +#define USB_CFG_IS_SELF_POWERED 0 /* Define this to 1 if the device has its own power supply. Set it to 0 if the * device is powered from the USB bus. */ -#define USB_CFG_MAX_BUS_POWER 500 +#define USB_CFG_MAX_BUS_POWER 500 /* Set this variable to the maximum USB bus power consumption of your device. * The value is in milliamperes. [It will be divided by two since USB * communicates power requirements in units of 2 mA.] */ -#define USB_CFG_IMPLEMENT_FN_WRITE 1 +#define USB_CFG_IMPLEMENT_FN_WRITE 1 /* Set this to 1 if you want usbFunctionWrite() to be called for control-out * transfers. Set it to 0 if you don't need it and want to save a couple of * bytes. */ -#define USB_CFG_IMPLEMENT_FN_READ 0 +#define USB_CFG_IMPLEMENT_FN_READ 0 /* Set this to 1 if you need to send control replies which are generated * "on the fly" when usbFunctionRead() is called. If you only want to send * data from a static buffer, set it to 0 and return the data from * usbFunctionSetup(). This saves a couple of bytes. */ -#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 /* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. * You must implement the function usbFunctionWriteOut() which receives all * interrupt/bulk data sent to any endpoint other than 0. The endpoint number * can be found in 'usbRxToken'. */ -#define USB_CFG_HAVE_FLOWCONTROL 0 +#define USB_CFG_HAVE_FLOWCONTROL 0 /* Define this to 1 if you want flowcontrol over USB data. See the definition * of the macros usbDisableAllRequests() and usbEnableAllRequests() in * usbdrv.h. */ -#define USB_CFG_DRIVER_FLASH_PAGE 0 +#define USB_CFG_DRIVER_FLASH_PAGE 0 /* If the device has more than 64 kBytes of flash, define this to the 64 k page * where the driver's constants (descriptors) are located. Or in other words: * Define this to 1 for boot loaders on the ATMega128. */ -#define USB_CFG_LONG_TRANSFERS 0 +#define USB_CFG_LONG_TRANSFERS 0 /* Define this to 1 if you want to send/receive blocks of more than 254 bytes * in a single control-in or control-out transfer. Note that the capability * for long transfers increases the driver size. @@ -160,7 +160,7 @@ section at the end of this file). /* This macro (if defined) is executed when a USB SET_ADDRESS request was * received. */ -#define USB_COUNT_SOF 1 +#define USB_COUNT_SOF 1 /* define this macro to 1 if you need the global variable "usbSofCount" which * counts SOF packets. This feature requires that the hardware interrupt is * connected to D- instead of D+. @@ -184,7 +184,7 @@ section at the end of this file). * Please note that Start Of Frame detection works only if D- is wired to the * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! */ -#define USB_CFG_CHECK_DATA_TOGGLING 0 +#define USB_CFG_CHECK_DATA_TOGGLING 0 /* define this macro to 1 if you want to filter out duplicate data packets * sent by the host. Duplicates occur only as a consequence of communication * errors, when the host does not receive an ACK. Please note that you need to @@ -192,11 +192,11 @@ section at the end of this file). * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable * for each control- and out-endpoint to check for duplicate packets. */ -#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 /* define this macro to 1 if you want the function usbMeasureFrameLength() * compiled in. This function can be used to calibrate the AVR's RC oscillator. */ -#define USB_USE_FAST_CRC 0 +#define USB_USE_FAST_CRC 0 /* The assembler module has two implementations for the CRC algorithm. One is * faster, the other is smaller. This CRC routine is only used for transmitted * messages where timing is not critical. The faster routine needs 31 cycles @@ -207,7 +207,7 @@ section at the end of this file). /* -------------------------- Device Description --------------------------- */ -#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) /* USB vendor ID for the device, low byte first. If you have registered your * own Vendor ID, define it here. Otherwise you may use one of obdev's free * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! @@ -216,7 +216,7 @@ section at the end of this file). * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand * the implications! */ -#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) /* This is the ID of the product, low byte first. It is interpreted in the * scope of the vendor ID. If you have registered your own VID with usb.org * or if you have licensed a PID from somebody else, define it here. Otherwise @@ -227,10 +227,10 @@ section at the end of this file). * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand * the implications! */ -#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 /* Version number of the device: Minor number first, then major number. */ -#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' +#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' #define USB_CFG_VENDOR_NAME_LEN 13 /* These two values define the vendor name returned by the USB device. The name * must be given as a list of characters under single quotes. The characters @@ -240,7 +240,7 @@ section at the end of this file). * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for * details. */ -#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B' +#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B' #define USB_CFG_DEVICE_NAME_LEN 8 /* Same as above for the device name. If you don't want a device name, undefine * the macros. See the file USB-IDs-for-free.txt before you assign a name if @@ -255,20 +255,20 @@ section at the end of this file). * to fine tune control over USB descriptors such as the string descriptor * for the serial number. */ -#define USB_CFG_DEVICE_CLASS 0 -#define USB_CFG_DEVICE_SUBCLASS 0 +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 /* See USB specification if you want to conform to an existing device class. * Class 0xff is "vendor specific". */ -#define USB_CFG_INTERFACE_CLASS 3 /* HID */ -#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ -#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ /* See USB specification if you want to conform to an existing device class or * protocol. The following classes must be set at interface level: * HID class is 3, no subclass and protocol required (but may be useful!) * CDC class is 2, use subclass 2 and protocol 1 for ACM */ -#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 /* Define this to the length of the HID report descriptor, if you implement * an HID device. Otherwise don't define it or define it to 0. * If you use this define, you must add a PROGMEM character array named @@ -333,19 +333,19 @@ section at the end of this file). * }; */ -#define USB_CFG_DESCR_PROPS_DEVICE 0 -#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC //#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 -#define USB_CFG_DESCR_PROPS_STRINGS 0 -#define USB_CFG_DESCR_PROPS_STRING_0 0 -#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 -#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 -#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 -#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC //#define USB_CFG_DESCR_PROPS_HID 0 -#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC //#define USB_CFG_DESCR_PROPS_HID_REPORT 0 -#define USB_CFG_DESCR_PROPS_UNKNOWN 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 #define usbMsgPtr_t unsigned short /* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to @@ -374,10 +374,10 @@ section at the end of this file). /* Set INT1 for D- falling edge to count SOF */ /* #define USB_INTR_CFG EICRA */ -#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) /* #define USB_INTR_CFG_CLR 0 */ /* #define USB_INTR_ENABLE EIMSK */ -#define USB_INTR_ENABLE_BIT INT1 +#define USB_INTR_ENABLE_BIT INT1 /* #define USB_INTR_PENDING EIFR */ -#define USB_INTR_PENDING_BIT INTF1 -#define USB_INTR_VECTOR INT1_vect +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect -- cgit v1.2.3 From de4a47f1cc28c4ef66e7560eac2a50f717070ae2 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Sat, 21 Sep 2019 15:06:32 +1000 Subject: Cleanup rules.mk for 32A and 328P keyboards (#6767) --- quantum/template/avr/rules.mk | 6 ++---- quantum/template/ps2avrgb/rules.mk | 12 ++++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/avr/rules.mk b/quantum/template/avr/rules.mk index 50deba92cf..0ed05e71b5 100644 --- a/quantum/template/avr/rules.mk +++ b/quantum/template/avr/rules.mk @@ -1,17 +1,16 @@ # MCU name MCU = atmega32u4 - # Bootloader selection # Teensy halfkay # Pro Micro caterina # Atmel DFU atmel-dfu # LUFA DFU lufa-dfu # QMK DFU qmk-dfu -# atmega32a bootloadHID +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = atmel-dfu - # If you don't know the bootloader type, then you can specify the # Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line # Teensy halfKay 512 @@ -21,7 +20,6 @@ BOOTLOADER = atmel-dfu # USBaspLoader 2048 # OPT_DEFS += -DBOOTLOADER_SIZE=4096 - # Build Options # change yes to no to disable # diff --git a/quantum/template/ps2avrgb/rules.mk b/quantum/template/ps2avrgb/rules.mk index a3ac9bd75a..bda115db55 100644 --- a/quantum/template/ps2avrgb/rules.mk +++ b/quantum/template/ps2avrgb/rules.mk @@ -1,10 +1,14 @@ # MCU name MCU = atmega32a -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = bootloadHID # build options -- cgit v1.2.3 From ed1bf3afa25d7e7674df7e8618dfaf243de3058b Mon Sep 17 00:00:00 2001 From: fauxpark Date: Thu, 10 Oct 2019 21:48:37 +1100 Subject: Prevent clang-format messing up placeholder tokens within keyboard templates (#6790) * Use .template file extension for keyboard template files * Filter out .template files completely before passing to clang-format * Undo file extension stuff; just ignore quantum/template dir --- quantum/template/avr/config.h | 10 ++- quantum/template/avr/keyboard.c | 51 ++++++++++++++ quantum/template/avr/template.c | 51 -------------- quantum/template/base/keyboard.h | 35 ++++++++++ quantum/template/base/keymaps/default/keymap.c | 23 +++++-- quantum/template/base/keymaps/default/readme.md | 2 +- quantum/template/base/template.h | 29 -------- quantum/template/ps2avrgb/config.h | 11 ++- quantum/template/ps2avrgb/keyboard.c | 90 +++++++++++++++++++++++++ quantum/template/ps2avrgb/template.c | 90 ------------------------- 10 files changed, 202 insertions(+), 190 deletions(-) create mode 100644 quantum/template/avr/keyboard.c delete mode 100644 quantum/template/avr/template.c create mode 100644 quantum/template/base/keyboard.h delete mode 100644 quantum/template/base/template.h create mode 100644 quantum/template/ps2avrgb/keyboard.c delete mode 100644 quantum/template/ps2avrgb/template.c (limited to 'quantum/template') diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index 713d6be3a5..304a54ae59 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -23,8 +23,8 @@ along with this program. If not, see . #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x0000 #define DEVICE_VER 0x0001 -#define MANUFACTURER % YOUR_NAME % -#define PRODUCT % KEYBOARD % +#define MANUFACTURER %YOUR_NAME% +#define PRODUCT %KEYBOARD% #define DESCRIPTION A custom keyboard /* key matrix size */ @@ -41,10 +41,8 @@ along with this program. If not, see . * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) * */ -#define MATRIX_ROW_PINS \ - { D0, D5 } -#define MATRIX_COL_PINS \ - { F1, F0, B0 } +#define MATRIX_ROW_PINS { D0, D5 } +#define MATRIX_COL_PINS { F1, F0, B0 } #define UNUSED_PINS /* COL2ROW, ROW2COL*/ diff --git a/quantum/template/avr/keyboard.c b/quantum/template/avr/keyboard.c new file mode 100644 index 0000000000..e852a42c40 --- /dev/null +++ b/quantum/template/avr/keyboard.c @@ -0,0 +1,51 @@ +/* Copyright %YEAR% %YOUR_NAME% + * + * 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 . + */ +#include "%KEYBOARD%.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/quantum/template/avr/template.c b/quantum/template/avr/template.c deleted file mode 100644 index e852a42c40..0000000000 --- a/quantum/template/avr/template.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright %YEAR% %YOUR_NAME% - * - * 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 . - */ -#include "%KEYBOARD%.h" - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - -/* - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} - -*/ diff --git a/quantum/template/base/keyboard.h b/quantum/template/base/keyboard.h new file mode 100644 index 0000000000..2e531b1fd4 --- /dev/null +++ b/quantum/template/base/keyboard.h @@ -0,0 +1,35 @@ +/* Copyright %YEAR% %YOUR_NAME% + * + * 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 . + */ +#pragma once + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02, \ + k10, k11 \ +) \ +{ \ + { k00, k01, k02 }, \ + { k10, KC_NO, k11 }, \ +} diff --git a/quantum/template/base/keymaps/default/keymap.c b/quantum/template/base/keymaps/default/keymap.c index 308cb92a77..3508055b78 100644 --- a/quantum/template/base/keymaps/default/keymap.c +++ b/quantum/template/base/keymaps/default/keymap.c @@ -16,11 +16,16 @@ #include QMK_KEYBOARD_H // Defines the keycodes used by our macros in process_record_user -enum custom_keycodes { QMKBEST = SAFE_RANGE, QMKURL }; +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT(/* Base */ - KC_A, KC_1, KC_H, KC_TAB, KC_SPC), + [0] = LAYOUT( /* Base */ + KC_A, KC_1, KC_H, + KC_TAB, KC_SPC + ), }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { @@ -45,8 +50,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } -void matrix_init_user(void) {} +void matrix_init_user(void) { + +} -void matrix_scan_user(void) {} +void matrix_scan_user(void) { -void led_set_user(uint8_t usb_led) {} +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/quantum/template/base/keymaps/default/readme.md b/quantum/template/base/keymaps/default/readme.md index 21aa663d55..e052ed80f1 100644 --- a/quantum/template/base/keymaps/default/readme.md +++ b/quantum/template/base/keymaps/default/readme.md @@ -1 +1 @@ -# The default keymap for %KEYBOARD% \ No newline at end of file +# The default keymap for %KEYBOARD% diff --git a/quantum/template/base/template.h b/quantum/template/base/template.h deleted file mode 100644 index 595da73c60..0000000000 --- a/quantum/template/base/template.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright %YEAR% %YOUR_NAME% - * - * 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 . - */ -#pragma once - -#include "quantum.h" - -/* This a shortcut to help you visually see your layout. - * - * The first section contains all of the arguments representing the physical - * layout of the board and position of the keys. - * - * The second converts the arguments into a two-dimensional array which - * represents the switch matrix. - */ -#define LAYOUT(k00, k01, k02, k10, k11) \ - { {k00, k01, k02}, {k10, KC_NO, k11}, } diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index a780a10afc..f6d7c25e04 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -23,7 +23,7 @@ along with this program. If not, see . #define PRODUCT_ID 0x422D #define DEVICE_VER 0x0001 #define MANUFACTURER You -#define PRODUCT % KEYBOARD % +#define PRODUCT %KEYBOARD% #define DESCRIPTION A custom keyboard #define RGBLED_NUM 16 @@ -31,13 +31,10 @@ along with this program. If not, see . #define MATRIX_ROWS 8 #define MATRIX_COLS 11 -#define MATRIX_ROW_PINS \ - { B0, B1, B2, B3, B4, B5, B6, B7 } -#define MATRIX_COL_PINS \ - { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5 } +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5 } // #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, C1, C0, D7 } -#define UNUSED_PINS \ - {} +#define UNUSED_PINS {} #define DIODE_DIRECTION COL2ROW #define DEBOUNCE 5 diff --git a/quantum/template/ps2avrgb/keyboard.c b/quantum/template/ps2avrgb/keyboard.c new file mode 100644 index 0000000000..efc8517485 --- /dev/null +++ b/quantum/template/ps2avrgb/keyboard.c @@ -0,0 +1,90 @@ +/* Copyright %YEAR% %YOUR_NAME% + * + * 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 . + */ + +#include "%KEYBOARD%.h" + +#ifdef RGBLIGHT_ENABLE + +# include +# include "i2c_master.h" +# include "rgblight.h" + +extern rgblight_config_t rgblight_config; + +void matrix_init_kb(void) { + i2c_init(); + // call user level keymaps, if any + matrix_init_user(); +} + +// custom RGB driver +void rgblight_set(void) { + if (!rgblight_config.enable) { + memset(led, 0, 3 * RGBLED_NUM); + } + + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); +} + +bool rgb_init = false; + +void matrix_scan_kb(void) { + // if LEDs were previously on before poweroff, turn them back on + if (rgb_init == false && rgblight_config.enable) { + i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); + rgb_init = true; + } + + rgblight_task(); + matrix_scan_user(); +} + +#endif + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/quantum/template/ps2avrgb/template.c b/quantum/template/ps2avrgb/template.c deleted file mode 100644 index efc8517485..0000000000 --- a/quantum/template/ps2avrgb/template.c +++ /dev/null @@ -1,90 +0,0 @@ -/* Copyright %YEAR% %YOUR_NAME% - * - * 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 . - */ - -#include "%KEYBOARD%.h" - -#ifdef RGBLIGHT_ENABLE - -# include -# include "i2c_master.h" -# include "rgblight.h" - -extern rgblight_config_t rgblight_config; - -void matrix_init_kb(void) { - i2c_init(); - // call user level keymaps, if any - matrix_init_user(); -} - -// custom RGB driver -void rgblight_set(void) { - if (!rgblight_config.enable) { - memset(led, 0, 3 * RGBLED_NUM); - } - - i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); -} - -bool rgb_init = false; - -void matrix_scan_kb(void) { - // if LEDs were previously on before poweroff, turn them back on - if (rgb_init == false && rgblight_config.enable) { - i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); - rgb_init = true; - } - - rgblight_task(); - matrix_scan_user(); -} - -#endif - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - -/* - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} - -*/ -- cgit v1.2.3 From bb43010170a955053868376d5dcfd3abba5b16c9 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Fri, 11 Oct 2019 22:04:00 -0700 Subject: Fix broken link to ps2avrgb flashing instructions (#7011) --- quantum/template/ps2avrgb/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/template') diff --git a/quantum/template/ps2avrgb/readme.md b/quantum/template/ps2avrgb/readme.md index 9d3ca0006f..3dce0e9505 100644 --- a/quantum/template/ps2avrgb/readme.md +++ b/quantum/template/ps2avrgb/readme.md @@ -12,7 +12,7 @@ Make example for this keyboard (after setting up your build environment): make %KEYBOARD%:default -Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](flashing_bootloadhid.md)) +Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid)) make %KEYBOARD%:default:flash -- cgit v1.2.3 From b23f6011c34dcb471c312655f7af37c0a0f5f779 Mon Sep 17 00:00:00 2001 From: Amber Holly Date: Sat, 19 Oct 2019 02:14:49 +0100 Subject: Remove build option firmware size impacts (#6947) * Update rules.mk template to remove build option size impacts * Add rules.mk cleaning script * Update all rules.mk files to remove build option firmware size impact messages * Remove references to feature filesize in documentation * Revert "Update all rules.mk files to remove build option firmware size impact messages" This reverts commit 7cfe70976bcc223bf47c960b2e6af8596df80a32. * Fix regex in cleanup script and exclude keymaps/ directories * Update quantum/template/avr/rules.mk Fixed missing tabs/spaces. Co-Authored-By: fauxpark --- quantum/template/avr/rules.mk | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/avr/rules.mk b/quantum/template/avr/rules.mk index 0ed05e71b5..bb2bd14f9f 100644 --- a/quantum/template/avr/rules.mk +++ b/quantum/template/avr/rules.mk @@ -23,10 +23,10 @@ BOOTLOADER = atmel-dfu # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug COMMAND_ENABLE = yes # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend @@ -34,9 +34,8 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend NKRO_ENABLE = no # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) -UNICODE_ENABLE = no # Unicode +MIDI_ENABLE = no # MIDI support BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = no # Audio output on port C6 FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches -HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +HD44780_ENABLE = no # Enable support for HD44780 based LCDs -- cgit v1.2.3 From 64b7cfe735339193ae78fe0f13029b0e027af7a7 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Tue, 29 Oct 2019 22:53:11 +0000 Subject: Refactor ps2avrgb i2c ws2812 to core (#7183) * Refactor ps2avrgb i2c ws2812 to core * Refactor jj40 to use ws2812 i2c driver * Refactor ps2avrgb template to use ws2812 i2c driver * Add ws2812 stub files * clang-format and driver config * Add ws2812 driver docs * Fix default config values * Update tmk_core/protocol/vusb/main.c Co-Authored-By: Drashna Jaelre --- quantum/template/ps2avrgb/keyboard.c | 38 ------------------------------------ quantum/template/ps2avrgb/rules.mk | 4 +--- 2 files changed, 1 insertion(+), 41 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/ps2avrgb/keyboard.c b/quantum/template/ps2avrgb/keyboard.c index efc8517485..73cd668f85 100644 --- a/quantum/template/ps2avrgb/keyboard.c +++ b/quantum/template/ps2avrgb/keyboard.c @@ -16,44 +16,6 @@ #include "%KEYBOARD%.h" -#ifdef RGBLIGHT_ENABLE - -# include -# include "i2c_master.h" -# include "rgblight.h" - -extern rgblight_config_t rgblight_config; - -void matrix_init_kb(void) { - i2c_init(); - // call user level keymaps, if any - matrix_init_user(); -} - -// custom RGB driver -void rgblight_set(void) { - if (!rgblight_config.enable) { - memset(led, 0, 3 * RGBLED_NUM); - } - - i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); -} - -bool rgb_init = false; - -void matrix_scan_kb(void) { - // if LEDs were previously on before poweroff, turn them back on - if (rgb_init == false && rgblight_config.enable) { - i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); - rgb_init = true; - } - - rgblight_task(); - matrix_scan_user(); -} - -#endif - // Optional override functions below. // You can leave any or all of these undefined. // These are only required if you want to perform custom actions. diff --git a/quantum/template/ps2avrgb/rules.mk b/quantum/template/ps2avrgb/rules.mk index bda115db55..ec57b03dcb 100644 --- a/quantum/template/ps2avrgb/rules.mk +++ b/quantum/template/ps2avrgb/rules.mk @@ -19,8 +19,6 @@ CONSOLE_ENABLE = yes COMMAND_ENABLE = yes BACKLIGHT_ENABLE = no RGBLIGHT_ENABLE = yes -RGBLIGHT_CUSTOM_DRIVER = yes +WS2812_DRIVER = i2c OPT_DEFS = -DDEBUG_LEVEL=0 - -SRC += i2c_master.c -- cgit v1.2.3 From e6cc9cc78d40af1386f9a116d5fcc95c20233110 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Sat, 2 Nov 2019 13:06:03 +1100 Subject: Template updates (#7221) * Template updates * Flesh out info.json & keymap.c, and turn double spaces section into a list * Add enum to demonstrate layer naming * Semicolon --- quantum/template/avr/keyboard.c | 51 ------------------------- quantum/template/avr/readme.md | 6 +-- quantum/template/avr/rules.mk | 1 + quantum/template/base/info.json | 18 +++++++++ quantum/template/base/keyboard.c | 50 +++++++++++++++++++++++++ quantum/template/base/keyboard.h | 7 ++-- quantum/template/base/keymaps/default/keymap.c | 19 ++++++++-- quantum/template/ps2avrgb/keyboard.c | 52 -------------------------- quantum/template/ps2avrgb/readme.md | 6 +-- quantum/template/ps2avrgb/rules.mk | 18 +++++---- 10 files changed, 105 insertions(+), 123 deletions(-) delete mode 100644 quantum/template/avr/keyboard.c create mode 100644 quantum/template/base/keyboard.c delete mode 100644 quantum/template/ps2avrgb/keyboard.c (limited to 'quantum/template') diff --git a/quantum/template/avr/keyboard.c b/quantum/template/avr/keyboard.c deleted file mode 100644 index e852a42c40..0000000000 --- a/quantum/template/avr/keyboard.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright %YEAR% %YOUR_NAME% - * - * 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 . - */ -#include "%KEYBOARD%.h" - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - -/* - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} - -*/ diff --git a/quantum/template/avr/readme.md b/quantum/template/avr/readme.md index 719222d377..0430dd0fc9 100644 --- a/quantum/template/avr/readme.md +++ b/quantum/template/avr/readme.md @@ -4,9 +4,9 @@ A short description of the keyboard/project -Keyboard Maintainer: [%YOUR_NAME%](https://github.com/yourusername) -Hardware Supported: The PCBs, controllers supported -Hardware Availability: links to where you can find this hardware +* Keyboard Maintainer: [%YOUR_NAME%](https://github.com/yourusername) +* Hardware Supported: The PCBs, controllers supported +* Hardware Availability: Links to where you can find this hardware Make example for this keyboard (after setting up your build environment): diff --git a/quantum/template/avr/rules.mk b/quantum/template/avr/rules.mk index bb2bd14f9f..ea0c83c68a 100644 --- a/quantum/template/avr/rules.mk +++ b/quantum/template/avr/rules.mk @@ -13,6 +13,7 @@ BOOTLOADER = atmel-dfu # If you don't know the bootloader type, then you can specify the # Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Otherwise, delete this section # Teensy halfKay 512 # Teensy++ halfKay 1024 # Atmel DFU loader 4096 diff --git a/quantum/template/base/info.json b/quantum/template/base/info.json index e69de29bb2..b8e8f1f2db 100644 --- a/quantum/template/base/info.json +++ b/quantum/template/base/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "%KEYBOARD%", + "url": "", + "maintainer": "%YOUR_NAME%", + "width": 3, + "height": 2, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k10", "x":0, "y":1, "w":1.5}, + {"label":"k12", "x":1.5, "y":1, "w":1.5} + ] + } + } +} diff --git a/quantum/template/base/keyboard.c b/quantum/template/base/keyboard.c new file mode 100644 index 0000000000..55e4fffd3a --- /dev/null +++ b/quantum/template/base/keyboard.c @@ -0,0 +1,50 @@ +/* Copyright %YEAR% %YOUR_NAME% + * + * 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 . + */ + +#include "%KEYBOARD%.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} +*/ diff --git a/quantum/template/base/keyboard.h b/quantum/template/base/keyboard.h index 2e531b1fd4..8a21d92578 100644 --- a/quantum/template/base/keyboard.h +++ b/quantum/template/base/keyboard.h @@ -13,11 +13,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #pragma once #include "quantum.h" -/* This a shortcut to help you visually see your layout. +/* This is a shortcut to help you visually see your layout. * * The first section contains all of the arguments representing the physical * layout of the board and position of the keys. @@ -27,9 +28,9 @@ */ #define LAYOUT( \ k00, k01, k02, \ - k10, k11 \ + k10, k12 \ ) \ { \ { k00, k01, k02 }, \ - { k10, KC_NO, k11 }, \ + { k10, KC_NO, k12 } \ } diff --git a/quantum/template/base/keymaps/default/keymap.c b/quantum/template/base/keymaps/default/keymap.c index 3508055b78..4d5bac7b2f 100644 --- a/quantum/template/base/keymaps/default/keymap.c +++ b/quantum/template/base/keymaps/default/keymap.c @@ -15,6 +15,12 @@ */ #include QMK_KEYBOARD_H +// Defines names for use in layer keycodes and the keymap +enum layer_names { + _BASE, + _FN +}; + // Defines the keycodes used by our macros in process_record_user enum custom_keycodes { QMKBEST = SAFE_RANGE, @@ -22,10 +28,15 @@ enum custom_keycodes { }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( /* Base */ - KC_A, KC_1, KC_H, - KC_TAB, KC_SPC + /* Base */ + [_BASE] = LAYOUT( + KC_A, KC_1, MO(_FN), + KC_TAB, KC_SPC ), + [_FN] = LAYOUT( + QMKBEST, QMKURL, _______, + RESET, XXXXXXX + ) }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { @@ -50,6 +61,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } +/* void matrix_init_user(void) { } @@ -61,3 +73,4 @@ void matrix_scan_user(void) { void led_set_user(uint8_t usb_led) { } +*/ diff --git a/quantum/template/ps2avrgb/keyboard.c b/quantum/template/ps2avrgb/keyboard.c deleted file mode 100644 index 73cd668f85..0000000000 --- a/quantum/template/ps2avrgb/keyboard.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright %YEAR% %YOUR_NAME% - * - * 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 . - */ - -#include "%KEYBOARD%.h" - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - -/* - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} - -*/ diff --git a/quantum/template/ps2avrgb/readme.md b/quantum/template/ps2avrgb/readme.md index 3dce0e9505..b45ef91c9d 100644 --- a/quantum/template/ps2avrgb/readme.md +++ b/quantum/template/ps2avrgb/readme.md @@ -4,9 +4,9 @@ A short description of the keyboard/project -Keyboard Maintainer: [%YOUR_NAME%](https://github.com/yourusername) -Hardware Supported: The PCBs, controllers supported -Hardware Availability: links to where you can find this hardware +* Keyboard Maintainer: [%YOUR_NAME%](https://github.com/yourusername) +* Hardware Supported: The PCBs, controllers supported +* Hardware Availability: links to where you can find this hardware Make example for this keyboard (after setting up your build environment): diff --git a/quantum/template/ps2avrgb/rules.mk b/quantum/template/ps2avrgb/rules.mk index ec57b03dcb..b9b81a6750 100644 --- a/quantum/template/ps2avrgb/rules.mk +++ b/quantum/template/ps2avrgb/rules.mk @@ -11,14 +11,16 @@ MCU = atmega32a # ATmega328P USBasp BOOTLOADER = bootloadHID -# build options -BOOTMAGIC_ENABLE = no -MOUSEKEY_ENABLE = no -EXTRAKEY_ENABLE = yes -CONSOLE_ENABLE = yes -COMMAND_ENABLE = yes -BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = yes +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow WS2812_DRIVER = i2c OPT_DEFS = -DDEBUG_LEVEL=0 -- cgit v1.2.3 From dfb78d2a086daa2ceb3fd043afce03785abfa23a Mon Sep 17 00:00:00 2001 From: fauxpark Date: Wed, 6 Nov 2019 11:42:16 +1100 Subject: New and improved lock LED callbacks (#7215) * New and improved lock LED callbacks * Include stdbool * Update documentation * Use full function signatures and add keyboard-level example --- quantum/template/base/keyboard.c | 4 ++-- quantum/template/base/keymaps/default/keymap.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/base/keyboard.c b/quantum/template/base/keyboard.c index 55e4fffd3a..fc31c294a2 100644 --- a/quantum/template/base/keyboard.c +++ b/quantum/template/base/keyboard.c @@ -42,9 +42,9 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return process_record_user(keycode, record); } -void led_set_kb(uint8_t usb_led) { +bool led_update_kb(led_t led_state) { // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - led_set_user(usb_led); + return led_update_user(led_state); } */ diff --git a/quantum/template/base/keymaps/default/keymap.c b/quantum/template/base/keymaps/default/keymap.c index 4d5bac7b2f..3a68f5487c 100644 --- a/quantum/template/base/keymaps/default/keymap.c +++ b/quantum/template/base/keymaps/default/keymap.c @@ -70,7 +70,7 @@ void matrix_scan_user(void) { } -void led_set_user(uint8_t usb_led) { - +bool led_update_user(led_t led_state) { + return true; } */ -- cgit v1.2.3 From 3f6426ff5f14d1cdac9af935aaf175d3dbca3592 Mon Sep 17 00:00:00 2001 From: Stephen Hogsten Date: Mon, 11 Nov 2019 18:27:20 -0800 Subject: disable deprecated actions (#7211) * disable deprecated actions * wrap no action with link time optimization test * fix link time optimization check --- quantum/template/avr/config.h | 7 +++++-- quantum/template/ps2avrgb/config.h | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index 304a54ae59..7e4a014495 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -190,9 +190,12 @@ along with this program. If not, see . //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION +/* disable these deprecated features by default */ +#ifndef LINK_TIME_OPTIMIZATION_ENABLE + #define NO_ACTION_MACRO + #define NO_ACTION_FUNCTION +#endif /* * MIDI options */ diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index f6d7c25e04..4deb719f5a 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -44,6 +44,12 @@ along with this program. If not, see . #define NO_UART 1 +/* disable these deprecated features by default */ +#ifndef LINK_TIME_OPTIMIZATION_ENABLE + #define NO_ACTION_MACRO + #define NO_ACTION_FUNCTION +#endif + /* key combination for magic key command */ /* defined by default; to change, uncomment and set to the combination you want */ // #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT) -- cgit v1.2.3 From 30473357290747be06e9200a7d9c751738a3b0a1 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Fri, 15 Nov 2019 10:21:22 +1100 Subject: =?UTF-8?q?Add=20support=20for=20configurable=20polling=20interval?= =?UTF-8?q?=20and=20power=20usage=20o=E2=80=A6=20(#7336)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add support for custom polling interval and power usage on V-USB boards * Use 1ms as default for now --- quantum/template/ps2avrgb/usbconfig.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/ps2avrgb/usbconfig.h b/quantum/template/ps2avrgb/usbconfig.h index 9ef232f045..75f318b991 100644 --- a/quantum/template/ps2avrgb/usbconfig.h +++ b/quantum/template/ps2avrgb/usbconfig.h @@ -98,20 +98,10 @@ section at the end of this file). * (e.g. HID), but never want to send any data. This option saves a couple * of bytes in flash memory and the transmit buffers in RAM. */ -#define USB_CFG_INTR_POLL_INTERVAL 1 -/* If you compile a version with endpoint 1 (interrupt-in), this is the poll - * interval. The value is in milliseconds and must not be less than 10 ms for - * low speed devices. - */ #define USB_CFG_IS_SELF_POWERED 0 /* Define this to 1 if the device has its own power supply. Set it to 0 if the * device is powered from the USB bus. */ -#define USB_CFG_MAX_BUS_POWER 500 -/* Set this variable to the maximum USB bus power consumption of your device. - * The value is in milliamperes. [It will be divided by two since USB - * communicates power requirements in units of 2 mA.] - */ #define USB_CFG_IMPLEMENT_FN_WRITE 1 /* Set this to 1 if you want usbFunctionWrite() to be called for control-out * transfers. Set it to 0 if you don't need it and want to save a couple of -- cgit v1.2.3 From 519df78cdbf7211b9e1ac6b961b0e10bb5164914 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Fri, 15 Nov 2019 10:21:53 +1100 Subject: Set device version from config.h for V-USB boards (#7316) --- quantum/template/ps2avrgb/usbconfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/template') diff --git a/quantum/template/ps2avrgb/usbconfig.h b/quantum/template/ps2avrgb/usbconfig.h index 75f318b991..83ad06544d 100644 --- a/quantum/template/ps2avrgb/usbconfig.h +++ b/quantum/template/ps2avrgb/usbconfig.h @@ -217,7 +217,7 @@ section at the end of this file). * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand * the implications! */ -#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +#define USB_CFG_DEVICE_VERSION (DEVICE_VER & 0xFF), ((DEVICE_VER >> 8) & 0xFF) /* Version number of the device: Minor number first, then major number. */ #define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' -- cgit v1.2.3 From 25e9853efe28e8897cd9128d7515d3f60f482aad Mon Sep 17 00:00:00 2001 From: Erovia Date: Tue, 19 Nov 2019 22:00:45 +0100 Subject: [Core] Fix ps2avrgb template (#7412) --- quantum/template/ps2avrgb/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/template') diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index 4deb719f5a..d93512bca6 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -22,7 +22,7 @@ along with this program. If not, see . #define VENDOR_ID 0x20A0 #define PRODUCT_ID 0x422D #define DEVICE_VER 0x0001 -#define MANUFACTURER You +#define MANUFACTURER %YOUR_NAME% #define PRODUCT %KEYBOARD% #define DESCRIPTION A custom keyboard -- cgit v1.2.3 From 5a6737a778cfa828e4fdb5d382a84a41e5210d8e Mon Sep 17 00:00:00 2001 From: fauxpark Date: Tue, 26 Nov 2019 18:16:58 +1100 Subject: Send string keycode tweaks (#7471) --- quantum/template/base/keymaps/default/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/template') diff --git a/quantum/template/base/keymaps/default/keymap.c b/quantum/template/base/keymaps/default/keymap.c index 3a68f5487c..af35ccec15 100644 --- a/quantum/template/base/keymaps/default/keymap.c +++ b/quantum/template/base/keymaps/default/keymap.c @@ -52,7 +52,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case QMKURL: if (record->event.pressed) { // when keycode QMKURL is pressed - SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + SEND_STRING("https://qmk.fm/\n"); } else { // when keycode QMKURL is released } -- cgit v1.2.3 From 5e3951b361e6d173b705bd3b2b6df0c543258d98 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 10 Mar 2020 06:58:25 +1100 Subject: Remove NO_UART defines from config.h for V-USB boards (#8351) --- quantum/template/ps2avrgb/config.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index d93512bca6..2eb4844226 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -42,8 +42,6 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 1 #define RGBLIGHT_ANIMATIONS -#define NO_UART 1 - /* disable these deprecated features by default */ #ifndef LINK_TIME_OPTIMIZATION_ENABLE #define NO_ACTION_MACRO -- cgit v1.2.3 From 147bc6ec43a0244682a73eb5c76146608e60afd4 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 22 Mar 2020 18:50:37 +1100 Subject: Remove BOOTLOADER_SIZE stuff from template (#8516) --- quantum/template/avr/rules.mk | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/avr/rules.mk b/quantum/template/avr/rules.mk index ea0c83c68a..4053484219 100644 --- a/quantum/template/avr/rules.mk +++ b/quantum/template/avr/rules.mk @@ -11,16 +11,6 @@ MCU = atmega32u4 # ATmega328P USBasp BOOTLOADER = atmel-dfu -# If you don't know the bootloader type, then you can specify the -# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line -# Otherwise, delete this section -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -# OPT_DEFS += -DBOOTLOADER_SIZE=4096 - # Build Options # change yes to no to disable # -- cgit v1.2.3 From 14079ce6984b359e080c85d9e9b8f7b8eb01437c Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 28 Mar 2020 13:02:25 +1100 Subject: V-USB: Use structs for USB descriptors (#8572) * V-USB: Use structs for USB descriptors * Update usbconfigs * cformat pass --- quantum/template/ps2avrgb/usbconfig.h | 47 ++++++----------------------------- 1 file changed, 8 insertions(+), 39 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/ps2avrgb/usbconfig.h b/quantum/template/ps2avrgb/usbconfig.h index 83ad06544d..6e910a7038 100644 --- a/quantum/template/ps2avrgb/usbconfig.h +++ b/quantum/template/ps2avrgb/usbconfig.h @@ -197,7 +197,7 @@ section at the end of this file). /* -------------------------- Device Description --------------------------- */ -#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +#define USB_CFG_VENDOR_ID /* USB vendor ID for the device, low byte first. If you have registered your * own Vendor ID, define it here. Otherwise you may use one of obdev's free * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! @@ -206,7 +206,7 @@ section at the end of this file). * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand * the implications! */ -#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +#define USB_CFG_DEVICE_ID /* This is the ID of the product, low byte first. It is interpreted in the * scope of the vendor ID. If you have registered your own VID with usb.org * or if you have licensed a PID from somebody else, define it here. Otherwise @@ -217,34 +217,6 @@ section at the end of this file). * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand * the implications! */ -#define USB_CFG_DEVICE_VERSION (DEVICE_VER & 0xFF), ((DEVICE_VER >> 8) & 0xFF) -/* Version number of the device: Minor number first, then major number. - */ -#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' -#define USB_CFG_VENDOR_NAME_LEN 13 -/* These two values define the vendor name returned by the USB device. The name - * must be given as a list of characters under single quotes. The characters - * are interpreted as Unicode (UTF-16) entities. - * If you don't want a vendor name string, undefine these macros. - * ALWAYS define a vendor name containing your Internet domain name if you use - * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for - * details. - */ -#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B' -#define USB_CFG_DEVICE_NAME_LEN 8 -/* Same as above for the device name. If you don't want a device name, undefine - * the macros. See the file USB-IDs-for-free.txt before you assign a name if - * you use a shared VID/PID. - */ -/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ -/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ -/* Same as above for the serial number. If you don't want a serial number, - * undefine the macros. - * It may be useful to provide the serial number through other means than at - * compile time. See the section about descriptor properties below for how - * to fine tune control over USB descriptors such as the string descriptor - * for the serial number. - */ #define USB_CFG_DEVICE_CLASS 0 #define USB_CFG_DEVICE_SUBCLASS 0 /* See USB specification if you want to conform to an existing device class. @@ -323,18 +295,15 @@ section at the end of this file). * }; */ -#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_DEVICE USB_PROP_IS_DYNAMIC #define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 -#define USB_CFG_DESCR_PROPS_STRINGS 0 -#define USB_CFG_DESCR_PROPS_STRING_0 0 -#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 -#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 -#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_STRINGS USB_PROP_IS_DYNAMIC +#define USB_CFG_DESCR_PROPS_STRING_0 USB_PROP_IS_DYNAMIC +#define USB_CFG_DESCR_PROPS_STRING_VENDOR USB_PROP_IS_DYNAMIC +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT USB_PROP_IS_DYNAMIC +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER USB_PROP_IS_DYNAMIC #define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_HID 0 #define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 #define USB_CFG_DESCR_PROPS_UNKNOWN 0 #define usbMsgPtr_t unsigned short -- cgit v1.2.3 From 51a81813b0191d95f3ed774cbc410579e606dc5c Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 31 Mar 2020 23:17:04 +1100 Subject: V-USB: Consolidate usbconfig.h's into a single file (#8584) --- quantum/template/ps2avrgb/usbconfig.h | 342 ---------------------------------- 1 file changed, 342 deletions(-) delete mode 100644 quantum/template/ps2avrgb/usbconfig.h (limited to 'quantum/template') diff --git a/quantum/template/ps2avrgb/usbconfig.h b/quantum/template/ps2avrgb/usbconfig.h deleted file mode 100644 index 6e910a7038..0000000000 --- a/quantum/template/ps2avrgb/usbconfig.h +++ /dev/null @@ -1,342 +0,0 @@ -#pragma once - -#include "config.h" - -/* -General Description: -This file is an example configuration (with inline documentation) for the USB -driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is -also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may -wire the lines to any other port, as long as D+ is also wired to INT0 (or any -other hardware interrupt, as long as it is the highest level interrupt, see -section at the end of this file). -*/ - -/* ---------------------------- Hardware Config ---------------------------- */ - -#define USB_CFG_IOPORTNAME D -/* This is the port where the USB bus is connected. When you configure it to - * "B", the registers PORTB, PINB and DDRB will be used. - */ -#define USB_CFG_DMINUS_BIT 3 -/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. - * This may be any bit in the port. - */ -#define USB_CFG_DPLUS_BIT 2 -/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. - * This may be any bit in the port. Please note that D+ must also be connected - * to interrupt pin INT0! [You can also use other interrupts, see section - * "Optional MCU Description" below, or you can connect D- to the interrupt, as - * it is required if you use the USB_COUNT_SOF feature. If you use D- for the - * interrupt, the USB interrupt will also be triggered at Start-Of-Frame - * markers every millisecond.] - */ -#define USB_CFG_CLOCK_KHZ (F_CPU / 1000) -/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, - * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code - * require no crystal, they tolerate +/- 1% deviation from the nominal - * frequency. All other rates require a precision of 2000 ppm and thus a - * crystal! - * Since F_CPU should be defined to your actual clock rate anyway, you should - * not need to modify this setting. - */ -#define USB_CFG_CHECK_CRC 0 -/* Define this to 1 if you want that the driver checks integrity of incoming - * data packets (CRC checks). CRC checks cost quite a bit of code size and are - * currently only available for 18 MHz crystal clock. You must choose - * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. - */ - -/* ----------------------- Optional Hardware Config ------------------------ */ - -/* #define USB_CFG_PULLUP_IOPORTNAME D */ -/* If you connect the 1.5k pullup resistor from D- to a port pin instead of - * V+, you can connect and disconnect the device from firmware by calling - * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). - * This constant defines the port on which the pullup resistor is connected. - */ -/* #define USB_CFG_PULLUP_BIT 4 */ -/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined - * above) where the 1.5k pullup resistor is connected. See description - * above for details. - */ - -/* --------------------------- Functional Range ---------------------------- */ - -#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 -/* Define this to 1 if you want to compile a version with two endpoints: The - * default control endpoint 0 and an interrupt-in endpoint (any other endpoint - * number). - */ -#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 -/* Define this to 1 if you want to compile a version with three endpoints: The - * default control endpoint 0, an interrupt-in endpoint 3 (or the number - * configured below) and a catch-all default interrupt-in endpoint as above. - * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. - */ -#define USB_CFG_EP3_NUMBER 3 -/* If the so-called endpoint 3 is used, it can now be configured to any other - * endpoint number (except 0) with this macro. Default if undefined is 3. - */ -/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ -/* The above macro defines the startup condition for data toggling on the - * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. - * Since the token is toggled BEFORE sending any data, the first packet is - * sent with the oposite value of this configuration! - */ -#define USB_CFG_IMPLEMENT_HALT 0 -/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature - * for endpoint 1 (interrupt endpoint). Although you may not need this feature, - * it is required by the standard. We have made it a config option because it - * bloats the code considerably. - */ -#define USB_CFG_SUPPRESS_INTR_CODE 0 -/* Define this to 1 if you want to declare interrupt-in endpoints, but don't - * want to send any data over them. If this macro is defined to 1, functions - * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if - * you need the interrupt-in endpoints in order to comply to an interface - * (e.g. HID), but never want to send any data. This option saves a couple - * of bytes in flash memory and the transmit buffers in RAM. - */ -#define USB_CFG_IS_SELF_POWERED 0 -/* Define this to 1 if the device has its own power supply. Set it to 0 if the - * device is powered from the USB bus. - */ -#define USB_CFG_IMPLEMENT_FN_WRITE 1 -/* Set this to 1 if you want usbFunctionWrite() to be called for control-out - * transfers. Set it to 0 if you don't need it and want to save a couple of - * bytes. - */ -#define USB_CFG_IMPLEMENT_FN_READ 0 -/* Set this to 1 if you need to send control replies which are generated - * "on the fly" when usbFunctionRead() is called. If you only want to send - * data from a static buffer, set it to 0 and return the data from - * usbFunctionSetup(). This saves a couple of bytes. - */ -#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 -/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. - * You must implement the function usbFunctionWriteOut() which receives all - * interrupt/bulk data sent to any endpoint other than 0. The endpoint number - * can be found in 'usbRxToken'. - */ -#define USB_CFG_HAVE_FLOWCONTROL 0 -/* Define this to 1 if you want flowcontrol over USB data. See the definition - * of the macros usbDisableAllRequests() and usbEnableAllRequests() in - * usbdrv.h. - */ -#define USB_CFG_DRIVER_FLASH_PAGE 0 -/* If the device has more than 64 kBytes of flash, define this to the 64 k page - * where the driver's constants (descriptors) are located. Or in other words: - * Define this to 1 for boot loaders on the ATMega128. - */ -#define USB_CFG_LONG_TRANSFERS 0 -/* Define this to 1 if you want to send/receive blocks of more than 254 bytes - * in a single control-in or control-out transfer. Note that the capability - * for long transfers increases the driver size. - */ -/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ -/* This macro is a hook if you want to do unconventional things. If it is - * defined, it's inserted at the beginning of received message processing. - * If you eat the received message and don't want default processing to - * proceed, do a return after doing your things. One possible application - * (besides debugging) is to flash a status LED on each packet. - */ -/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ -/* This macro is a hook if you need to know when an USB RESET occurs. It has - * one parameter which distinguishes between the start of RESET state and its - * end. - */ -/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ -/* This macro (if defined) is executed when a USB SET_ADDRESS request was - * received. - */ -#define USB_COUNT_SOF 1 -/* define this macro to 1 if you need the global variable "usbSofCount" which - * counts SOF packets. This feature requires that the hardware interrupt is - * connected to D- instead of D+. - */ -/* #ifdef __ASSEMBLER__ - * macro myAssemblerMacro - * in YL, TCNT0 - * sts timer0Snapshot, YL - * endm - * #endif - * #define USB_SOF_HOOK myAssemblerMacro - * This macro (if defined) is executed in the assembler module when a - * Start Of Frame condition is detected. It is recommended to define it to - * the name of an assembler macro which is defined here as well so that more - * than one assembler instruction can be used. The macro may use the register - * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages - * immediately after an SOF pulse may be lost and must be retried by the host. - * What can you do with this hook? Since the SOF signal occurs exactly every - * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in - * designs running on the internal RC oscillator. - * Please note that Start Of Frame detection works only if D- is wired to the - * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! - */ -#define USB_CFG_CHECK_DATA_TOGGLING 0 -/* define this macro to 1 if you want to filter out duplicate data packets - * sent by the host. Duplicates occur only as a consequence of communication - * errors, when the host does not receive an ACK. Please note that you need to - * implement the filtering yourself in usbFunctionWriteOut() and - * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable - * for each control- and out-endpoint to check for duplicate packets. - */ -#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 -/* define this macro to 1 if you want the function usbMeasureFrameLength() - * compiled in. This function can be used to calibrate the AVR's RC oscillator. - */ -#define USB_USE_FAST_CRC 0 -/* The assembler module has two implementations for the CRC algorithm. One is - * faster, the other is smaller. This CRC routine is only used for transmitted - * messages where timing is not critical. The faster routine needs 31 cycles - * per byte while the smaller one needs 61 to 69 cycles. The faster routine - * may be worth the 32 bytes bigger code size if you transmit lots of data and - * run the AVR close to its limit. - */ - -/* -------------------------- Device Description --------------------------- */ - -#define USB_CFG_VENDOR_ID -/* USB vendor ID for the device, low byte first. If you have registered your - * own Vendor ID, define it here. Otherwise you may use one of obdev's free - * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! - * *** IMPORTANT NOTE *** - * This template uses obdev's shared VID/PID pair for Vendor Class devices - * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand - * the implications! - */ -#define USB_CFG_DEVICE_ID -/* This is the ID of the product, low byte first. It is interpreted in the - * scope of the vendor ID. If you have registered your own VID with usb.org - * or if you have licensed a PID from somebody else, define it here. Otherwise - * you may use one of obdev's free shared VID/PID pairs. See the file - * USB-IDs-for-free.txt for details! - * *** IMPORTANT NOTE *** - * This template uses obdev's shared VID/PID pair for Vendor Class devices - * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand - * the implications! - */ -#define USB_CFG_DEVICE_CLASS 0 -#define USB_CFG_DEVICE_SUBCLASS 0 -/* See USB specification if you want to conform to an existing device class. - * Class 0xff is "vendor specific". - */ -#define USB_CFG_INTERFACE_CLASS 3 /* HID */ -#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ -#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ -/* See USB specification if you want to conform to an existing device class or - * protocol. The following classes must be set at interface level: - * HID class is 3, no subclass and protocol required (but may be useful!) - * CDC class is 2, use subclass 2 and protocol 1 for ACM - */ -#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 -/* Define this to the length of the HID report descriptor, if you implement - * an HID device. Otherwise don't define it or define it to 0. - * If you use this define, you must add a PROGMEM character array named - * "usbHidReportDescriptor" to your code which contains the report descriptor. - * Don't forget to keep the array and this define in sync! - */ - -/* #define USB_PUBLIC static */ -/* Use the define above if you #include usbdrv.c instead of linking against it. - * This technique saves a couple of bytes in flash memory. - */ - -/* ------------------- Fine Control over USB Descriptors ------------------- */ -/* If you don't want to use the driver's default USB descriptors, you can - * provide our own. These can be provided as (1) fixed length static data in - * flash memory, (2) fixed length static data in RAM or (3) dynamically at - * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more - * information about this function. - * Descriptor handling is configured through the descriptor's properties. If - * no properties are defined or if they are 0, the default descriptor is used. - * Possible properties are: - * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched - * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is - * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if - * you want RAM pointers. - * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found - * in static memory is in RAM, not in flash memory. - * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), - * the driver must know the descriptor's length. The descriptor itself is - * found at the address of a well known identifier (see below). - * List of static descriptor names (must be declared PROGMEM if in flash): - * char usbDescriptorDevice[]; - * char usbDescriptorConfiguration[]; - * char usbDescriptorHidReport[]; - * char usbDescriptorString0[]; - * int usbDescriptorStringVendor[]; - * int usbDescriptorStringDevice[]; - * int usbDescriptorStringSerialNumber[]; - * Other descriptors can't be provided statically, they must be provided - * dynamically at runtime. - * - * Descriptor properties are or-ed or added together, e.g.: - * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) - * - * The following descriptors are defined: - * USB_CFG_DESCR_PROPS_DEVICE - * USB_CFG_DESCR_PROPS_CONFIGURATION - * USB_CFG_DESCR_PROPS_STRINGS - * USB_CFG_DESCR_PROPS_STRING_0 - * USB_CFG_DESCR_PROPS_STRING_VENDOR - * USB_CFG_DESCR_PROPS_STRING_PRODUCT - * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER - * USB_CFG_DESCR_PROPS_HID - * USB_CFG_DESCR_PROPS_HID_REPORT - * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) - * - * Note about string descriptors: String descriptors are not just strings, they - * are Unicode strings prefixed with a 2 byte header. Example: - * int serialNumberDescriptor[] = { - * USB_STRING_DESCRIPTOR_HEADER(6), - * 'S', 'e', 'r', 'i', 'a', 'l' - * }; - */ - -#define USB_CFG_DESCR_PROPS_DEVICE USB_PROP_IS_DYNAMIC -#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC -#define USB_CFG_DESCR_PROPS_STRINGS USB_PROP_IS_DYNAMIC -#define USB_CFG_DESCR_PROPS_STRING_0 USB_PROP_IS_DYNAMIC -#define USB_CFG_DESCR_PROPS_STRING_VENDOR USB_PROP_IS_DYNAMIC -#define USB_CFG_DESCR_PROPS_STRING_PRODUCT USB_PROP_IS_DYNAMIC -#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER USB_PROP_IS_DYNAMIC -#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC -#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC -#define USB_CFG_DESCR_PROPS_UNKNOWN 0 - -#define usbMsgPtr_t unsigned short -/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to - * a scalar type here because gcc generates slightly shorter code for scalar - * arithmetics than for pointer arithmetics. Remove this define for backward - * type compatibility or define it to an 8 bit type if you use data in RAM only - * and all RAM is below 256 bytes (tiny memory model in IAR CC). - */ - -/* ----------------------- Optional MCU Description ------------------------ */ - -/* The following configurations have working defaults in usbdrv.h. You - * usually don't need to set them explicitly. Only if you want to run - * the driver on a device which is not yet supported or with a compiler - * which is not fully supported (such as IAR C) or if you use a differnt - * interrupt than INT0, you may have to define some of these. - */ -/* #define USB_INTR_CFG MCUCR */ -/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ -/* #define USB_INTR_CFG_CLR 0 */ -/* #define USB_INTR_ENABLE GIMSK */ -/* #define USB_INTR_ENABLE_BIT INT0 */ -/* #define USB_INTR_PENDING GIFR */ -/* #define USB_INTR_PENDING_BIT INTF0 */ -/* #define USB_INTR_VECTOR INT0_vect */ - -/* Set INT1 for D- falling edge to count SOF */ -/* #define USB_INTR_CFG EICRA */ -#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) -/* #define USB_INTR_CFG_CLR 0 */ -/* #define USB_INTR_ENABLE EIMSK */ -#define USB_INTR_ENABLE_BIT INT1 -/* #define USB_INTR_PENDING EIFR */ -#define USB_INTR_PENDING_BIT INTF1 -#define USB_INTR_VECTOR INT1_vect -- cgit v1.2.3 From be2f5816b6cf6513591f825df1d0438729b83388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Thu, 9 Apr 2020 01:18:30 +0200 Subject: Fix compile issues related to NO_ACTION_MACRO/FUNCTION and LTO_ENABLE (#8663) * Define NO_ACTION_MACRO/FUNCTION in header instead of makefile when LTO is enabled Currently, boards and keymaps that define NO_ACTION_MACRO/FUNCTION unconditionally will not compile with LTO_ENABLE (#8604). This fixes the issue by moving the definitions from common.mk to action.h, which enables us to check for previous definitions of those macros (this cannot be done in a makefile). * Remove LTO checks in templates Since now NO_ACTION_MACRO/FUNCTION are defined as needed in action.h (which is included by quantum.h), checking for LTO in keyboard and user code is no longer required. * Update LTO_ENABLE docs --- quantum/template/avr/config.h | 7 +++---- quantum/template/ps2avrgb/config.h | 6 ++---- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index 7e4a014495..88402fbdd0 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -192,10 +192,9 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT /* disable these deprecated features by default */ -#ifndef LINK_TIME_OPTIMIZATION_ENABLE - #define NO_ACTION_MACRO - #define NO_ACTION_FUNCTION -#endif +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + /* * MIDI options */ diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index 2eb4844226..3f3fd5fd76 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -43,10 +43,8 @@ along with this program. If not, see . #define RGBLIGHT_ANIMATIONS /* disable these deprecated features by default */ -#ifndef LINK_TIME_OPTIMIZATION_ENABLE - #define NO_ACTION_MACRO - #define NO_ACTION_FUNCTION -#endif +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION /* key combination for magic key command */ /* defined by default; to change, uncomment and set to the combination you want */ -- cgit v1.2.3 From ddd055b1e2fab07c411ce3b7bbd9f36b5210ba8f Mon Sep 17 00:00:00 2001 From: JohSchneider Date: Fri, 1 May 2020 20:30:12 +0000 Subject: Audio_Enable, AVR template update (#8901) * Branch point for 2020 May 30 Breaking Change * audio-configuration: template: audio_avr.c does NOT default to C6 not on its own, it needs a pin configured per define in config.h for audio to actually work otherwise only parts of the code are included in the firmware, wasting space and possibly breaking builds because auf hitting the firmware-size limits * audio-configuration: strip comment to bare essentials Co-Authored-By: Ryan * revert future change Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> Co-authored-by: Johannes Co-authored-by: Ryan Co-authored-by: zvecr --- quantum/template/avr/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/template') diff --git a/quantum/template/avr/rules.mk b/quantum/template/avr/rules.mk index 4053484219..2ea91a3013 100644 --- a/quantum/template/avr/rules.mk +++ b/quantum/template/avr/rules.mk @@ -27,6 +27,6 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow MIDI_ENABLE = no # MIDI support BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 +AUDIO_ENABLE = no # Audio output FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches HD44780_ENABLE = no # Enable support for HD44780 based LCDs -- cgit v1.2.3 From ce842f912e7b369ca3d83c65dd2135e23e87c153 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 18 May 2020 06:37:04 +1000 Subject: Remove `DEBUG_LEVEL` from V-USB rules.mk (#9117) --- quantum/template/ps2avrgb/rules.mk | 2 -- 1 file changed, 2 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/ps2avrgb/rules.mk b/quantum/template/ps2avrgb/rules.mk index b9b81a6750..9e18b33827 100644 --- a/quantum/template/ps2avrgb/rules.mk +++ b/quantum/template/ps2avrgb/rules.mk @@ -22,5 +22,3 @@ COMMAND_ENABLE = yes # Commands for debug and configuration BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow WS2812_DRIVER = i2c - -OPT_DEFS = -DDEBUG_LEVEL=0 -- cgit v1.2.3 From e8d577c081469608a9c203f97aece82d4253e99e Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 15 Jul 2020 18:52:02 +1000 Subject: Update new keyboard templates (#9636) * Update new keyboard templates * Switch on Bootmagic Lite by default * Remove MIDI_ENABLE and FAUXCLICKY_ENABLE --- quantum/template/avr/config.h | 186 ++++++------------------- quantum/template/avr/readme.md | 10 +- quantum/template/avr/rules.mk | 18 +-- quantum/template/base/info.json | 11 +- quantum/template/base/keyboard.c | 33 ----- quantum/template/base/keyboard.h | 3 +- quantum/template/base/keymaps/default/config.h | 19 --- quantum/template/base/keymaps/default/keymap.c | 14 -- quantum/template/ps2avrgb/config.h | 122 +++++++++++++--- quantum/template/ps2avrgb/readme.md | 6 +- quantum/template/ps2avrgb/rules.mk | 19 +-- 11 files changed, 172 insertions(+), 269 deletions(-) delete mode 100644 quantum/template/base/keymaps/default/config.h (limited to 'quantum/template') diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index 88402fbdd0..8b0961f24b 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -20,12 +20,12 @@ along with this program. If not, see . #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 #define MANUFACTURER %YOUR_NAME% -#define PRODUCT %KEYBOARD% -#define DESCRIPTION A custom keyboard +#define PRODUCT %KEYBOARD% +#define DESCRIPTION A custom keyboard /* key matrix size */ #define MATRIX_ROWS 2 @@ -45,7 +45,7 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F1, F0, B0 } #define UNUSED_PINS -/* COL2ROW, ROW2COL*/ +/* COL2ROW, ROW2COL */ #define DIODE_DIRECTION COL2ROW /* @@ -53,37 +53,37 @@ along with this program. If not, see . */ #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - -// #define RGB_DI_PIN E2 -// #ifdef RGB_DI_PIN -// #define RGBLED_NUM 16 -// #define RGBLIGHT_HUE_STEP 8 -// #define RGBLIGHT_SAT_STEP 8 -// #define RGBLIGHT_VAL_STEP 8 -// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ -// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ -// /*== all animations enable ==*/ -// #define RGBLIGHT_ANIMATIONS -// /*== or choose animations ==*/ -// #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 -// /*== customize breathing effect ==*/ -// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ -// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 -// /*==== use exp() and sin() ====*/ -// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 -// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 -// #endif +//#define BACKLIGHT_PIN B7 +//#define BACKLIGHT_LEVELS 3 +//#define BACKLIGHT_BREATHING + +//#define RGB_DI_PIN E2 +//#ifdef RGB_DI_PIN +//# define RGBLED_NUM 16 +//# define RGBLIGHT_HUE_STEP 8 +//# define RGBLIGHT_SAT_STEP 8 +//# define RGBLIGHT_VAL_STEP 8 +//# define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +//# define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +/*== all animations enable ==*/ +//# define RGBLIGHT_ANIMATIONS +/*== or choose animations ==*/ +//# 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 +/*== customize breathing effect ==*/ +/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +//# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +/*==== use exp() and sin() ====*/ +//# define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +//# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +//#endif /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 5 @@ -97,9 +97,9 @@ along with this program. If not, see . #define LOCKING_RESYNC_ENABLE /* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + * This is useful for the Windows task manager shortcut (ctrl+shift+esc). */ -// #define GRAVE_ESC_CTRL_OVERRIDE +//#define GRAVE_ESC_CTRL_OVERRIDE /* * Force NKRO @@ -122,59 +122,6 @@ along with this program. If not, see . */ //#define FORCE_NKRO -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -/* defined by default; to change, uncomment and set to the combination you want */ -// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP H -//#define MAGIC_KEY_HELP_ALT SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER0_ALT GRAVE -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER B -//#define MAGIC_KEY_BOOTLOADER_ALT ESC -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_EEPROM_CLEAR BSPACE -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - /* * Feature disable options * These options are also useful to firmware size reduction. @@ -195,57 +142,6 @@ along with this program. If not, see . #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -/* - * HD44780 LCD Display Configuration - */ -/* -#define LCD_LINES 2 //< number of visible lines of the display -#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display - -#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode - -#if LCD_IO_MODE -#define LCD_PORT PORTB //< port for the LCD lines -#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 -#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 -#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 -#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 -#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 -#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 -#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 -#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 -#define LCD_RS_PORT LCD_PORT //< port for RS line -#define LCD_RS_PIN 3 //< pin for RS line -#define LCD_RW_PORT LCD_PORT //< port for RW line -#define LCD_RW_PIN 2 //< pin for RW line -#define LCD_E_PORT LCD_PORT //< port for Enable line -#define LCD_E_PIN 1 //< pin for Enable line -#endif -*/ - /* Bootmagic Lite key configuration */ -// #define BOOTMAGIC_LITE_ROW 0 -// #define BOOTMAGIC_LITE_COLUMN 0 +//#define BOOTMAGIC_LITE_ROW 0 +//#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/quantum/template/avr/readme.md b/quantum/template/avr/readme.md index 0430dd0fc9..fd14558420 100644 --- a/quantum/template/avr/readme.md +++ b/quantum/template/avr/readme.md @@ -2,14 +2,18 @@ ![%KEYBOARD%](imgur.com image replace me!) -A short description of the keyboard/project +*A short description of the keyboard/project* * Keyboard Maintainer: [%YOUR_NAME%](https://github.com/yourusername) -* Hardware Supported: The PCBs, controllers supported -* Hardware Availability: Links to where you can find this hardware +* Hardware Supported: *The PCBs, controllers supported* +* Hardware Availability: *Links to where you can find this hardware* Make example for this keyboard (after setting up your build environment): make %KEYBOARD%:default +Flashing example for this keyboard: + + make %KEYBOARD%: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). diff --git a/quantum/template/avr/rules.mk b/quantum/template/avr/rules.mk index 2ea91a3013..5c0d8f307c 100644 --- a/quantum/template/avr/rules.mk +++ b/quantum/template/avr/rules.mk @@ -2,31 +2,21 @@ MCU = atmega32u4 # Bootloader selection -# Teensy halfkay -# Pro Micro caterina -# Atmel DFU atmel-dfu -# LUFA DFU lufa-dfu -# QMK DFU qmk-dfu -# ATmega32A bootloadHID -# ATmega328P USBasp BOOTLOADER = atmel-dfu # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE = no # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow -MIDI_ENABLE = no # MIDI support -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +BLUETOOTH_ENABLE = no # Enable Bluetooth AUDIO_ENABLE = no # Audio output -FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches -HD44780_ENABLE = no # Enable support for HD44780 based LCDs diff --git a/quantum/template/base/info.json b/quantum/template/base/info.json index b8e8f1f2db..af14d87996 100644 --- a/quantum/template/base/info.json +++ b/quantum/template/base/info.json @@ -7,11 +7,12 @@ "layouts": { "LAYOUT": { "layout": [ - {"label":"k00", "x":0, "y":0}, - {"label":"k01", "x":1, "y":0}, - {"label":"k02", "x":2, "y":0}, - {"label":"k10", "x":0, "y":1, "w":1.5}, - {"label":"k12", "x":1.5, "y":1, "w":1.5} + {"label": "k00", "x": 0, "y": 0}, + {"label": "k01", "x": 1, "y": 0}, + {"label": "k02", "x": 2, "y": 0}, + + {"label": "k10", "x": 0, "y": 1, "w": 1.5}, + {"label": "k12", "x": 1.5, "y": 1, "w": 1.5} ] } } diff --git a/quantum/template/base/keyboard.c b/quantum/template/base/keyboard.c index fc31c294a2..f69ae16ede 100644 --- a/quantum/template/base/keyboard.c +++ b/quantum/template/base/keyboard.c @@ -15,36 +15,3 @@ */ #include "%KEYBOARD%.h" - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - -/* -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -bool led_update_kb(led_t led_state) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - return led_update_user(led_state); -} -*/ diff --git a/quantum/template/base/keyboard.h b/quantum/template/base/keyboard.h index 8a21d92578..bd2e88d12b 100644 --- a/quantum/template/base/keyboard.h +++ b/quantum/template/base/keyboard.h @@ -29,8 +29,7 @@ #define LAYOUT( \ k00, k01, k02, \ k10, k12 \ -) \ -{ \ +) { \ { k00, k01, k02 }, \ { k10, KC_NO, k12 } \ } diff --git a/quantum/template/base/keymaps/default/config.h b/quantum/template/base/keymaps/default/config.h deleted file mode 100644 index 5b00c8956f..0000000000 --- a/quantum/template/base/keymaps/default/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright %YEAR% %YOUR_NAME% - * - * 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 . - */ - -#pragma once - -// place overrides here diff --git a/quantum/template/base/keymaps/default/keymap.c b/quantum/template/base/keymaps/default/keymap.c index af35ccec15..d8020ab3e3 100644 --- a/quantum/template/base/keymaps/default/keymap.c +++ b/quantum/template/base/keymaps/default/keymap.c @@ -60,17 +60,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return true; } - -/* -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool led_update_user(led_t led_state) { - return true; -} -*/ diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index 3f3fd5fd76..126afbcbd7 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -19,37 +19,121 @@ along with this program. If not, see . #include "config_common.h" -#define VENDOR_ID 0x20A0 -#define PRODUCT_ID 0x422D -#define DEVICE_VER 0x0001 +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 #define MANUFACTURER %YOUR_NAME% -#define PRODUCT %KEYBOARD% -#define DESCRIPTION A custom keyboard - -#define RGBLED_NUM 16 +#define PRODUCT %KEYBOARD% +#define DESCRIPTION A custom keyboard +/* key matrix size */ #define MATRIX_ROWS 8 -#define MATRIX_COLS 11 +#define MATRIX_COLS 15 +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ #define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } -#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5 } -// #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, C1, C0, D7 } -#define UNUSED_PINS {} +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } +#define UNUSED_PINS +/* COL2ROW, ROW2COL */ #define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN D4 +#define BACKLIGHT_LEVELS 3 +//#define BACKLIGHT_BREATHING + +#define RGBLED_NUM 16 +//#define RGBLIGHT_HUE_STEP 8 +//#define RGBLIGHT_SAT_STEP 8 +//#define RGBLIGHT_VAL_STEP 8 +//#define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +//#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +/*== all animations enable ==*/ +//#define RGBLIGHT_ANIMATIONS +/*== or choose animations ==*/ +//#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 +/*== customize breathing effect ==*/ +/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +//#define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +/*==== use exp() and sin() ====*/ +//#define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +//#define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 5 -#define BACKLIGHT_LEVELS 1 -#define RGBLIGHT_ANIMATIONS +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is useful for the Windows task manager shortcut (ctrl+shift+esc). + */ +//#define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT /* disable these deprecated features by default */ #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -/* key combination for magic key command */ -/* defined by default; to change, uncomment and set to the combination you want */ -// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT) - /* Bootmagic Lite key configuration */ -// #define BOOTMAGIC_LITE_ROW 0 -// #define BOOTMAGIC_LITE_COLUMN 0 +//#define BOOTMAGIC_LITE_ROW 0 +//#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/quantum/template/ps2avrgb/readme.md b/quantum/template/ps2avrgb/readme.md index b45ef91c9d..f19743a163 100644 --- a/quantum/template/ps2avrgb/readme.md +++ b/quantum/template/ps2avrgb/readme.md @@ -2,11 +2,11 @@ ![%KEYBOARD%](imgur.com image replace me!) -A short description of the keyboard/project +*A short description of the keyboard/project* * Keyboard Maintainer: [%YOUR_NAME%](https://github.com/yourusername) -* Hardware Supported: The PCBs, controllers supported -* Hardware Availability: links to where you can find this hardware +* Hardware Supported: *The PCBs, controllers supported* +* Hardware Availability: *Links to where you can find this hardware* Make example for this keyboard (after setting up your build environment): diff --git a/quantum/template/ps2avrgb/rules.mk b/quantum/template/ps2avrgb/rules.mk index 9e18b33827..1b61e9534d 100644 --- a/quantum/template/ps2avrgb/rules.mk +++ b/quantum/template/ps2avrgb/rules.mk @@ -2,23 +2,18 @@ MCU = atmega32a # Bootloader selection -# Teensy halfkay -# Pro Micro caterina -# Atmel DFU atmel-dfu -# LUFA DFU lufa-dfu -# QMK DFU qmk-dfu -# ATmega32A bootloadHID -# ATmega328P USBasp BOOTLOADER = bootloadHID # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration -MOUSEKEY_ENABLE = no # Mouse keys +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow WS2812_DRIVER = i2c -- cgit v1.2.3 From 72d327054744fa142469dbb5406ad61f5ad0a302 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 16 Jul 2020 15:49:18 +1000 Subject: Remove `DESCRIPTION` (#9732) --- quantum/template/avr/config.h | 1 - quantum/template/ps2avrgb/config.h | 1 - 2 files changed, 2 deletions(-) (limited to 'quantum/template') diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index 8b0961f24b..5f0bc73633 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -25,7 +25,6 @@ along with this program. If not, see . #define DEVICE_VER 0x0001 #define MANUFACTURER %YOUR_NAME% #define PRODUCT %KEYBOARD% -#define DESCRIPTION A custom keyboard /* key matrix size */ #define MATRIX_ROWS 2 diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index 126afbcbd7..ef065c0f10 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -25,7 +25,6 @@ along with this program. If not, see . #define DEVICE_VER 0x0001 #define MANUFACTURER %YOUR_NAME% #define PRODUCT %KEYBOARD% -#define DESCRIPTION A custom keyboard /* key matrix size */ #define MATRIX_ROWS 8 -- cgit v1.2.3 From 94e94ffb5bbe61b5da4aad205016923746010b23 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Mon, 16 Nov 2020 03:16:42 +0000 Subject: Recommend use of LED Indicator config (#10895) * Recommend use of LED Indicator config * Recommend use of LED Indicator config - update link * Update quantum/template/ps2avrgb/config.h Co-authored-by: Ryan Co-authored-by: Ryan --- quantum/template/avr/config.h | 6 ++++++ quantum/template/ps2avrgb/config.h | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'quantum/template') diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index 5f0bc73633..4192bbcfa2 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -52,6 +52,12 @@ along with this program. If not, see . */ #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 +//#define LED_NUM_LOCK_PIN B0 +//#define LED_CAPS_LOCK_PIN B1 +//#define LED_SCROLL_LOCK_PIN B2 +//#define LED_COMPOSE_PIN B3 +//#define LED_KANA_PIN B4 + //#define BACKLIGHT_PIN B7 //#define BACKLIGHT_LEVELS 3 //#define BACKLIGHT_BREATHING diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index ef065c0f10..6150bcce6d 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -47,8 +47,12 @@ along with this program. If not, see . /* COL2ROW, ROW2COL */ #define DIODE_DIRECTION COL2ROW +//#define LED_NUM_LOCK_PIN D0 +//#define LED_CAPS_LOCK_PIN D1 +//#define LED_SCROLL_LOCK_PIN D6 + #define BACKLIGHT_PIN D4 -#define BACKLIGHT_LEVELS 3 +//#define BACKLIGHT_LEVELS 3 //#define BACKLIGHT_BREATHING #define RGBLED_NUM 16 -- cgit v1.2.3