Skip to content

Commit

Permalink
pragma once
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossless committed Dec 20, 2024
1 parent 6d2e5b3 commit 1b29ea6
Show file tree
Hide file tree
Showing 30 changed files with 30 additions and 120 deletions.
5 changes: 1 addition & 4 deletions src/kb/kb.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef KB_H
#define KB_H
#pragma once

#include "report.h"
#include <stdint.h>
Expand All @@ -10,5 +9,3 @@ void kb_send_report(report_keyboard_t *report);
bool kb_process_record(uint16_t keycode, bool key_pressed);
void kb_update_switches();
void kb_update();

#endif
5 changes: 1 addition & 4 deletions src/keyboards/example/kbdef.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef KBDEF_H
#define KBDEF_H
#pragma once

#include "sh68f90a.h"

Expand All @@ -19,5 +18,3 @@
// Column Pins
#define KB_C0 P5_0
#define KB_C1 P5_1

#endif
5 changes: 1 addition & 4 deletions src/keyboards/eyooso-z11/kbdef.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef KBDEF_H
#define KBDEF_H
#pragma once

#include "sh68f90a.h"

Expand Down Expand Up @@ -87,5 +86,3 @@

// KC_CAPS LED Pin Bit
#define LED_CAPS_P0_3 _P0_3

#endif
5 changes: 1 addition & 4 deletions src/keyboards/nuphy-air60/kbdef.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef KBDEF_H
#define KBDEF_H
#pragma once

#include "sh68f90a.h"
#include "keycodes.h"
Expand Down Expand Up @@ -143,5 +142,3 @@ enum custom_keycodes {

KB_SAFE_RANGE,
};

#endif
5 changes: 1 addition & 4 deletions src/platform/bb_spi.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#ifndef BB_SPI_H
#define BB_SPI_H
#pragma once

#include <stdint.h>

void bb_spi_xfer(uint8_t *data, int len);

#endif
5 changes: 1 addition & 4 deletions src/platform/bk3632/rf_controller.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#ifndef RF_CONTROLLER_H
#define RF_CONTROLLER_H
#pragma once

#include "report.h"
#include "keyboard.h"

void rf_init();
void rf_send_report(report_keyboard_t *report);
void rf_update_keyboard_state(keyboard_state_t *keyboard);

#endif
5 changes: 1 addition & 4 deletions src/platform/sh68f90a/clock.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ifndef CLOCK_H
#define CLOCK_H
#pragma once

void clock_init();

#endif
5 changes: 1 addition & 4 deletions src/platform/sh68f90a/delay.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#ifndef DELAY_H
#define DELAY_H
#pragma once

#include <stdint.h>

void delay_ms(uint16_t cnt);
void delay_us(uint16_t cnt);

#endif
5 changes: 1 addition & 4 deletions src/platform/sh68f90a/isp.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ifndef ISP_H
#define ISP_H
#pragma once

void isp_jump();

#endif
5 changes: 1 addition & 4 deletions src/platform/sh68f90a/ldo.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ifndef LDO_H
#define LDO_H
#pragma once

void ldo_init();

#endif
5 changes: 1 addition & 4 deletions src/platform/sh68f90a/pwm.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef PWM_H
#define PWM_H
#pragma once

#include "sh68f90a.h"
#include <stdint.h>
Expand All @@ -22,5 +21,3 @@
} while (0)

void pwm_interrupt_handler() __interrupt(_INT_PWM0);

#endif
5 changes: 1 addition & 4 deletions src/platform/sh68f90a/sh68f90a.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SH68F90A_H
#define SH68F90A_H
#pragma once

#include <stdint.h>
#include <compiler.h>
Expand Down Expand Up @@ -803,5 +802,3 @@ enum interrupt_index {
_INT_PWM4 = 12,
_INT_EUART0 = 13,
};

#endif
5 changes: 1 addition & 4 deletions src/platform/sh68f90a/uart.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#ifndef UART_H
#define UART_H
#pragma once

#include "sh68f90a.h"

void uart_init();
void uart_putc(unsigned char c);
unsigned char uart_getc();
void uart_interrupt_handler() __interrupt(_INT_EUART0);

#endif
5 changes: 1 addition & 4 deletions src/platform/sh68f90a/usb.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef USB_H
#define USB_H
#pragma once

#include "sh68f90a.h"
#include "report.h"
Expand All @@ -9,5 +8,3 @@ void usb_init();
void usb_send_report(report_keyboard_t *report);

void usb_interrupt_handler() __interrupt(_INT_USB);

#endif
5 changes: 1 addition & 4 deletions src/platform/sh68f90a/usbregs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef USBREGS_H
#define USBREGS_H
#pragma once

/**
* Indicate an error in response to a EP0 transfer.
Expand Down Expand Up @@ -117,5 +116,3 @@
CLEAR_EP2_CNT; \
IEP2CNT |= COUNT; \
} while (0)

#endif
5 changes: 1 addition & 4 deletions src/platform/sh68f90a/watchdog.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef WATCHDOG_H
#define WATCHDOG_H
#pragma once

#include "sh68f90a.h"

Expand All @@ -9,5 +8,3 @@
# define CLR_WDT() (RSTSTAT = WDT_INIT)

#endif

#endif
5 changes: 1 addition & 4 deletions src/smk/debug.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#ifndef DEBUG_H
#define DEBUG_H
#pragma once

#include <stdio.h>

#define dprintf(...) \
do { \
if (DEBUG) printf(__VA_ARGS__); \
} while (0)

#endif
5 changes: 1 addition & 4 deletions src/smk/host.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#ifndef HOST_H
#define HOST_H
#pragma once

#include <stdint.h>
#include "report.h"

void host_keyboard_send(report_keyboard_t *report);

#endif
5 changes: 1 addition & 4 deletions src/smk/keyboard.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef KEYBOARD_H
#define KEYBOARD_H
#pragma once

#include <stdint.h>

Expand All @@ -10,5 +9,3 @@ typedef struct {
extern volatile __xdata keyboard_state_t keyboard_state;

void keyboard_init();

#endif
5 changes: 1 addition & 4 deletions src/smk/keycodes.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef KEYCODES_H
#define KEYCODES_H
#pragma once

// clang-format off

Expand Down Expand Up @@ -1442,5 +1441,3 @@ enum keycode_aliases {
#define MODS_SHIFT_MASK (MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT))

// clang-format on

#endif
5 changes: 1 addition & 4 deletions src/smk/layout.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#ifndef LAYOUT_H
#define LAYOUT_H
#pragma once

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

extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS];

#endif
5 changes: 1 addition & 4 deletions src/smk/matrix.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#ifndef MATRIX_H
#define MATRIX_H
#pragma once

#include <stdint.h>

void matrix_init();
uint8_t matrix_task();
void matrix_scan_step();

#endif
5 changes: 1 addition & 4 deletions src/smk/report.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef REPORT_H
#define REPORT_H
#pragma once

#include <stdint.h>
#include <stdbool.h>
Expand Down Expand Up @@ -62,5 +61,3 @@ void add_mods(uint8_t mods);
void del_mods(uint8_t mods);
void set_mods(uint8_t mods);
void clear_mods(void);

#endif
5 changes: 1 addition & 4 deletions src/smk/usbdef.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef USBDEF_H
#define USBDEF_H
#pragma once

#include <stdint.h>

Expand Down Expand Up @@ -307,5 +306,3 @@ typedef enum {
USB_DEVICE_STATE_CONFIGURED = 2,
USB_DEVICE_STATE_SUSPENDED = 3,
} usb_device_state_t;

#endif
5 changes: 1 addition & 4 deletions src/smk/usbhidreport.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
* @{
*/

#ifndef USBHIDREPORT_H
#define USBHIDREPORT_H
#pragma once

// clang-format off

Expand Down Expand Up @@ -145,5 +144,3 @@
// clang-format on

/** @} */

#endif
5 changes: 1 addition & 4 deletions src/smk/utils.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef UTILS_H
#define UTILS_H
#pragma once

// clang-format off

Expand All @@ -25,5 +24,3 @@

#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)

#endif
5 changes: 1 addition & 4 deletions src/user/indicators.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef INDICATORS_H
#define INDICATORS_H
#pragma once

#include "keyboard.h"
#include <stdint.h>
Expand All @@ -9,5 +8,3 @@ void indicators_start();
void indicators_pre_update();
bool indicators_update_step(keyboard_state_t *keyboard, uint8_t current_step);
void indicators_post_update();

#endif
5 changes: 1 addition & 4 deletions src/user/user_init.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#ifndef USER_INIT_H
#define USER_INIT_H
#pragma once

#include <stdint.h>

void user_init();

#endif
5 changes: 1 addition & 4 deletions src/user/user_layout.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef USER_LAYOUT_H
#define USER_LAYOUT_H
#pragma once

#include "keycodes.h"
#include <stdint.h>
Expand All @@ -9,5 +8,3 @@
returns a boolean value to instruct whether further key process should continue or end here
*/
bool layout_process_record(uint16_t keycode, bool key_pressed);

#endif
5 changes: 1 addition & 4 deletions src/user/user_matrix.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#ifndef USER_MATRIX_H
#define USER_MATRIX_H
#pragma once

#include <stdint.h>

void user_matrix_pre_scan(uint8_t col);
uint8_t user_matrix_scan_col(uint8_t col);
void user_matrix_post_scan();

#endif

0 comments on commit 1b29ea6

Please sign in to comment.