Skip to content

Commit

Permalink
drivers: remove direct quantum.h includes (qmk#21473)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored and csolje committed Oct 21, 2023
1 parent a491fcc commit 2655615
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 23 deletions.
2 changes: 1 addition & 1 deletion drivers/led/apa102.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

#include "apa102.h"
#include "quantum.h"
#include "gpio.h"

#ifndef APA102_NOPS
# if defined(__AVR__)
Expand Down
2 changes: 1 addition & 1 deletion drivers/sensors/pmw33xx_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#pragma once

#include "quantum.h" //to get is_keyboard_left
#include "keyboard.h"
#include <stdint.h>
#include "spi_master.h"
#include "util.h"
Expand Down
3 changes: 2 additions & 1 deletion platforms/chibios/bootloaders/rp2040.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Copyright 2022 Stefan Kerkmann
// SPDX-License-Identifier: GPL-2.0-or-later

#include "quantum.h"
#include "hal.h"
#include "bootloader.h"
#include "gpio.h"
#include "wait.h"
#include "pico/bootrom.h"

#if !defined(RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED)
Expand Down
4 changes: 3 additions & 1 deletion platforms/chibios/drivers/i2c_master.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
* STM32_I2C_USE_I2C1 is TRUE in the mcuconf.h file. Pins B6 and B7 are used
* but using any other I2C pins should be trivial.
*/
#include "quantum.h"

#include "i2c_master.h"
#include "gpio.h"
#include "chibios_config.h"
#include <string.h>
#include <ch.h>
#include <hal.h>
Expand Down
2 changes: 1 addition & 1 deletion platforms/chibios/drivers/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* WARNING: be careful changing this code, it is very timing dependent
*/

#include "quantum.h"
#include "serial.h"
#include "gpio.h"
#include "wait.h"
#include "synchronization_util.h"

Expand Down
2 changes: 0 additions & 2 deletions platforms/chibios/drivers/serial_protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@

#include <ch.h>

#include "quantum.h"
#include "serial.h"
#include "serial_protocol.h"
#include "printf.h"
#include "synchronization_util.h"

static inline bool initiate_transaction(uint8_t transaction_id);
Expand Down
1 change: 1 addition & 0 deletions platforms/chibios/drivers/serial_usart.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "serial_usart.h"
#include "serial_protocol.h"
#include "synchronization_util.h"
#include "chibios_config.h"

#if defined(SERIAL_USART_CONFIG)
static QMKSerialConfig serial_config = SERIAL_USART_CONFIG;
Expand Down
1 change: 0 additions & 1 deletion platforms/chibios/drivers/serial_usart.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#pragma once

#include "quantum.h"
#include "serial.h"
#include <hal.h>

Expand Down
2 changes: 0 additions & 2 deletions platforms/chibios/drivers/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

#include "uart.h"

#include "quantum.h"

#if defined(MCU_KINETIS)
static SerialConfig serialConfig = {SERIAL_DEFAULT_BITRATE};
#elif defined(WB32F3G71xx) || defined(WB32FQ95xx)
Expand Down
1 change: 1 addition & 0 deletions platforms/chibios/drivers/uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#pragma once

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

#include <hal.h>

Expand Down
4 changes: 1 addition & 3 deletions platforms/chibios/drivers/vendor/RP/RP2040/ps2_vendor.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// Copyright 2022 Marek Kraus (@gamelaster)
// SPDX-License-Identifier: GPL-2.0-or-later

#include "quantum.h"

#include "hardware/pio.h"
#include "hardware/clocks.h"
#include "ps2.h"
#include "print.h"
#include "debug.h"

#if !defined(MCU_RP)
# error PIO Driver is only available for Raspberry Pi 2040 MCUs!
Expand Down
3 changes: 2 additions & 1 deletion platforms/chibios/drivers/vendor/RP/RP2040/serial_vendor.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Copyright 2022 Stefan Kerkmann
// SPDX-License-Identifier: GPL-2.0-or-later

#include "quantum.h"
#include "serial_usart.h"
#include "serial_protocol.h"
#include "hardware/pio.h"
#include "hardware/clocks.h"
#include "wait.h"
#include "debug.h"

#if !defined(MCU_RP)
# error PIO Driver is only available for Raspberry Pi 2040 MCUs!
Expand Down
12 changes: 9 additions & 3 deletions platforms/chibios/drivers/vendor/RP/RP2040/ws2812_vendor.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@
// SPDX-License-Identifier: GPL-2.0-or-later

#include "ws2812.h"
#include "hardware/timer.h"
#include "hardware/clocks.h"

// Keep this exact include order otherwise we run into naming conflicts between
// pico-sdk and rp2040.h which we don't control.
#include "quantum.h"
#include "hardware/timer.h"
#include "hardware/clocks.h"
#include <hal.h>
#include "hardware/pio.h"

#include "gpio.h"
#include "debug.h"
#include "wait.h"
#include "util.h"

#if !defined(MCU_RP)
# error PIO Driver is only available for Raspberry Pi 2040 MCUs!
#endif
Expand Down
6 changes: 3 additions & 3 deletions platforms/chibios/drivers/ws2812_bitbang.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "quantum.h"
#include "ws2812.h"
#include <ch.h>
#include <hal.h>

#include "gpio.h"
#include "chibios_config.h"

/* Adapted from https://github.com/bigjosh/SimpleNeoPixelDemo/ */

Expand Down
4 changes: 2 additions & 2 deletions platforms/chibios/drivers/ws2812_pwm.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ws2812.h"
#include "quantum.h"
#include <hal.h>
#include "gpio.h"
#include "chibios_config.h"

/* Adapted from https://github.com/joewa/WS2812-LED-Driver_ChibiOS/ */

Expand Down
4 changes: 3 additions & 1 deletion platforms/chibios/drivers/ws2812_spi.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "quantum.h"
#include "ws2812.h"
#include "gpio.h"
#include "util.h"
#include "chibios_config.h"

/* Adapted from https://github.com/gamazeps/ws2812b-chibios-SPIDMA/ */

Expand Down

0 comments on commit 2655615

Please sign in to comment.