Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up usage of QMK_KEYBOARD_H #20167

Merged
merged 1 commit into from
Mar 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions keyboards/25keys/cassette42/common/oled_helper.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include "oled_helper.h"
#include "quantum.h"
#include <stdio.h>
#include <string.h>

#ifdef OLED_ENABLE
# include QMK_KEYBOARD_H
# include <stdio.h>
# include <string.h>

void render_logo(void) {
static const char PROGMEM logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0};
Expand Down
4 changes: 3 additions & 1 deletion keyboards/3w6/rev1/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* to repeating that information all over the place.
*/

#include QMK_KEYBOARD_H
#include "matrix.h"
#include "debug.h"
#include "wait.h"
#include "i2c_master.h"

extern i2c_status_t tca9555_status;
Expand Down
4 changes: 3 additions & 1 deletion keyboards/3w6/rev2/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* to repeating that information all over the place.
*/

#include QMK_KEYBOARD_H
#include "matrix.h"
#include "debug.h"
#include "wait.h"
#include "i2c_master.h"

extern i2c_status_t tca9555_status;
Expand Down
2 changes: 1 addition & 1 deletion keyboards/adm42/rev4/rev4.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H
#include "quantum.h"

led_config_t g_led_config = {
{
Expand Down
2 changes: 1 addition & 1 deletion keyboards/argo_works/ishi/80/mk0_avr_extra/mk0_avr_extra.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H
#include "quantum.h"

#ifdef OLED_ENABLE
static void render_logo(void) {
Expand Down
18 changes: 10 additions & 8 deletions keyboards/converter/palm_usb/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H
#include "matrix.h"
#include "debug.h"
#include "wait.h"
#include "uart.h"
#include "timer.h"

Expand Down Expand Up @@ -134,14 +136,14 @@ uint8_t rts_reset(void) {
if (firstread) {
writePinLow(RTS_PIN);
}
_delay_ms(10);
wait_ms(10);
writePinHigh(RTS_PIN);


/* the future is Arm
if (!palReadPad(RTS_PIN_IOPRT))
{
_delay_ms(10);
wait_ms(10);
palSetPadMode(RTS_PINn_IOPORT, PinDirectionOutput_PUSHPULL);
palSetPad(RTS_PORT, RTS_PIN);
}
Expand All @@ -150,13 +152,13 @@ uint8_t rts_reset(void) {
palSetPadMode(RTS_PIN_RTS_PORT, PinDirectionOutput_PUSHPULL);
palSetPad(RTS_PORT, RTS_PIN);
palClearPad(RTS_PORT, RTS_PIN);
_delay_ms(10);
wait_ms(10);
palSetPad(RTS_PORT, RTS_PIN);
}
*/


_delay_ms(5);
wait_ms(5);
//print("rts\n");
return 1;
}
Expand Down Expand Up @@ -222,7 +224,7 @@ uint8_t handspring_handshake(void) {

uint8_t handspring_reset(void) {
writePinLow(VCC_PIN);
_delay_ms(5);
wait_ms(5);
writePinHigh(VCC_PIN);

if ( handspring_handshake() ) {
Expand Down Expand Up @@ -257,7 +259,7 @@ void matrix_init(void)
last_activity = timer_read();
} else {
print("failed handshake");
_delay_ms(1000);
wait_ms(1000);
//BUG /should/ power cycle or toggle RTS & reset, but this usually works.
}

Expand All @@ -271,7 +273,7 @@ void matrix_init(void)
last_activity = timer_read();
} else {
print("failed handshake");
_delay_ms(1000);
wait_ms(1000);
//BUG /should/ power cycle or toggle RTS & reset, but this usually works.
}

Expand Down
64 changes: 0 additions & 64 deletions keyboards/converter/sun_usb/command_extra.c

This file was deleted.

3 changes: 2 additions & 1 deletion keyboards/converter/sun_usb/led.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H
#include "led.h"
#include "print.h"
#include "uart.h"

void led_set(uint8_t usb_led)
Expand Down
16 changes: 10 additions & 6 deletions keyboards/converter/sun_usb/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H
#include "matrix.h"
#include "host.h"
#include "led.h"
#include "debug.h"
#include "wait.h"
#include "uart.h"

/*
Expand Down Expand Up @@ -86,9 +90,9 @@ void matrix_init(void)
/* print("."); */
/* while (uart_read()); */
/* uart_write(0x01); */
/* _delay_ms(500); */
/* wait_ms(500); */
/* if (uart_read() == 0xFF) { */
/* _delay_ms(500); */
/* wait_ms(500); */
/* if (uart_read() == 0x04) */
/* break; */
/* } */
Expand All @@ -112,7 +116,7 @@ uint8_t matrix_scan(void)
switch (code) {
case 0xFF: // reset success: FF 04
print("reset: ");
_delay_ms(500);
wait_ms(500);
code = uart_read();
xprintf("%02X\n", code);
if (code == 0x04) {
Expand All @@ -122,12 +126,12 @@ uint8_t matrix_scan(void)
return 0;
case 0xFE: // layout: FE <layout>
print("layout: ");
_delay_ms(500);
wait_ms(500);
xprintf("%02X\n", uart_read());
return 0;
case 0x7E: // reset fail: 7E 01
print("reset fail: ");
_delay_ms(500);
wait_ms(500);
xprintf("%02X\n", uart_read());
return 0;
case 0x7F:
Expand Down
2 changes: 1 addition & 1 deletion keyboards/converter/xmk/xmk.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H
#include "quantum.h"

#if defined (XMK_DEBUG)
void keyboard_post_init_kb(void) {
Expand Down
2 changes: 2 additions & 0 deletions keyboards/converter/xmk/xmk_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// SPDX-License-Identifier: GPL-2.0-or-later

#include "xmk_matrix.h"
#include "matrix.h"
#include "debug.h"

bool xmk_changed = false;
matrix_row_t xmk_rows[MATRIX_ROWS];
Expand Down
3 changes: 2 additions & 1 deletion keyboards/converter/xmk/xmk_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#pragma once

#include QMK_KEYBOARD_H
#include <stdbool.h>
#include <stdint.h>

void xmk_matrix_key(bool press, uint8_t key);
4 changes: 1 addition & 3 deletions keyboards/crkbd/lib/layer_state_reader.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

#include QMK_KEYBOARD_H
#include "quantum.h"
#include <stdio.h>
#include "crkbd.h"

// in the future, should use (1U<<_LAYER_NAME) instead, but needs to be moved to keymap,c
#define L_BASE 0
Expand Down
1 change: 0 additions & 1 deletion keyboards/crkbd/lib/rgb_state_reader.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#ifdef RGBLIGHT_ENABLE

#include QMK_KEYBOARD_H
#include <stdio.h>

extern rgblight_config_t rgblight_config;
Expand Down
2 changes: 1 addition & 1 deletion keyboards/cxt_studio/cxt_studio.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2023 Colin Kinloch (@ColinKinloch)
// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H
#include "quantum.h"

static uint8_t anim = 0;

Expand Down
2 changes: 1 addition & 1 deletion keyboards/ergodox_stm32/ergodox_stm32.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ergodox_stm32.h"
#include "i2c_master.h"
#include QMK_KEYBOARD_H

extern inline void ergodox_board_led_1_on(void);
extern inline void ergodox_board_led_2_on(void);
Expand Down
9 changes: 3 additions & 6 deletions keyboards/ergodox_stm32/matrix.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
#include <stdint.h>
#include <stdbool.h>
#include "matrix.h"
#include <string.h>
#include <hal.h>
#include "timer.h"
#include "wait.h"
#include "print.h"
#include "matrix.h"
#include "debug.h"
#include "i2c_master.h"
#include QMK_KEYBOARD_H
#include "ergodox_stm32.h"

#ifndef DEBOUNCE
#define DEBOUNCE 10
Expand Down
2 changes: 0 additions & 2 deletions keyboards/fc980c/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "matrix.h"
#include "led.h"
#include "avr/timer_avr.h"
// #include QMK_KEYBOARD_H


// Timer resolution check
#if (1000000/TIMER_RAW_FREQ > 20)
Expand Down
4 changes: 3 additions & 1 deletion keyboards/ferris/0_1/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* to repeating that information all over the place.
*/

#include QMK_KEYBOARD_H
#include "matrix.h"
#include "debug.h"
#include "wait.h"
#include "i2c_master.h"

extern i2c_status_t mcp23017_status;
Expand Down
5 changes: 3 additions & 2 deletions keyboards/ferris/0_2/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* to repeating that information all over the place.
*/

#include QMK_KEYBOARD_H
#include "matrix.h"
#include "debug.h"
#include "wait.h"
#include "i2c_master.h"
#include <print.h>

extern i2c_status_t mcp23017_status;
#define MCP23017_I2C_TIMEOUT 1000
Expand Down
2 changes: 1 addition & 1 deletion keyboards/gboards/butterstick/sten.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#pragma once

#include QMK_KEYBOARD_H
#include "butterstick.h"
#include "mousekey.h"
#include "keymap_steno.h"
#include "wait.h"
Expand Down
6 changes: 2 additions & 4 deletions keyboards/gboards/engine/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@
*/

#pragma once
#include QMK_KEYBOARD_H

#include "quantum.h"
#include <string.h>
#include <stdint.h>
#include <stdio.h>
#include "config_engine.h"
#include <avr/pgmspace.h>
#include "wait.h"

// Maximum values for combos
#define COMBO_END 0x00
Expand Down
2 changes: 1 addition & 1 deletion keyboards/gboards/ergotaco/ergotaco.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include QMK_KEYBOARD_H
#include "ergotaco.h"

bool i2c_initialized = 0;
i2c_status_t mcp23018_status = 0x20;
Expand Down
Loading