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/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 ++++++++++++++++++++++-- 6 files changed, 80 insertions(+), 259 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/ps2avrgb') 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/ps2avrgb') 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 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/ps2avrgb') 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/ps2avrgb/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/template/ps2avrgb') 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/ps2avrgb/config.h | 2 +- quantum/template/ps2avrgb/rules.mk | 15 --------------- quantum/template/ps2avrgb/template.c | 2 +- quantum/template/ps2avrgb/usbconfig.h | 10 ---------- 4 files changed, 2 insertions(+), 27 deletions(-) (limited to 'quantum/template/ps2avrgb') 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 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/ps2avrgb/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/template/ps2avrgb') 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/ps2avrgb') 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/ps2avrgb/rules.mk | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'quantum/template/ps2avrgb') 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 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/ps2avrgb') 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/ps2avrgb/config.h | 21 ++++---- quantum/template/ps2avrgb/template.c | 36 ++++++------- quantum/template/ps2avrgb/usbconfig.h | 96 +++++++++++++++++------------------ 3 files changed, 78 insertions(+), 75 deletions(-) (limited to 'quantum/template/ps2avrgb') 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/ps2avrgb/rules.mk | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'quantum/template/ps2avrgb') 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/ps2avrgb/config.h | 11 ++--- quantum/template/ps2avrgb/keyboard.c | 90 ++++++++++++++++++++++++++++++++++++ quantum/template/ps2avrgb/template.c | 90 ------------------------------------ 3 files changed, 94 insertions(+), 97 deletions(-) create mode 100644 quantum/template/ps2avrgb/keyboard.c delete mode 100644 quantum/template/ps2avrgb/template.c (limited to 'quantum/template/ps2avrgb') 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/ps2avrgb') 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 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/ps2avrgb') 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/ps2avrgb/keyboard.c | 52 ------------------------------------ quantum/template/ps2avrgb/readme.md | 6 ++--- quantum/template/ps2avrgb/rules.mk | 18 +++++++------ 3 files changed, 13 insertions(+), 63 deletions(-) delete mode 100644 quantum/template/ps2avrgb/keyboard.c (limited to 'quantum/template/ps2avrgb') 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 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/ps2avrgb/config.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'quantum/template/ps2avrgb') 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/ps2avrgb') 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/ps2avrgb') 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/ps2avrgb') 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 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/ps2avrgb') 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 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/ps2avrgb') 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/ps2avrgb') 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/ps2avrgb/config.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'quantum/template/ps2avrgb') 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 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/ps2avrgb') 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/ps2avrgb/config.h | 122 ++++++++++++++++++++++++++++++------ quantum/template/ps2avrgb/readme.md | 6 +- quantum/template/ps2avrgb/rules.mk | 19 +++--- 3 files changed, 113 insertions(+), 34 deletions(-) (limited to 'quantum/template/ps2avrgb') 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/ps2avrgb/config.h | 1 - 1 file changed, 1 deletion(-) (limited to 'quantum/template/ps2avrgb') 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/ps2avrgb/config.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'quantum/template/ps2avrgb') 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