Skip to content

Commit

Permalink
Normalise include statements in core code (qmk#11153)
Browse files Browse the repository at this point in the history
* Normalise include statements in core code

* Missed one
  • Loading branch information
fauxpark committed Dec 11, 2020
1 parent 5b5d74a commit 501f2fd
Show file tree
Hide file tree
Showing 60 changed files with 99 additions and 79 deletions.
4 changes: 3 additions & 1 deletion docs/config_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ This level contains all of the options for that particular keymap. If you wish t

This is a C header file that is one of the first things included, and will persist over the whole project (if included). Lots of variables can be set here and accessed elsewhere. The `config.h` file shouldn't be including other `config.h` files, or anything besides this:

#include "config_common.h"
```c
#include "config_common.h"
```


## Hardware Options
Expand Down
4 changes: 3 additions & 1 deletion docs/de/newbs_testing_debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ Bevorzugst Du es lieber auf der Befehlszeile zu debuggen? Dafür eignet sich das
Manchmal ist es hilfreich Debug-Nachrichten innerhalb deines eigenen [Custom Codes](de/custom_quantum_functions.md) zu drucken. Das ist ziemlich einfach. Beginne damit `print.h` am Anfang deiner Datei zu inkludieren:
#include <print.h>
```c
#include "print.h"
```

Danach stehen dir verschiedene Druck-Funktionen zur Verfügung:

Expand Down
4 changes: 3 additions & 1 deletion docs/es/newbs_testing_debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ Para plataformas compatibles, [QMK Toolbox](https://github.com/qmk/qmk_toolbox)
A veces, es útil imprimir mensajes de depuración desde tu [código personalizado](custom_quantum_functions.md). Hacerlo es bastante simple. Comienza incluyendo `print.h` al principio de tu fichero:
#include <print.h>
```c
#include "print.h"
```

Después de eso puedes utilzar algunas funciones print diferentes:

Expand Down
4 changes: 3 additions & 1 deletion docs/feature_macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ Which would send Left Control+`a` (Left Control down, `a`, Left Control up) - no
By default, it assumes a US keymap with a QWERTY layout; if you want to change that (e.g. if your OS uses software Colemak), include this somewhere in your keymap:
#include <sendstring_colemak.h>
```c
#include "sendstring_colemak.h"
```

### Strings in Memory

Expand Down
2 changes: 1 addition & 1 deletion docs/feature_userspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ If you wanted to consolidate macros and other functions into your userspace for
First, you'd want to go through all of your `keymap.c` files and replace `process_record_user` with `process_record_keymap` instead. This way, you can still use keyboard specific codes on those boards, and use your custom "global" keycodes as well. You'll also want to replace `SAFE_RANGE` with `NEW_SAFE_RANGE` so that you wont have any overlapping keycodes
Then add `#include <name.h>` to all of your keymap.c files. This allows you to use these new keycodes without having to redefine them in each keymap.
Then add `#include "<name>.h"` to all of your keymap.c files. This allows you to use these new keycodes without having to redefine them in each keymap.
Once you've done that, you'll want to set the keycode definitions that you need to the `<name>.h` file. For instance:
```c
Expand Down
4 changes: 3 additions & 1 deletion docs/fr-fr/newbs_testing_debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ Vous préférez une solution basée sur le terminal? [hid_listen](https://www.pj
Parfois, il est utile d'afficher des messages de débugage depuis votre [code custom](custom_quantum_functions.md). Le faire est assez simple. Commencez par ajouter `print.h` au début de votre fichier:
#include <print.h>
```c
#include "print.h"
```

Une fois fait, vous pouvez utiliser les fonctions print suivantes:

Expand Down
4 changes: 3 additions & 1 deletion docs/ja/config_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ QMK での全ての利用可能な設定にはデフォルトがあります。

これは最初に include されるものの 1 つである C ヘッダファイルで、プロジェクト全体(もし含まれる場合)にわたって持続します。多くの変数をここで設定し、他の場所からアクセスすることができます。`config.h` ファイルでは、以下のもの以外の、他の `config.h` ファイルやその他のファイルの include をしないでください:

#include "config_common.h"
```c
#include "config_common.h"
```


## ハードウェアオプション
Expand Down
4 changes: 3 additions & 1 deletion docs/ja/feature_macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
デフォルトでは、QWERTY レイアウトの US キーマップを想定しています; それを変更したい場合(例えば OS がソフトウェア Colemak を使う場合)、キーマップのどこかに以下を含めます:
#include <sendstring_colemak.h>
```c
#include "sendstring_colemak.h"
```

### メモリ内の文字列

Expand Down
2 changes: 1 addition & 1 deletion docs/ja/feature_userspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
最初に、全ての `keymap.c` ファイルを調べ、代わりに `process_record_user` を `process_record_keymap` に置き換えます。この方法では、これらのキーボードでキーボード固有のコードを使用でき、カスタムの "global" キーコードも使うことができます。また、`SAFE_RANGE` を `NEW_SAFE_RANGE` に置き換えて、キーコードが重複しないようにすることもできます。
次に、全ての keymap.c ファイルに `#include <name.h>` を追加します。これにより、各キーマップでそれらを再定義することなく新しいキーコードを使うことができます。
次に、全ての keymap.c ファイルに `#include "<name>.h"` を追加します。これにより、各キーマップでそれらを再定義することなく新しいキーコードを使うことができます。
それが完了したら、必要なキーコードの定義を `<name>.h` ファイルに設定します。例えば:
```c
Expand Down
4 changes: 3 additions & 1 deletion docs/ja/newbs_testing_debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ void keyboard_post_init_user(void) {
[custom code](ja/custom_quantum_functions.md)内からデバッグメッセージを出力すると便利な場合があります。それはとても簡単です。ファイルの先頭に`print.h`のインクルードを追加します:
#include <print.h>
```c
#include "print.h"
```

そのあとは、いくつかの異なった print 関数を使用することが出来ます。

Expand Down
4 changes: 3 additions & 1 deletion docs/newbs_testing_debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ Prefer a terminal based solution? [hid_listen](https://www.pjrc.com/teensy/hid_l
Sometimes it's useful to print debug messages from within your [custom code](custom_quantum_functions.md). Doing so is pretty simple. Start by including `print.h` at the top of your file:
#include <print.h>
```c
#include "print.h"
```

After that you can use a few different print functions:

Expand Down
4 changes: 3 additions & 1 deletion docs/zh-cn/newbs_testing_debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ void keyboard_post_init_user(void) {
有时用[custom code](custom_quantum_functions.md)发送自定义调试信息很有用. 这么做很简单. 首先在你文件头部包含`print.h`:
#include <print.h>
```c
#include "print.h"
```

之后,您可以使用一些不同的打印功能:

Expand Down
2 changes: 1 addition & 1 deletion drivers/chibios/analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "quantum.h"
#include "analog.h"
#include "ch.h"
#include <ch.h>
#include <hal.h>

#if !HAL_USE_ADC
Expand Down
2 changes: 1 addition & 1 deletion drivers/chibios/i2c_master.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
#pragma once

#include "ch.h"
#include <ch.h>
#include <hal.h>

#ifdef I2C1_BANK
Expand Down
2 changes: 1 addition & 1 deletion drivers/chibios/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "serial.h"
#include "wait.h"

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

// TODO: resolve/remove build warnings
#if defined(RGBLIGHT_ENABLE) && defined(RGBLED_SPLIT) && defined(PROTOCOL_CHIBIOS) && defined(WS2812_DRIVER_BITBANG)
Expand Down
4 changes: 2 additions & 2 deletions drivers/chibios/serial_usart.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include "serial.h"
#include "printf.h"

#include "ch.h"
#include "hal.h"
#include <ch.h>
#include <hal.h>

#ifndef USART_CR1_M0
# define USART_CR1_M0 USART_CR1_M // some platforms (f1xx) dont have this so
Expand Down
2 changes: 1 addition & 1 deletion drivers/chibios/spi_master.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

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

#ifndef SPI_DRIVER
# define SPI_DRIVER SPID2
Expand Down
4 changes: 2 additions & 2 deletions drivers/chibios/ws2812.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 <ch.h>
#include <hal.h>

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

Expand Down
2 changes: 1 addition & 1 deletion drivers/chibios/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 <hal.h>

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

Expand Down
2 changes: 1 addition & 1 deletion drivers/eeprom/eeprom_stm32_L0_L1.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <stdint.h>
#include <string.h>

#include "hal.h"
#include <hal.h>
#include "eeprom_driver.h"
#include "eeprom_stm32_L0_L1.h"

Expand Down
2 changes: 1 addition & 1 deletion drivers/haptic/solenoid.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <timer.h>
#include "timer.h"
#include "solenoid.h"
#include "haptic.h"

Expand Down
2 changes: 1 addition & 1 deletion drivers/qwiic/micro_oled.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "micro_oled.h"
#include <print.h>
#include "print.h"
#include <stdlib.h>
#include "util/font5x7.h"
#include "util/font8x16.h"
Expand Down
4 changes: 2 additions & 2 deletions platforms/chibios/GENERIC_STM32_F042X6/board/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
* generator plugin. Do not edit manually.
*/

#include "hal.h"
#include "stm32_gpio.h"
#include <hal.h>
#include <stm32_gpio.h>

/*===========================================================================*/
/* Driver local definitions. */
Expand Down
2 changes: 1 addition & 1 deletion platforms/chibios/IC_TEENSY_3_1/board/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "hal.h"
#include <hal.h>

#if HAL_USE_PAL || defined(__DOXYGEN__)
/**
Expand Down
2 changes: 1 addition & 1 deletion platforms/chibios/STM32_F103_STM32DUINO/board/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

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

// Value to place in RTC backup register 10 for persistent bootloader mode
#define RTC_BOOTLOADER_FLAG 0x424C
Expand Down
4 changes: 2 additions & 2 deletions quantum/audio/audio_chibios.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/

#include "audio.h"
#include "ch.h"
#include "hal.h"
#include <ch.h>
#include <hal.h>

#include <string.h>
#include "print.h"
Expand Down
4 changes: 2 additions & 2 deletions quantum/audio/luts.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
# include <avr/interrupt.h>
# include <avr/pgmspace.h>
#else
# include "ch.h"
# include "hal.h"
# include <ch.h>
# include <hal.h>
#endif

#ifndef LUTS_H
Expand Down
6 changes: 3 additions & 3 deletions quantum/fauxclicky.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#include <avr/interrupt.h>
#include <avr/io.h>
#include <timer.h>
#include <fauxclicky.h>
#include "timer.h"
#include "fauxclicky.h"
#include <stdbool.h>
#include <musical_notes.h>
#include "musical_notes.h"

bool fauxclicky_enabled = true;
uint16_t note_start = 0;
Expand Down
2 changes: 1 addition & 1 deletion quantum/fauxclicky.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif

#include "musical_notes.h"
#include "stdbool.h"
#include <stdbool.h>

__attribute__((weak)) float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_D4, 0.25);
__attribute__((weak)) float fauxclicky_released_note[2] = MUSICAL_NOTE(_C4, 0.125);
Expand Down
2 changes: 1 addition & 1 deletion quantum/keymap.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# include <avr/pgmspace.h>
#elif defined PROTOCOL_CHIBIOS
// We need to ensure that chibios is include before redefining reset
# include "ch.h"
# include <ch.h>
#endif
#include "keycode.h"
#include "action_macro.h"
Expand Down
4 changes: 2 additions & 2 deletions quantum/process_keycode/process_key_lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "inttypes.h"
#include "stdint.h"
#include <inttypes.h>
#include <stdint.h>
#include "process_key_lock.h"

#define BV_64(shift) (((uint64_t)1) << (shift))
Expand Down
2 changes: 1 addition & 1 deletion quantum/quantum.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# include <avr/interrupt.h>
#endif
#if defined(PROTOCOL_CHIBIOS)
# include "hal.h"
# include <hal.h>
# include "chibios_config.h"
#endif

Expand Down
2 changes: 1 addition & 1 deletion quantum/rgb_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <string.h>
#include <math.h>

#include "lib/lib8tion/lib8tion.h"
#include <lib/lib8tion/lib8tion.h>

#ifndef RGB_MATRIX_CENTER
const point_t k_rgb_matrix_center = {112, 32};
Expand Down
6 changes: 3 additions & 3 deletions quantum/rgblight.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# include "eeprom.h"
#endif
#ifdef STM32_EEPROM_ENABLE
# include "hal.h"
# include <hal.h>
# include "eeprom_stm32.h"
#endif
#include "wait.h"
Expand All @@ -34,7 +34,7 @@
#include "color.h"
#include "debug.h"
#include "led_tables.h"
#include "lib/lib8tion/lib8tion.h"
#include <lib/lib8tion/lib8tion.h>
#ifdef VELOCIKEY_ENABLE
# include "velocikey.h"
#endif
Expand Down Expand Up @@ -983,7 +983,7 @@ void rgblight_task(void) {
# ifndef RGBLIGHT_BREATHE_TABLE_SIZE
# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256 or 128 or 64
# endif
# include <rgblight_breathe_table.h>
# include "rgblight_breathe_table.h"
# endif

__attribute__((weak)) const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5};
Expand Down
2 changes: 1 addition & 1 deletion quantum/serial_link/system/serial_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SOFTWARE.
#include "report.h"
#include "host_driver.h"
#include "serial_link/system/serial_link.h"
#include "hal.h"
#include <hal.h>
#include "serial_link/protocol/byte_stuffer.h"
#include "serial_link/protocol/transport.h"
#include "serial_link/protocol/frame_router.h"
Expand Down
2 changes: 1 addition & 1 deletion quantum/serial_link/system/serial_link.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ host_driver_t* get_serial_link_driver(void);
void serial_link_update(void);

#if defined(PROTOCOL_CHIBIOS)
# include "ch.h"
# include <ch.h>

static inline void serial_link_lock(void) { chSysLock(); }

Expand Down
2 changes: 1 addition & 1 deletion quantum/split_common/split_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#endif

#ifdef PROTOCOL_VUSB
# include "usbdrv.h"
# include <usbdrv/usbdrv.h>
#endif

#ifdef EE_HANDS
Expand Down
2 changes: 1 addition & 1 deletion quantum/split_common/transport.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <common/matrix.h>
#include "common/matrix.h"

void transport_master_init(void);
void transport_slave_init(void);
Expand Down
Loading

0 comments on commit 501f2fd

Please sign in to comment.