From 62868e67d4c275375fb32b11afcf6b45fefce34c Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 1 Sep 2021 19:03:14 +1000 Subject: [PATCH] Change keyboard level include guards to `pragma once` (#14248) * Change keyboard level include guards to `pragma once` And clean up a lot of layout macros * Oops * Remove dangling endif --- keyboards/capsunlocked/cu75/cu75.h | 2 +- keyboards/converter/ibm_terminal/config.h | 33 +++++++-- keyboards/gskt00/gskt00.h | 56 ++++++++++++++ keyboards/hadron/i2c.h | 46 ++++++++++++ keyboards/hadron/ver2/ver2.h | 2 +- keyboards/kapcave/paladin64/config.h | 46 +++++------- keyboards/kinesis/kinesis.h | 2 +- keyboards/knops/mini/mini.h | 2 +- keyboards/laptreus/laptreus.h | 19 +++++ keyboards/mt/mt40/mt40.h | 2 +- keyboards/paladin64/paladin64.h | 90 +++++++++++++++++++++++ keyboards/planck/light/config.h | 66 ++--------------- keyboards/xelus/xs60/halconf.h | 22 ------ 13 files changed, 270 insertions(+), 118 deletions(-) create mode 100755 keyboards/gskt00/gskt00.h create mode 100644 keyboards/hadron/i2c.h create mode 100644 keyboards/laptreus/laptreus.h create mode 100755 keyboards/paladin64/paladin64.h delete mode 100644 keyboards/xelus/xs60/halconf.h diff --git a/keyboards/capsunlocked/cu75/cu75.h b/keyboards/capsunlocked/cu75/cu75.h index 11a01b8b7ed2..909b7527b641 100644 --- a/keyboards/capsunlocked/cu75/cu75.h +++ b/keyboards/capsunlocked/cu75/cu75.h @@ -85,7 +85,7 @@ void click(uint16_t freq, uint16_t duration); k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, \ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3E, \ k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, \ - k50, k51, k52, k53, k56, k58, k59, k5A, k5B, k5C, k5D, k5E \ + k50, k51, k52, k53, k56, k59, k59, k5A, k5B, k5C, k5D, k5E \ ) { \ { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F }, \ { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, XXX, k1F }, \ diff --git a/keyboards/converter/ibm_terminal/config.h b/keyboards/converter/ibm_terminal/config.h index 2cd36c5fb0ae..6895f08e7ae9 100644 --- a/keyboards/converter/ibm_terminal/config.h +++ b/keyboards/converter/ibm_terminal/config.h @@ -45,8 +45,15 @@ along with this program. If not, see . */ #ifdef PS2_USE_USART /* XCK for clock line */ -#define PS2_CLOCK_PIN D5 -#define PS2_DATA_PIN D2 +#define PS2_CLOCK_PORT PORTD +#define PS2_CLOCK_PIN PIND +#define PS2_CLOCK_DDR DDRD +#define PS2_CLOCK_BIT 5 +/* RXD for data line */ +#define PS2_DATA_PORT PORTD +#define PS2_DATA_PIN PIND +#define PS2_DATA_DDR DDRD +#define PS2_DATA_BIT 2 /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */ /* set DDR of CLOCK as input to be slave */ @@ -86,8 +93,15 @@ along with this program. If not, see . */ #ifdef PS2_USE_INT /* uses INT1 for clock line(ATMega32U4) */ -#define PS2_CLOCK_PIN D1 -#define PS2_DATA_PIN D0 +#define PS2_CLOCK_PORT PORTD +#define PS2_CLOCK_PIN PIND +#define PS2_CLOCK_DDR DDRD +#define PS2_CLOCK_BIT 1 + +#define PS2_DATA_PORT PORTD +#define PS2_DATA_PIN PIND +#define PS2_DATA_DDR DDRD +#define PS2_DATA_BIT 0 #define PS2_INT_INIT() do { \ EICRA |= ((1<. * PS/2 Busywait configuration */ #ifdef PS2_USE_BUSYWAIT -#define PS2_CLOCK_PIN D1 -#define PS2_DATA_PIN D0 +#define PS2_CLOCK_PORT PORTD +#define PS2_CLOCK_PIN PIND +#define PS2_CLOCK_DDR DDRD +#define PS2_CLOCK_BIT 1 + +#define PS2_DATA_PORT PORTD +#define PS2_DATA_PIN PIND +#define PS2_DATA_DDR DDRD +#define PS2_DATA_BIT 0 #endif diff --git a/keyboards/gskt00/gskt00.h b/keyboards/gskt00/gskt00.h new file mode 100755 index 000000000000..151155d7f7d7 --- /dev/null +++ b/keyboards/gskt00/gskt00.h @@ -0,0 +1,56 @@ +#pragma once + +#include "quantum.h" + +#define XXX KC_NO + +#define LAYOUT_all( \ + k36, k37, k46, k47, k56, k57, k66, k67, k76, k77, k06, k07, k17, k26, k27, \ + k34, k35, k44, k45, k54, k55, k64, k65, k75, k05, k15, k16, k25, k24, \ + k32, k33, k43, k52, k53, k63, k73, k74, k03, k04, k13, k14, k23, \ + k31, k41, k42, k51, k61, k62, k71, k72, k01, k02, k11, k12, k21, k22, \ + k30, k40, k50, k60, k00, k10, k20 \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07 }, \ + { k10, k11, k12, k13, k14, k15, k16, k17 }, \ + { k20, k21, k22, k23, k24, k25, k26, k27 }, \ + { k30, k31, k32, k33, k34, k35, k36, k37 }, \ + { k40, k41, k42, k43, k44, k45, k46, k47 }, \ + { k50, k51, k52, k53, k54, k55, k56, k57 }, \ + { k60, k61, k62, k63, k64, k65, k66, k67 }, \ + { XXX, k71, k72, k73, k74, k75, k76, k77 } \ +} + +#define LAYOUT_60_iso_tsangan( \ + k36, k37, k46, k47, k56, k57, k66, k67, k76, k77, k06, k07, k17, k27, \ + k34, k35, k44, k45, k54, k55, k64, k65, k75, k05, k15, k16, k25, \ + k32, k33, k43, k52, k53, k63, k73, k74, k03, k04, k13, k14, k24, k23, \ + k31, k41, k42, k51, k61, k62, k71, k72, k01, k02, k11, k12, k21, \ + k30, k40, k50, k60, k00, k10, k20 \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07 }, \ + { XXX, k11, k12, k13, k14, k15, k16, k17 }, \ + { k20, k21, XXX, k23, k24, k25, XXX, k27 }, \ + { k30, k31, k32, k33, k34, k35, k36, k37 }, \ + { k40, k41, k42, k43, k44, k45, k46, k47 }, \ + { k50, k51, k52, k53, k54, k55, k56, k57 }, \ + { k60, k61, k62, k63, k64, k65, k66, k67 }, \ + { XXX, k71, k72, k73, k74, k75, k76, k77 } \ +} + +#define LAYOUT_60_ansi_tsangan( \ + k36, k37, k46, k47, k56, k57, k66, k67, k76, k77, k06, k07, k17, k27, \ + k34, k35, k44, k45, k54, k55, k64, k65, k75, k05, k15, k16, k25, k24, \ + k32, k33, k43, k52, k53, k63, k73, k74, k03, k04, k13, k14, k23, \ + k31, k42, k51, k61, k62, k71, k72, k01, k02, k11, k12, k21, \ + k30, k40, k50, k60, k00, k10, k20 \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07 }, \ + { k10, k11, k12, k13, k14, k15, k16, k17 }, \ + { k20, k21, XXX, k23, k24, k25, XXX, k27 }, \ + { k30, k31, k32, k33, k34, k35, k36, k37 }, \ + { k40, XXX, k42, k43, k44, k45, k46, k47 }, \ + { k50, k51, k52, k53, k54, k55, k56, k57 }, \ + { k60, k61, k62, k63, k64, k65, k66, k67 }, \ + { XXX, k71, k72, k73, k74, k75, k76, k77 } \ +} diff --git a/keyboards/hadron/i2c.h b/keyboards/hadron/i2c.h new file mode 100644 index 000000000000..7ecf6eb2785f --- /dev/null +++ b/keyboards/hadron/i2c.h @@ -0,0 +1,46 @@ +#pragma once + +#include + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +#define I2C_READ 1 +#define I2C_WRITE 0 + +#define I2C_ACK 1 +#define I2C_NACK 0 + +#define SLAVE_BUFFER_SIZE 0x10 + +// i2c SCL clock frequency +#define SCL_CLOCK 800000L + +extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +void i2c_master_init(void); +uint8_t i2c_master_start(uint8_t address); +void i2c_master_stop(void); +uint8_t i2c_master_write(uint8_t data); +uint8_t i2c_master_read(int); +void i2c_reset_state(void); +void i2c_slave_init(uint8_t address); + + +static inline unsigned char i2c_start_read(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_READ); +} + +static inline unsigned char i2c_start_write(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_WRITE); +} + +// from SSD1306 scrips +extern unsigned char i2c_rep_start(unsigned char addr); +extern void i2c_start_wait(unsigned char addr); +extern unsigned char i2c_readAck(void); +extern unsigned char i2c_readNak(void); +extern unsigned char i2c_read(unsigned char ack); + +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); diff --git a/keyboards/hadron/ver2/ver2.h b/keyboards/hadron/ver2/ver2.h index 8127b497f7c5..e7577d268471 100644 --- a/keyboards/hadron/ver2/ver2.h +++ b/keyboards/hadron/ver2/ver2.h @@ -1,3 +1,3 @@ #pragma once -#include "hadron.h" +#include "../hadron.h" diff --git a/keyboards/kapcave/paladin64/config.h b/keyboards/kapcave/paladin64/config.h index 7c3d1a0fa111..10e4901a66fb 100755 --- a/keyboards/kapcave/paladin64/config.h +++ b/keyboards/kapcave/paladin64/config.h @@ -1,41 +1,27 @@ -/* -Copyright 2021 KapCave - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ #pragma once #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0x4B43 -#define PRODUCT_ID 0x5036 +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 #define DEVICE_VER 0x0001 -#define MANUFACTURER KapCave +#define MANUFACTURER inachie #define PRODUCT paladin64 /* key matrix size */ #define MATRIX_ROWS 8 #define MATRIX_COLS 8 -#define BOOTMAGIC_LITE_ROW 3 -#define BOOTMAGIC_LITE_COLUMN 6 - -/* Only required if you add in a trackpoint hardware to the pcb */ #ifdef PS2_USE_USART -#define PS2_CLOCK_PIN D5 -#define PS2_DATA_PIN D2 + #define PS2_CLOCK_PORT PORTD + #define PS2_CLOCK_PIN PIND + #define PS2_CLOCK_DDR DDRD + #define PS2_CLOCK_BIT 5 + #define PS2_DATA_PORT PORTD + #define PS2_DATA_PIN PIND + #define PS2_DATA_DDR DDRD + #define PS2_DATA_BIT 2 /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling * edge */ @@ -71,8 +57,14 @@ along with this program. If not, see . #endif #ifdef PS2_USE_INT -#define PS2_CLOCK_PIN D2 -#define PS2_DATA_PIN D5 +#define PS2_CLOCK_PORT PORTD +#define PS2_CLOCK_PIN PIND +#define PS2_CLOCK_DDR DDRD +#define PS2_CLOCK_BIT 2 +#define PS2_DATA_PORT PORTD +#define PS2_DATA_PIN PIND +#define PS2_DATA_DDR DDRD +#define PS2_DATA_BIT 5 #define PS2_INT_INIT() do { \ EICRA |= ((1< VCC // 0b1110101 AD <-> SCL // 0b1110110 AD <-> SDA -#define DRIVER_ADDR_1 0b1110100 -#define DRIVER_ADDR_2 0b1110110 +#define DRIVER_ADDR_1 0b1110100 +#define DRIVER_ADDR_2 0b1110110 -#define DRIVER_COUNT 2 +#define DRIVER_COUNT 2 #define DRIVER_1_LED_TOTAL 25 #define DRIVER_2_LED_TOTAL 24 -#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) -// RGB Matrix Animation modes. Explicitly enabled -// For full list of effects, see: -// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects -#define ENABLE_RGB_MATRIX_ALPHAS_MODS -#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN -#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT -#define ENABLE_RGB_MATRIX_BREATHING -#define ENABLE_RGB_MATRIX_BAND_SAT -#define ENABLE_RGB_MATRIX_BAND_VAL -#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL -#define ENABLE_RGB_MATRIX_CYCLE_ALL -#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN -#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL -#define ENABLE_RGB_MATRIX_DUAL_BEACON -#define ENABLE_RGB_MATRIX_RAINBOW_BEACON -#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -#define ENABLE_RGB_MATRIX_RAINDROPS -#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -#define ENABLE_RGB_MATRIX_HUE_BREATHING -#define ENABLE_RGB_MATRIX_HUE_PENDULUM -#define ENABLE_RGB_MATRIX_HUE_WAVE -#define ENABLE_RGB_MATRIX_PIXEL_RAIN -#define ENABLE_RGB_MATRIX_PIXEL_FLOW -#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL -// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined -#define ENABLE_RGB_MATRIX_TYPING_HEATMAP -#define ENABLE_RGB_MATRIX_DIGITAL_RAIN -// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -#define ENABLE_RGB_MATRIX_SPLASH -#define ENABLE_RGB_MATRIX_MULTISPLASH -#define ENABLE_RGB_MATRIX_SOLID_SPLASH -#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) diff --git a/keyboards/xelus/xs60/halconf.h b/keyboards/xelus/xs60/halconf.h deleted file mode 100644 index 73481c72a6b6..000000000000 --- a/keyboards/xelus/xs60/halconf.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright 2021 Harrison Chan (Xelus) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#define HAL_USE_I2C TRUE - -#include_next -