diff --git a/drivers/avr/hd44780.h b/drivers/avr/hd44780.h index e60817e9898d..08e60f8a44e2 100644 --- a/drivers/avr/hd44780.h +++ b/drivers/avr/hd44780.h @@ -1,5 +1,3 @@ -#ifndef LCD_H -#define LCD_H /************************************************************************* Title : C include file for the HD44780U LCD library (lcd.c) Author: Peter Fleury http://tinyurl.com/peterfleury @@ -43,6 +41,8 @@ */ +#pragma once + #include #include @@ -346,5 +346,3 @@ extern void lcd_data(uint8_t data); #define lcd_puts_P(__s) lcd_puts_p(PSTR(__s)) /**@}*/ - -#endif // LCD_H diff --git a/drivers/avr/i2c_master.h b/drivers/avr/i2c_master.h index 4a35867cd057..e5af73364be3 100644 --- a/drivers/avr/i2c_master.h +++ b/drivers/avr/i2c_master.h @@ -17,8 +17,7 @@ * GitHub repository: https://github.com/g4lvanix/I2C-master-lib */ -#ifndef I2C_MASTER_H -#define I2C_MASTER_H +#pragma once #define I2C_READ 0x01 #define I2C_WRITE 0x00 @@ -42,5 +41,3 @@ i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16 i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout); i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); void i2c_stop(void); - -#endif // I2C_MASTER_H diff --git a/drivers/avr/i2c_slave.h b/drivers/avr/i2c_slave.h index 5d92150e6581..1cd0625ef439 100644 --- a/drivers/avr/i2c_slave.h +++ b/drivers/avr/i2c_slave.h @@ -20,8 +20,7 @@ Read or write to the necessary buffer according to the opperation. */ -#ifndef I2C_SLAVE_H -#define I2C_SLAVE_H +#pragma once #define I2C_SLAVE_REG_COUNT 30 @@ -29,5 +28,3 @@ extern volatile uint8_t i2c_slave_reg[I2C_SLAVE_REG_COUNT]; void i2c_slave_init(uint8_t address); void i2c_slave_stop(void); - -#endif // I2C_SLAVE_H diff --git a/drivers/avr/ssd1306.h b/drivers/avr/ssd1306.h index 9131afcf6122..6eecdcfaa40a 100644 --- a/drivers/avr/ssd1306.h +++ b/drivers/avr/ssd1306.h @@ -1,5 +1,4 @@ -#ifndef SSD1306_H -#define SSD1306_H +#pragma once #include #include @@ -86,5 +85,3 @@ void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c); void matrix_write(struct CharacterMatrix *matrix, const char *data); void matrix_write_P(struct CharacterMatrix *matrix, const char *data); void matrix_render(struct CharacterMatrix *matrix); - -#endif diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h index 345c030c94ac..81cd54369c0b 100644 --- a/tmk_core/common/action.h +++ b/tmk_core/common/action.h @@ -14,8 +14,8 @@ 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 . */ -#ifndef ACTION_H -#define ACTION_H + +#pragma once #include #include @@ -124,5 +124,3 @@ void debug_action(action_t action); #ifdef __cplusplus } #endif - -#endif /* ACTION_H */ diff --git a/tmk_core/common/action_code.h b/tmk_core/common/action_code.h index eea554ff2162..eb18c36ae809 100644 --- a/tmk_core/common/action_code.h +++ b/tmk_core/common/action_code.h @@ -14,8 +14,8 @@ 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 . */ -#ifndef ACTION_CODE_H -#define ACTION_CODE_H + +#pragma once /** \brief Action codes * @@ -306,5 +306,3 @@ enum swap_hands_param_tap_op { #define ACTION_SWAP_HANDS_OFF_ON() ACTION(ACT_SWAP_HANDS, OP_SH_OFF_ON) #define ACTION_SWAP_HANDS_ON() ACTION(ACT_SWAP_HANDS, OP_SH_ON) #define ACTION_SWAP_HANDS_OFF() ACTION(ACT_SWAP_HANDS, OP_SH_OFF) - -#endif /* ACTION_CODE_H */ diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h index f9f686112006..d72cd3e3a5b5 100644 --- a/tmk_core/common/action_layer.h +++ b/tmk_core/common/action_layer.h @@ -14,8 +14,8 @@ 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 . */ -#ifndef ACTION_LAYER_H -#define ACTION_LAYER_H + +#pragma once #include #include "keyboard.h" @@ -120,5 +120,3 @@ uint8_t layer_switch_get_layer(keypos_t key); /* return action depending on current layer status */ action_t layer_switch_get_action(keypos_t key); - -#endif diff --git a/tmk_core/common/action_macro.h b/tmk_core/common/action_macro.h index 21004ead62be..685e2c6ffcfc 100644 --- a/tmk_core/common/action_macro.h +++ b/tmk_core/common/action_macro.h @@ -14,8 +14,9 @@ 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 . */ -#ifndef ACTION_MACRO_H -#define ACTION_MACRO_H + +#pragma once + #include #include "progmem.h" @@ -120,5 +121,3 @@ enum macro_command_id { /* for backward comaptibility */ #define MD(key) DOWN(KC_##key) #define MU(key) UP(KC_##key) - -#endif /* ACTION_MACRO_H */ diff --git a/tmk_core/common/action_tapping.h b/tmk_core/common/action_tapping.h index 7015ce76120b..087090f8057b 100644 --- a/tmk_core/common/action_tapping.h +++ b/tmk_core/common/action_tapping.h @@ -14,8 +14,8 @@ 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 . */ -#ifndef ACTION_TAPPING_H -#define ACTION_TAPPING_H + +#pragma once /* period of tapping(ms) */ #ifndef TAPPING_TERM @@ -36,5 +36,3 @@ uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache); uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record); void action_tapping_process(keyrecord_t record); #endif - -#endif diff --git a/tmk_core/common/action_util.h b/tmk_core/common/action_util.h index 743ff1406b46..ff29f79b09d8 100644 --- a/tmk_core/common/action_util.h +++ b/tmk_core/common/action_util.h @@ -14,8 +14,8 @@ 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 . */ -#ifndef ACTION_UTIL_H -#define ACTION_UTIL_H + +#pragma once #include #include "report.h" @@ -98,5 +98,3 @@ void clear_oneshot_swaphands(void); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/common/arm_atsam/printf.h b/tmk_core/common/arm_atsam/printf.h index ad66722205c8..95557f5b01fd 100644 --- a/tmk_core/common/arm_atsam/printf.h +++ b/tmk_core/common/arm_atsam/printf.h @@ -1,10 +1,7 @@ -#ifndef _PRINTF_H_ -#define _PRINTF_H_ +#pragma once #define CONSOLE_PRINTBUF_SIZE 512 void console_printf(char *fmt, ...); #define __xprintf console_printf - -#endif //_PRINTF_H_ diff --git a/tmk_core/common/avr/suspend_avr.h b/tmk_core/common/avr/suspend_avr.h index e4cc0be50543..6df048f3bb0c 100644 --- a/tmk_core/common/avr/suspend_avr.h +++ b/tmk_core/common/avr/suspend_avr.h @@ -1,5 +1,4 @@ -#ifndef SUSPEND_AVR_H -#define SUSPEND_AVR_H +#pragma once #include #include @@ -24,5 +23,3 @@ __asm__ __volatile__ ( \ : "r0" \ ) // clang-format on - -#endif diff --git a/tmk_core/common/avr/timer_avr.h b/tmk_core/common/avr/timer_avr.h index 9aea21c65115..c1b726bd01ca 100644 --- a/tmk_core/common/avr/timer_avr.h +++ b/tmk_core/common/avr/timer_avr.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef TIMER_AVR_H -#define TIMER_AVR_H 1 +#pragma once #include @@ -38,5 +37,3 @@ along with this program. If not, see . #if (TIMER_RAW_TOP > 255) # error "Timer0 can't count 1ms at this clock freq. Use larger prescaler." #endif - -#endif diff --git a/tmk_core/common/avr/xprintf.h b/tmk_core/common/avr/xprintf.h index 70e0f8e48af0..80834f171472 100644 --- a/tmk_core/common/avr/xprintf.h +++ b/tmk_core/common/avr/xprintf.h @@ -2,8 +2,7 @@ Extended itoa, puts and printf (C)ChaN, 2011 -----------------------------------------------------------------------------*/ -#ifndef XPRINTF_H -#define XPRINTF_H +#pragma once #include #include @@ -102,5 +101,3 @@ char xatoi(char **str, long *ret); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/common/bootloader.h b/tmk_core/common/bootloader.h index 19260a079713..25ebd952888e 100644 --- a/tmk_core/common/bootloader.h +++ b/tmk_core/common/bootloader.h @@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef BOOTLOADER_H -#define BOOTLOADER_H +#pragma once /* give code for your bootloader to come up if needed */ void bootloader_jump(void); - -#endif diff --git a/tmk_core/common/bootmagic.h b/tmk_core/common/bootmagic.h index c64dc1785844..8209d0194f6c 100644 --- a/tmk_core/common/bootmagic.h +++ b/tmk_core/common/bootmagic.h @@ -1,5 +1,4 @@ -#ifndef BOOTMAGIC_H -#define BOOTMAGIC_H +#pragma once /* FIXME: Add special doxygen comments for defines here. */ @@ -101,5 +100,3 @@ void bootmagic(void); bool bootmagic_scan_keycode(uint8_t keycode); - -#endif diff --git a/tmk_core/common/chibios/eeprom_stm32.h b/tmk_core/common/chibios/eeprom_stm32.h index 373325cd2fa1..4dac7c1b595f 100644 --- a/tmk_core/common/chibios/eeprom_stm32.h +++ b/tmk_core/common/chibios/eeprom_stm32.h @@ -21,8 +21,7 @@ * This library also assumes that the pages are not used by the firmware. */ -#ifndef __EEPROM_H -#define __EEPROM_H +#pragma once #include #include @@ -83,5 +82,3 @@ uint16_t EEPROM_Init(void); void EEPROM_Erase(void); uint16_t EEPROM_WriteDataByte(uint16_t Address, uint8_t DataByte); uint8_t EEPROM_ReadDataByte(uint16_t Address); - -#endif /* __EEPROM_H */ diff --git a/tmk_core/common/chibios/flash_stm32.h b/tmk_core/common/chibios/flash_stm32.h index 8a874f606549..90d5bff47e33 100644 --- a/tmk_core/common/chibios/flash_stm32.h +++ b/tmk_core/common/chibios/flash_stm32.h @@ -16,8 +16,7 @@ * Modifications for QMK and STM32F303 by Yiancar */ -#ifndef __FLASH_STM32_H -#define __FLASH_STM32_H +#pragma once #ifdef __cplusplus extern "C" { @@ -41,5 +40,3 @@ void FLASH_ClearFlag(uint32_t FLASH_FLAG); #ifdef __cplusplus } #endif - -#endif /* __FLASH_STM32_H */ diff --git a/tmk_core/common/debug.h b/tmk_core/common/debug.h index f9d611bb03cd..3d2e2315effc 100644 --- a/tmk_core/common/debug.h +++ b/tmk_core/common/debug.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef DEBUG_H -#define DEBUG_H 1 +#pragma once #include #include "print.h" @@ -168,5 +167,3 @@ extern debug_config_t debug_config; # define debug_bin_reverse(data) #endif /* NO_DEBUG */ - -#endif diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h index 6fbe789031b9..c4f0483913ac 100644 --- a/tmk_core/common/eeconfig.h +++ b/tmk_core/common/eeconfig.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef EECONFIG_H -#define EECONFIG_H +#pragma once #include #include @@ -111,5 +110,3 @@ void eeconfig_update_haptic(uint32_t val); bool eeconfig_read_handedness(void); void eeconfig_update_handedness(bool val); - -#endif diff --git a/tmk_core/common/eeprom.h b/tmk_core/common/eeprom.h index 8a81e7066895..f5b3f0ad53d1 100644 --- a/tmk_core/common/eeprom.h +++ b/tmk_core/common/eeprom.h @@ -1,5 +1,4 @@ -#ifndef TMK_CORE_COMMON_EEPROM_H_ -#define TMK_CORE_COMMON_EEPROM_H_ +#pragma once #if defined(__AVR__) && !defined(EEPROM_DRIVER) # include @@ -20,5 +19,3 @@ void eeprom_update_word(uint16_t *__p, uint16_t __value); void eeprom_update_dword(uint32_t *__p, uint32_t __value); void eeprom_update_block(const void *__src, void *__dst, size_t __n); #endif - -#endif /* TMK_CORE_COMMON_EEPROM_H_ */ diff --git a/tmk_core/common/host_driver.h b/tmk_core/common/host_driver.h index 3cfec40cca3d..f34a22053066 100644 --- a/tmk_core/common/host_driver.h +++ b/tmk_core/common/host_driver.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef HOST_DRIVER_H -#define HOST_DRIVER_H +#pragma once #include #include "report.h" @@ -31,5 +30,3 @@ typedef struct { void (*send_system)(uint16_t); void (*send_consumer)(uint16_t); } host_driver_t; - -#endif diff --git a/tmk_core/common/keyboard.h b/tmk_core/common/keyboard.h index caa18e7e7698..d04e685cdb2e 100644 --- a/tmk_core/common/keyboard.h +++ b/tmk_core/common/keyboard.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef KEYBOARD_H -#define KEYBOARD_H +#pragma once #include #include @@ -77,5 +76,3 @@ void housekeeping_task_user(void); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/common/keycode.h b/tmk_core/common/keycode.h index 5c8ba8fe60ef..d35e44d8dc24 100644 --- a/tmk_core/common/keycode.h +++ b/tmk_core/common/keycode.h @@ -21,8 +21,8 @@ along with this program. If not, see . * See https://web.archive.org/web/20060218214400/http://www.usb.org/developers/devclass_docs/Hut1_12.pdf * or http://www.usb.org/developers/hidpage/Hut1_12v2.pdf (older) */ -#ifndef KEYCODE_H -#define KEYCODE_H + +#pragma once /* FIXME: Add doxygen comments here */ @@ -542,4 +542,3 @@ enum mouse_keys { KC_MS_ACCEL1, KC_MS_ACCEL2 }; -#endif diff --git a/tmk_core/common/magic.h b/tmk_core/common/magic.h index 3fa2d8b81c49..a6552c04dc2f 100644 --- a/tmk_core/common/magic.h +++ b/tmk_core/common/magic.h @@ -1,6 +1,3 @@ -#ifndef MAGIC_H -#define MAGIC_H +#pragma once void magic(void); - -#endif diff --git a/tmk_core/common/matrix.h b/tmk_core/common/matrix.h index 31ec844302c8..e36f01460058 100644 --- a/tmk_core/common/matrix.h +++ b/tmk_core/common/matrix.h @@ -14,8 +14,8 @@ 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 . */ -#ifndef MATRIX_H -#define MATRIX_H + +#pragma once #include #include @@ -76,5 +76,3 @@ void matrix_scan_user(void); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/common/mousekey.h b/tmk_core/common/mousekey.h index 05e4538234e6..300d262f5d6f 100644 --- a/tmk_core/common/mousekey.h +++ b/tmk_core/common/mousekey.h @@ -15,9 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef MOUSEKEY_H -# define MOUSEKEY_H -#endif +#pragma once #include #include "host.h" diff --git a/tmk_core/common/nodebug.h b/tmk_core/common/nodebug.h index b9c8b3ac0f3f..0b176684bd61 100644 --- a/tmk_core/common/nodebug.h +++ b/tmk_core/common/nodebug.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef NODEBUG_H -#define NODEBUG_H +#pragma once #ifndef NO_DEBUG # define NO_DEBUG @@ -25,5 +24,3 @@ along with this program. If not, see . #else # include "debug.h" #endif - -#endif diff --git a/tmk_core/common/print.h b/tmk_core/common/print.h index 1c77236212d2..647a5aa05309 100644 --- a/tmk_core/common/print.h +++ b/tmk_core/common/print.h @@ -22,8 +22,7 @@ * THE SOFTWARE. */ -#ifndef PRINT_H__ -#define PRINT_H__ 1 +#pragma once #include #include @@ -269,5 +268,3 @@ extern "C" #define pbin16(data) print_bin16(data) #define pbin_reverse(data) print_bin_reverse8(data) #define pbin_reverse16(data) print_bin_reverse16(data) - -#endif diff --git a/tmk_core/common/raw_hid.h b/tmk_core/common/raw_hid.h index c579157f14e5..6d60ab2bffc1 100644 --- a/tmk_core/common/raw_hid.h +++ b/tmk_core/common/raw_hid.h @@ -1,8 +1,5 @@ -#ifndef _RAW_HID_H_ -#define _RAW_HID_H_ +#pragma once void raw_hid_receive(uint8_t *data, uint8_t length); void raw_hid_send(uint8_t *data, uint8_t length); - -#endif diff --git a/tmk_core/common/sendchar.h b/tmk_core/common/sendchar.h index bd7b94fd99ff..b150dd464efd 100644 --- a/tmk_core/common/sendchar.h +++ b/tmk_core/common/sendchar.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef SENDCHAR_H -#define SENDCHAR_H +#pragma once #include @@ -30,5 +29,3 @@ int8_t sendchar(uint8_t c); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/common/sleep_led.h b/tmk_core/common/sleep_led.h index d160213f11c7..38f80a660df2 100644 --- a/tmk_core/common/sleep_led.h +++ b/tmk_core/common/sleep_led.h @@ -1,5 +1,4 @@ -#ifndef SLEEP_LED_H -#define SLEEP_LED_H +#pragma once #ifdef SLEEP_LED_ENABLE @@ -16,5 +15,3 @@ void sleep_led_toggle(void); # define sleep_led_toggle() #endif - -#endif diff --git a/tmk_core/common/suspend.h b/tmk_core/common/suspend.h index 87f5025da77b..766df95aa1bc 100644 --- a/tmk_core/common/suspend.h +++ b/tmk_core/common/suspend.h @@ -1,5 +1,4 @@ -#ifndef SUSPEND_H -#define SUSPEND_H +#pragma once #include #include @@ -13,5 +12,3 @@ void suspend_wakeup_init_user(void); void suspend_wakeup_init_kb(void); void suspend_power_down_user(void); void suspend_power_down_kb(void); - -#endif diff --git a/tmk_core/common/timer.h b/tmk_core/common/timer.h index 7ee7feac29fa..58f637dd9359 100644 --- a/tmk_core/common/timer.h +++ b/tmk_core/common/timer.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef TIMER_H -#define TIMER_H 1 +#pragma once #include #include @@ -51,5 +50,3 @@ uint32_t timer_elapsed32(uint32_t last); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/common/uart.h b/tmk_core/common/uart.h index 59a1a7cd12e4..ea247b17b8db 100644 --- a/tmk_core/common/uart.h +++ b/tmk_core/common/uart.h @@ -1,5 +1,4 @@ -#ifndef _uart_included_h_ -#define _uart_included_h_ +#pragma once #include @@ -7,5 +6,3 @@ void uart_init(uint32_t baud); void uart_putchar(uint8_t c); uint8_t uart_getchar(void); uint8_t uart_available(void); - -#endif diff --git a/tmk_core/common/util.h b/tmk_core/common/util.h index 68642e7fd3f1..db57f268c305 100644 --- a/tmk_core/common/util.h +++ b/tmk_core/common/util.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef UTIL_H -#define UTIL_H +#pragma once #include @@ -46,5 +45,3 @@ uint32_t bitrev32(uint32_t bits); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/common/virtser.h b/tmk_core/common/virtser.h index 74891b6ae0a6..a0645f9e03ea 100644 --- a/tmk_core/common/virtser.h +++ b/tmk_core/common/virtser.h @@ -1,10 +1,7 @@ -#ifndef _VIRTSER_H_ -#define _VIRTSER_H_ +#pragma once /* Define this function in your code to process incoming bytes */ void virtser_recv(const uint8_t ch); /* Call this to send a character over the Virtual Serial Device */ void virtser_send(const uint8_t byte); - -#endif diff --git a/tmk_core/common/wait.h b/tmk_core/common/wait.h index f5ef12ac0751..89128e9daf25 100644 --- a/tmk_core/common/wait.h +++ b/tmk_core/common/wait.h @@ -1,5 +1,4 @@ -#ifndef WAIT_H -#define WAIT_H +#pragma once #include @@ -41,5 +40,3 @@ void wait_ms(uint32_t ms); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/protocol/adb.h b/tmk_core/protocol/adb.h index 7d37485fcd77..34cbcf769102 100644 --- a/tmk_core/protocol/adb.h +++ b/tmk_core/protocol/adb.h @@ -35,8 +35,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef ADB_H -#define ADB_H +#pragma once #include #include @@ -57,5 +56,3 @@ void adb_host_listen(uint8_t cmd, uint8_t data_h, uint8_t data_l); void adb_host_kbd_led(uint8_t led); void adb_mouse_task(void); void adb_mouse_init(void); - -#endif diff --git a/tmk_core/protocol/chibios/usb_driver.h b/tmk_core/protocol/chibios/usb_driver.h index 6d71bcec4f43..f94387debdcf 100644 --- a/tmk_core/protocol/chibios/usb_driver.h +++ b/tmk_core/protocol/chibios/usb_driver.h @@ -22,10 +22,9 @@ * @{ */ -#ifndef USB_DRIVER_H -# define USB_DRIVER_H +#pragma once -# include +#include /*===========================================================================*/ /* Driver constants. */ @@ -35,9 +34,9 @@ /* Derived constants and error checks. */ /*===========================================================================*/ -# if HAL_USE_USB == FALSE -# error "The USB Driver requires HAL_USE_USB" -# endif +#if HAL_USE_USB == FALSE +# error "The USB Driver requires HAL_USE_USB" +#endif /*===========================================================================*/ /* Driver data structures and types. */ @@ -112,21 +111,21 @@ typedef struct { /** * @brief @p SerialDriver specific data. */ -# define _qmk_usb_driver_data \ - _base_asynchronous_channel_data /* Driver state.*/ \ - qmkusbstate_t state; \ - /* Input buffers queue.*/ \ - input_buffers_queue_t ibqueue; \ - /* Output queue.*/ \ - output_buffers_queue_t obqueue; \ - /* End of the mandatory fields.*/ \ - /* Current configuration data.*/ \ - const QMKUSBConfig *config; +#define _qmk_usb_driver_data \ + _base_asynchronous_channel_data /* Driver state.*/ \ + qmkusbstate_t state; \ + /* Input buffers queue.*/ \ + input_buffers_queue_t ibqueue; \ + /* Output queue.*/ \ + output_buffers_queue_t obqueue; \ + /* End of the mandatory fields.*/ \ + /* Current configuration data.*/ \ + const QMKUSBConfig *config; /** * @brief @p SerialUSBDriver specific methods. */ -# define _qmk_usb_driver_methods _base_asynchronous_channel_methods +#define _qmk_usb_driver_methods _base_asynchronous_channel_methods /** * @extends BaseAsynchronousChannelVMT @@ -158,9 +157,9 @@ struct QMKUSBDriver { /* External declarations. */ /*===========================================================================*/ -# ifdef __cplusplus +#ifdef __cplusplus extern "C" { -# endif +#endif void qmkusbInit(void); void qmkusbObjectInit(QMKUSBDriver *qmkusbp, const QMKUSBConfig *config); void qmkusbStart(QMKUSBDriver *qmkusbp, const QMKUSBConfig *config); @@ -173,10 +172,8 @@ void qmkusbSOFHookI(QMKUSBDriver *qmkusbp); void qmkusbDataTransmitted(USBDriver *usbp, usbep_t ep); void qmkusbDataReceived(USBDriver *usbp, usbep_t ep); void qmkusbInterruptTransmitted(USBDriver *usbp, usbep_t ep); -# ifdef __cplusplus +#ifdef __cplusplus } -# endif - -#endif /* USB_DRIVER_H */ +#endif /** @} */ diff --git a/tmk_core/protocol/chibios/usb_main.h b/tmk_core/protocol/chibios/usb_main.h index 1381d0765438..eaa08d8f795f 100644 --- a/tmk_core/protocol/chibios/usb_main.h +++ b/tmk_core/protocol/chibios/usb_main.h @@ -15,8 +15,7 @@ * GPL v2 or later. */ -#ifndef _USB_MAIN_H_ -#define _USB_MAIN_H_ +#pragma once // TESTING // extern uint8_t blinkLed; @@ -89,5 +88,3 @@ int8_t sendchar(uint8_t c); void console_flush_output(void); #endif /* CONSOLE_ENABLE */ - -#endif /* _USB_MAIN_H_ */ diff --git a/tmk_core/protocol/ibm4704.h b/tmk_core/protocol/ibm4704.h index cc2418ee6841..4f88d148b3e6 100644 --- a/tmk_core/protocol/ibm4704.h +++ b/tmk_core/protocol/ibm4704.h @@ -1,8 +1,8 @@ /* Copyright 2014 Jun WAKO */ -#ifndef IBM4704_H -#define IBM4704_H + +#pragma once #define IBM4704_ERR_NONE 0 #define IBM4704_ERR_PARITY 0x70 @@ -101,5 +101,3 @@ static inline void inhibit(void) { clock_hi(); data_lo(); } - -#endif diff --git a/tmk_core/protocol/lufa/lufa.h b/tmk_core/protocol/lufa/lufa.h index 71fd7aad854b..348a84c031ae 100644 --- a/tmk_core/protocol/lufa/lufa.h +++ b/tmk_core/protocol/lufa/lufa.h @@ -36,8 +36,7 @@ this software. */ -#ifndef _LUFA_H_ -#define _LUFA_H_ +#pragma once #include #include @@ -68,5 +67,3 @@ extern host_driver_t lufa_driver; // The header and terminator are not stored to save a few bytes of precious ram # define MIDI_SYSEX_BUFFER (API_SYSEX_MAX_SIZE + API_SYSEX_MAX_SIZE / 7 + (API_SYSEX_MAX_SIZE % 7 ? 1 : 0)) #endif - -#endif diff --git a/tmk_core/protocol/m0110.h b/tmk_core/protocol/m0110.h index 3f9686b0d926..63ff3e90ec4c 100644 --- a/tmk_core/protocol/m0110.h +++ b/tmk_core/protocol/m0110.h @@ -35,8 +35,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef M0110_H -#define M0110_H +#pragma once /* port settings for clock and data line */ #if !(defined(M0110_CLOCK_PORT) && defined(M0110_CLOCK_PIN) && defined(M0110_CLOCK_DDR) && defined(M0110_CLOCK_BIT)) @@ -80,5 +79,3 @@ uint8_t m0110_recv(void); uint8_t m0110_recv_key(void); uint8_t m0110_inquiry(void); uint8_t m0110_instant(void); - -#endif diff --git a/tmk_core/protocol/midi/Config/LUFAConfig.h b/tmk_core/protocol/midi/Config/LUFAConfig.h index b346c05bdd61..dead96de78d1 100644 --- a/tmk_core/protocol/midi/Config/LUFAConfig.h +++ b/tmk_core/protocol/midi/Config/LUFAConfig.h @@ -39,8 +39,7 @@ * manual section "Summary of Compile Tokens". */ -#ifndef _LUFA_CONFIG_H_ -#define _LUFA_CONFIG_H_ +#pragma once #if (ARCH == ARCH_AVR8) @@ -90,4 +89,3 @@ # error Unsupported architecture for this LUFA configuration file. #endif -#endif diff --git a/tmk_core/protocol/midi/bytequeue/bytequeue.h b/tmk_core/protocol/midi/bytequeue/bytequeue.h index 33fb63a8cbc9..29d15abbd38a 100644 --- a/tmk_core/protocol/midi/bytequeue/bytequeue.h +++ b/tmk_core/protocol/midi/bytequeue/bytequeue.h @@ -17,8 +17,7 @@ // You should have received a copy of the GNU General Public License // along with avr-bytequeue. If not, see . -#ifndef BYTEQUEUE_H -#define BYTEQUEUE_H +#pragma once #ifdef __cplusplus extern "C" { @@ -54,5 +53,3 @@ void bytequeue_remove(byteQueue_t* queue, byteQueueIndex_t numToRemove); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/protocol/midi/bytequeue/interrupt_setting.h b/tmk_core/protocol/midi/bytequeue/interrupt_setting.h index 788f75d79f0f..78294f07657e 100644 --- a/tmk_core/protocol/midi/bytequeue/interrupt_setting.h +++ b/tmk_core/protocol/midi/bytequeue/interrupt_setting.h @@ -16,8 +16,7 @@ // You should have received a copy of the GNU General Public License // along with avr-bytequeue. If not, see . -#ifndef INTERRUPT_SETTING_H -#define INTERRUPT_SETTING_H +#pragma once #ifdef __cplusplus extern "C" { @@ -34,5 +33,3 @@ void restore_interrupt_setting(interrupt_setting_t setting); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/protocol/midi/midi.h b/tmk_core/protocol/midi/midi.h index 07d8cebc1063..75f3b13b0bf5 100644 --- a/tmk_core/protocol/midi/midi.h +++ b/tmk_core/protocol/midi/midi.h @@ -25,8 +25,7 @@ * */ -#ifndef XNOR_MIDI_H -#define XNOR_MIDI_H +#pragma once #ifdef __cplusplus extern "C" { @@ -486,5 +485,3 @@ midi_packet_length_t midi_packet_length(uint8_t status); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/protocol/midi/midi_device.h b/tmk_core/protocol/midi/midi_device.h index 693d81a8e214..79e8f7a9369b 100644 --- a/tmk_core/protocol/midi/midi_device.h +++ b/tmk_core/protocol/midi/midi_device.h @@ -21,8 +21,7 @@ * @brief Device implementation functions */ -#ifndef MIDI_DEVICE_H -#define MIDI_DEVICE_H +#pragma once #ifdef __cplusplus extern "C" { @@ -147,5 +146,3 @@ void midi_device_set_pre_input_process_func(MidiDevice* device, midi_no_byte_fun #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/protocol/midi/midi_function_types.h b/tmk_core/protocol/midi/midi_function_types.h index 761e881178db..6f98a729811b 100644 --- a/tmk_core/protocol/midi/midi_function_types.h +++ b/tmk_core/protocol/midi/midi_function_types.h @@ -21,8 +21,7 @@ * @brief Function signature definitions */ -#ifndef MIDI_FUNCTION_TYPES_H -#define MIDI_FUNCTION_TYPES_H +#pragma once #ifdef __cplusplus extern "C" { @@ -46,5 +45,3 @@ typedef void (*midi_sysex_func_t)(MidiDevice *device, uint16_t start_byte, uint8 #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/protocol/midi/sysex_tools.h b/tmk_core/protocol/midi/sysex_tools.h index 454a92ea583f..7d7f10d24e80 100644 --- a/tmk_core/protocol/midi/sysex_tools.h +++ b/tmk_core/protocol/midi/sysex_tools.h @@ -16,8 +16,7 @@ // You should have received a copy of the GNU General Public License // along with avr-midi. If not, see . -#ifndef SYSEX_TOOLS_H -#define SYSEX_TOOLS_H +#pragma once #ifdef __cplusplus extern "C" { @@ -91,5 +90,3 @@ uint16_t sysex_decode(uint8_t *decoded, const uint8_t *source, uint16_t length); #ifdef __cplusplus } #endif - -#endif diff --git a/tmk_core/protocol/news.h b/tmk_core/protocol/news.h index d0c4bc6a4dce..327a13856d47 100644 --- a/tmk_core/protocol/news.h +++ b/tmk_core/protocol/news.h @@ -35,8 +35,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef NEWS_H -#define NEWS_H +#pragma once + /* * Primitive PS/2 Library for AVR */ @@ -46,5 +46,3 @@ void news_init(void); uint8_t news_recv(void); /* device role */ - -#endif diff --git a/tmk_core/protocol/next_kbd.h b/tmk_core/protocol/next_kbd.h index bff7a474d330..1249ebf392db 100644 --- a/tmk_core/protocol/next_kbd.h +++ b/tmk_core/protocol/next_kbd.h @@ -45,13 +45,12 @@ POSSIBILITY OF SUCH DAMAGE. */ -#include +#pragma once -#ifndef NEXT_KBD_H -# define NEXT_KBD_H +#include -# define NEXT_KBD_KMBUS_IDLE 0x300600 -# define NEXT_KBD_TIMING 50 +#define NEXT_KBD_KMBUS_IDLE 0x300600 +#define NEXT_KBD_TIMING 50 extern uint8_t next_kbd_error; @@ -59,5 +58,3 @@ extern uint8_t next_kbd_error; void next_kbd_init(void); void next_kbd_set_leds(bool left, bool right); uint32_t next_kbd_recv(void); - -#endif diff --git a/tmk_core/protocol/ps2.h b/tmk_core/protocol/ps2.h index e32cc9603f20..f1231928526b 100644 --- a/tmk_core/protocol/ps2.h +++ b/tmk_core/protocol/ps2.h @@ -35,8 +35,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef PS2_H -#define PS2_H +#pragma once #include #include "wait.h" @@ -138,5 +137,3 @@ static inline void inhibit(void) { clock_lo(); data_hi(); } - -#endif diff --git a/tmk_core/protocol/ps2_io.h b/tmk_core/protocol/ps2_io.h index 35e26561d41b..de93cb7a39d8 100644 --- a/tmk_core/protocol/ps2_io.h +++ b/tmk_core/protocol/ps2_io.h @@ -1,5 +1,4 @@ -#ifndef PS2_IO_H -#define PS2_IO_H +#pragma once void clock_init(void); void clock_lo(void); @@ -10,5 +9,3 @@ void data_init(void); void data_lo(void); void data_hi(void); bool data_in(void); - -#endif diff --git a/tmk_core/protocol/ps2_mouse.h b/tmk_core/protocol/ps2_mouse.h index d743fb3d85e5..c97c6c893a03 100644 --- a/tmk_core/protocol/ps2_mouse.h +++ b/tmk_core/protocol/ps2_mouse.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef PS2_MOUSE_H -#define PS2_MOUSE_H +#pragma once #include #include "debug.h" @@ -176,5 +175,3 @@ void ps2_mouse_set_resolution(ps2_mouse_resolution_t resolution); void ps2_mouse_set_sample_rate(ps2_mouse_sample_rate_t sample_rate); void ps2_mouse_moved_user(report_mouse_t *mouse_report); - -#endif diff --git a/tmk_core/protocol/serial_mouse.h b/tmk_core/protocol/serial_mouse.h index b10315f3660c..cb83cf4f6221 100644 --- a/tmk_core/protocol/serial_mouse.h +++ b/tmk_core/protocol/serial_mouse.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef SERIAL_MOUSE_H -#define SERIAL_MOUSE_H +#pragma once #include @@ -28,5 +27,3 @@ static inline uint8_t serial_mouse_init(void) { } void serial_mouse_task(void); - -#endif diff --git a/tmk_core/protocol/usb_descriptor.h b/tmk_core/protocol/usb_descriptor.h index 3a7c0bdbac5b..4c6728ebb916 100644 --- a/tmk_core/protocol/usb_descriptor.h +++ b/tmk_core/protocol/usb_descriptor.h @@ -40,8 +40,8 @@ * * Header file for Descriptors.c. */ -#ifndef _DESCRIPTORS_H_ -#define _DESCRIPTORS_H_ + +#pragma once #include @@ -286,4 +286,3 @@ enum usb_endpoints { #define JOYSTICK_EPSIZE 8 uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const void** const DescriptorAddress); -#endif diff --git a/tmk_core/protocol/xt.h b/tmk_core/protocol/xt.h index e7e1a13f4d61..6dc5f19d00b6 100644 --- a/tmk_core/protocol/xt.h +++ b/tmk_core/protocol/xt.h @@ -36,8 +36,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef XT_H -#define XT_H +#pragma once #define XT_DATA_IN() \ do { \ @@ -69,5 +68,3 @@ POSSIBILITY OF SUCH DAMAGE. void xt_host_init(void); uint8_t xt_host_recv(void); - -#endif diff --git a/tmk_core/ring_buffer.h b/tmk_core/ring_buffer.h index 25fab638ebd3..8f887c8f74ab 100644 --- a/tmk_core/ring_buffer.h +++ b/tmk_core/ring_buffer.h @@ -1,5 +1,5 @@ -#ifndef RING_BUFFER_H -#define RING_BUFFER_H +#pragma once + /*-------------------------------------------------------------------- * Ring buffer to store scan codes from keyboard *------------------------------------------------------------------*/ @@ -43,5 +43,3 @@ static inline bool rbuf_has_data(void) { static inline void rbuf_clear(void) { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { rbuf_head = rbuf_tail = 0; } } - -#endif /* RING_BUFFER_H */