mirror of
https://github.com/firewalkwithm3/qmk_firmware.git
synced 2024-11-22 19:40:29 +08:00
Remove more cruft in keyboard files (#14288)
This commit is contained in:
parent
a01057d19d
commit
8574bf20d3
|
@ -28,12 +28,12 @@ void matrix_init_kb(void)
|
||||||
audio_init();
|
audio_init();
|
||||||
PLAY_SONG(test_sound);
|
PLAY_SONG(test_sound);
|
||||||
// Fix port B5
|
// Fix port B5
|
||||||
cbi(DDRB, 5);
|
setPinInput(B5);
|
||||||
sbi(PORTB, 5);
|
writePinHigh(B5);
|
||||||
#else
|
#else
|
||||||
// If we're not using the audio pin, drive it low
|
// If we're not using the audio pin, drive it low
|
||||||
sbi(DDRC, 6);
|
setPinOutput(C6);
|
||||||
cbi(PORTC, 6);
|
writePinLow(C6);
|
||||||
#endif
|
#endif
|
||||||
#ifdef ISSI_ENABLE
|
#ifdef ISSI_ENABLE
|
||||||
issi_init();
|
issi_init();
|
||||||
|
|
|
@ -1,26 +1,10 @@
|
||||||
#ifndef CU75_H
|
#ifndef CU75_H
|
||||||
#define CU75_H
|
#define CU75_H
|
||||||
|
|
||||||
/* if the kb.h file exists (because we're running from qmkbuilder) include it */
|
|
||||||
#ifdef __has_include
|
|
||||||
#if __has_include("kb.h")
|
|
||||||
#include "kb.h"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include <avr/sfr_defs.h>
|
#include <avr/sfr_defs.h>
|
||||||
|
|
||||||
#ifndef cbi
|
|
||||||
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef sbi
|
|
||||||
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct RGB_Color {
|
typedef struct RGB_Color {
|
||||||
uint16_t red;
|
uint16_t red;
|
||||||
uint16_t green;
|
uint16_t green;
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
|
|
||||||
extern i2c_status_t mcp23018_status;
|
extern i2c_status_t mcp23018_status;
|
||||||
#define ERGODOX_EZ_I2C_TIMEOUT 1000
|
#define ERGODOX_EZ_I2C_TIMEOUT 1000
|
||||||
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
|
|
||||||
#define CPU_16MHz 0x00
|
|
||||||
|
|
||||||
// I2C aliases and register addresses (see "mcp23018.md")
|
// I2C aliases and register addresses (see "mcp23018.md")
|
||||||
//#define I2C_ADDR 0b0100000
|
//#define I2C_ADDR 0b0100000
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
|
|
||||||
extern i2c_status_t mcp23018_status;
|
extern i2c_status_t mcp23018_status;
|
||||||
#define ERGODOX_EZ_I2C_TIMEOUT 1000
|
#define ERGODOX_EZ_I2C_TIMEOUT 1000
|
||||||
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
|
|
||||||
#define CPU_16MHz 0x00
|
|
||||||
|
|
||||||
// I2C aliases and register addresses (see "mcp23018.md")
|
// I2C aliases and register addresses (see "mcp23018.md")
|
||||||
//#define I2C_ADDR 0b0100000
|
//#define I2C_ADDR 0b0100000
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
|
|
||||||
extern i2c_status_t mcp23018_status;
|
extern i2c_status_t mcp23018_status;
|
||||||
#define I2C_TIMEOUT 1000
|
#define I2C_TIMEOUT 1000
|
||||||
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
|
|
||||||
#define CPU_16MHz 0x00
|
|
||||||
|
|
||||||
// I2C aliases and register addresses (see "mcp23018.md")
|
// I2C aliases and register addresses (see "mcp23018.md")
|
||||||
//#define I2C_ADDR 0b0100000
|
//#define I2C_ADDR 0b0100000
|
||||||
|
|
|
@ -7,9 +7,6 @@
|
||||||
#include "i2cmaster.h"
|
#include "i2cmaster.h"
|
||||||
#include <util/delay.h>
|
#include <util/delay.h>
|
||||||
|
|
||||||
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
|
|
||||||
#define CPU_16MHz 0x00
|
|
||||||
|
|
||||||
#define I2C_ADDR 0b0100000
|
#define I2C_ADDR 0b0100000
|
||||||
#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE )
|
#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE )
|
||||||
#define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ )
|
#define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ )
|
||||||
|
|
|
@ -6,9 +6,6 @@
|
||||||
#include "i2c_master.h"
|
#include "i2c_master.h"
|
||||||
#include <util/delay.h>
|
#include <util/delay.h>
|
||||||
|
|
||||||
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
|
|
||||||
#define CPU_16MHz 0x00
|
|
||||||
|
|
||||||
// I2C aliases and register addresses (see "mcp23018.md" on tmk repository)
|
// I2C aliases and register addresses (see "mcp23018.md" on tmk repository)
|
||||||
#define I2C_ADDR 0b0100000
|
#define I2C_ADDR 0b0100000
|
||||||
#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE )
|
#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE )
|
||||||
|
|
|
@ -4,9 +4,6 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
|
|
||||||
#define CPU_16MHz 0x00
|
|
||||||
|
|
||||||
void init_ergodox(void);
|
void init_ergodox(void);
|
||||||
|
|
||||||
inline void ergodox_board_led_on(void) { DDRB |= (1<<PB7); PORTB |= (1<<PB7); }
|
inline void ergodox_board_led_on(void) { DDRB |= (1<<PB7); PORTB |= (1<<PB7); }
|
||||||
|
|
|
@ -5,9 +5,6 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
|
|
||||||
#define CPU_16MHz 0x00
|
|
||||||
|
|
||||||
void init_ergodox(void);
|
void init_ergodox(void);
|
||||||
|
|
||||||
inline void ergodox_right_led_1_off(void) { DDRB &= ~(1<<PB5); PORTB &= ~(1<<PB5); }
|
inline void ergodox_right_led_1_off(void) { DDRB &= ~(1<<PB5); PORTB &= ~(1<<PB5); }
|
||||||
|
|
|
@ -1,26 +1,11 @@
|
||||||
#ifndef LFK65_HS_H
|
#ifndef LFK65_HS_H
|
||||||
#define LFK65_HS_H
|
#define LFK65_HS_H
|
||||||
|
|
||||||
/* if the kb.h file exists (because we're running from qmkbuilder) include it */
|
|
||||||
#ifdef __has_include
|
|
||||||
#if __has_include("kb.h")
|
|
||||||
#include "kb.h"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include <avr/sfr_defs.h>
|
#include <avr/sfr_defs.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#ifndef cbi
|
|
||||||
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef sbi
|
|
||||||
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void reset_keyboard_kb(void);
|
void reset_keyboard_kb(void);
|
||||||
|
|
||||||
// readability
|
// readability
|
||||||
|
|
|
@ -32,8 +32,8 @@ void matrix_init_kb(void)
|
||||||
set_rgb(32, 0xFF, 0x00, 0x00); // Layer indicator, start red
|
set_rgb(32, 0xFF, 0x00, 0x00); // Layer indicator, start red
|
||||||
#ifndef AUDIO_ENABLE
|
#ifndef AUDIO_ENABLE
|
||||||
// If we're not using the audio pin, drive it low
|
// If we're not using the audio pin, drive it low
|
||||||
sbi(DDRC, 6);
|
setPinOutput(C6);
|
||||||
cbi(PORTC, 6);
|
writePinLow(C6);
|
||||||
#endif
|
#endif
|
||||||
#ifdef ISSI_ENABLE
|
#ifdef ISSI_ENABLE
|
||||||
issi_init();
|
issi_init();
|
||||||
|
|
|
@ -1,24 +1,10 @@
|
||||||
#ifndef LFK87_H
|
#ifndef LFK87_H
|
||||||
#define LFK87_H
|
#define LFK87_H
|
||||||
|
|
||||||
/* if the kb.h file exists (because we're running from qmkbuilder) include it */
|
|
||||||
#if __has_include("kb.h")
|
|
||||||
#include "kb.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include <avr/sfr_defs.h>
|
#include <avr/sfr_defs.h>
|
||||||
|
|
||||||
#ifndef cbi
|
|
||||||
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef sbi
|
|
||||||
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct RGB_Color {
|
typedef struct RGB_Color {
|
||||||
uint16_t red;
|
uint16_t red;
|
||||||
uint16_t green;
|
uint16_t green;
|
||||||
|
|
|
@ -37,8 +37,8 @@ void matrix_init_kb(void)
|
||||||
set_rgb(32, 0xFF, 0x00, 0x00); // Layer indicator, start red
|
set_rgb(32, 0xFF, 0x00, 0x00); // Layer indicator, start red
|
||||||
#ifndef AUDIO_ENABLE
|
#ifndef AUDIO_ENABLE
|
||||||
// If we're not using the audio pin, drive it low
|
// If we're not using the audio pin, drive it low
|
||||||
sbi(DDRC, 6);
|
setPinOutput(C6);
|
||||||
cbi(PORTC, 6);
|
writePinLow(C6);
|
||||||
#endif
|
#endif
|
||||||
_delay_ms(500);
|
_delay_ms(500);
|
||||||
#ifdef ISSI_ENABLE
|
#ifdef ISSI_ENABLE
|
||||||
|
|
|
@ -1,24 +1,10 @@
|
||||||
#ifndef LFK87_H
|
#ifndef LFK87_H
|
||||||
#define LFK87_H
|
#define LFK87_H
|
||||||
|
|
||||||
/* if the kb.h file exists (because we're running from qmkbuilder) include it */
|
|
||||||
#if __has_include("kb.h")
|
|
||||||
#include "kb.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include <avr/sfr_defs.h>
|
#include <avr/sfr_defs.h>
|
||||||
|
|
||||||
#ifndef cbi
|
|
||||||
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef sbi
|
|
||||||
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct RGB_Color {
|
typedef struct RGB_Color {
|
||||||
uint16_t red;
|
uint16_t red;
|
||||||
uint16_t green;
|
uint16_t green;
|
||||||
|
|
|
@ -34,12 +34,12 @@ void matrix_init_kb(void)
|
||||||
#ifdef AUDIO_ENABLE
|
#ifdef AUDIO_ENABLE
|
||||||
// audio_init() sets PB5 to output and drives it low, which breaks our matrix
|
// audio_init() sets PB5 to output and drives it low, which breaks our matrix
|
||||||
// so reset PB5 to input
|
// so reset PB5 to input
|
||||||
cbi(DDRB, 5);
|
setPinInput(B5);
|
||||||
sbi(PORTB, 5);
|
writePinHigh(B5);
|
||||||
#else
|
#else
|
||||||
// If we're not using the audio pin, drive it low
|
// If we're not using the audio pin, drive it low
|
||||||
sbi(DDRC, 6);
|
setPinOutput(C6);
|
||||||
cbi(PORTC, 6);
|
writePinLow(C6);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ISSI_ENABLE
|
#ifdef ISSI_ENABLE
|
||||||
|
|
|
@ -14,26 +14,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/* if the kb.h file exists (because we're running from qmkbuilder) include it */
|
|
||||||
#ifdef __has_include
|
|
||||||
#if __has_include("kb.h")
|
|
||||||
#include "kb.h"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include <avr/sfr_defs.h>
|
#include <avr/sfr_defs.h>
|
||||||
|
|
||||||
#ifndef cbi
|
|
||||||
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef sbi
|
|
||||||
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct RGB_Color {
|
typedef struct RGB_Color {
|
||||||
uint16_t red;
|
uint16_t red;
|
||||||
uint16_t green;
|
uint16_t green;
|
||||||
|
|
|
@ -7,9 +7,6 @@
|
||||||
#include "i2cmaster.h"
|
#include "i2cmaster.h"
|
||||||
#include <util/delay.h>
|
#include <util/delay.h>
|
||||||
|
|
||||||
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
|
|
||||||
#define CPU_16MHz 0x00
|
|
||||||
|
|
||||||
/* I2C aliases and register addresses (see "mcp23018.md") */
|
/* I2C aliases and register addresses (see "mcp23018.md") */
|
||||||
#define I2C_ADDR 0b0100000
|
#define I2C_ADDR 0b0100000
|
||||||
#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE )
|
#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE )
|
||||||
|
|
Loading…
Reference in a new issue