Skip to content

Commit 145deb9

Browse files
committed
firmware: replace include guards with #pragma once
1 parent 96a6f28 commit 145deb9

93 files changed

Lines changed: 169 additions & 368 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

firmware/common/adc.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@
1919
* Boston, MA 02110-1301, USA.
2020
*/
2121

22-
#ifndef __ADC_H__
23-
#define __ADC_H__
22+
#pragma once
2423

2524
#include <stdint.h>
2625

2726
uint16_t adc_read(uint8_t pin);
2827
void adc_off(void);
29-
30-
#endif // __ADC_H__

firmware/common/bitband.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
* Boston, MA 02110-1301, USA.
2121
*/
2222

23-
#ifndef __BITBAND_H__
24-
#define __BITBAND_H__
23+
#pragma once
2524

2625
#include <stdint.h>
2726

@@ -37,5 +36,3 @@ void peripheral_bitband_clear(
3736
uint32_t peripheral_bitband_get(
3837
volatile void* const peripheral_address,
3938
const uint_fast8_t bit_number);
40-
41-
#endif //__BITBAND_H__

firmware/common/clkin.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@
1919
* Boston, MA 02110-1301, USA.
2020
*/
2121

22-
#ifndef __CLKIN_H__
23-
#define __CLKIN_H__
22+
#pragma once
2423

2524
#include <stdint.h>
2625

2726
void clkin_detect_init(void);
2827
uint32_t clkin_frequency(void);
29-
30-
#endif //__CLKIN_H__

firmware/common/cpld_jtag.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
* Boston, MA 02110-1301, USA.
2020
*/
2121

22-
#ifndef __CPLD_JTAG_H__
23-
#define __CPLD_JTAG_H__
22+
#pragma once
2423

2524
#include <stdint.h>
2625

@@ -59,5 +58,3 @@ int cpld_jtag_program(
5958
unsigned char* const buffer,
6059
refill_buffer_cb refill);
6160
unsigned char cpld_jtag_get_next_byte(void);
62-
63-
#endif //__CPLD_JTAG_H__

firmware/common/cpld_xc2c.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
* Boston, MA 02110-1301, USA.
2121
*/
2222

23-
#ifndef __CPLD_XC2C_H__
24-
#define __CPLD_XC2C_H__
23+
#pragma once
2524

2625
#include <stdbool.h>
2726
#include <stdint.h>
@@ -69,5 +68,3 @@ bool cpld_xc2c64a_jtag_sram_verify(
6968
extern const cpld_xc2c64a_program_t cpld_hackrf_program_sram;
7069
extern const cpld_xc2c64a_verify_t cpld_hackrf_verify;
7170
extern const cpld_xc2c64a_row_addresses_t cpld_hackrf_row_addresses;
72-
73-
#endif /*__CPLD_XC2C_H__*/

firmware/common/crc.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
* Boston, MA 02110-1301, USA.
2121
*/
2222

23-
#ifndef __CRC_H__
24-
#define __CRC_H__
23+
#pragma once
2524

2625
#include <stddef.h>
2726
#include <stdint.h>
@@ -35,5 +34,3 @@ typedef struct {
3534
void crc32_init(crc32_t* const crc);
3635
void crc32_update(crc32_t* const crc, const uint8_t* const data, const size_t byte_count);
3736
uint32_t crc32_digest(const crc32_t* const crc);
38-
39-
#endif //__CRC_H__

firmware/common/delay.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
* Boston, MA 02110-1301, USA.
2020
*/
2121

22-
#ifndef __DELAY_H
23-
#define __DELAY_H
22+
#pragma once
2423

2524
#ifdef __cplusplus
2625
extern "C" {
@@ -31,4 +30,6 @@ extern "C" {
3130
void delay(uint32_t duration);
3231
void delay_us_at_mhz(uint32_t us, uint32_t mhz);
3332

34-
#endif /* __DELAY_H */
33+
#ifdef __cplusplus
34+
}
35+
#endif

firmware/common/fault_handler.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
* Boston, MA 02110-1301, USA.
2121
*/
2222

23-
#ifndef __FAULT_HANDLER__
24-
#define __FAULT_HANDLER__
23+
#pragma once
2524

2625
#include <stdint.h>
2726

@@ -71,5 +70,3 @@ static armv7m_scb_t* const SCB = (armv7m_scb_t*) SCB_BASE;
7170
#define SCB_HFSR_DEBUGEVT (1 << 31)
7271
#define SCB_HFSR_FORCED (1 << 30)
7372
#define SCB_HFSR_VECTTBL (1 << 1)
74-
75-
#endif //__FAULT_HANDLER__

firmware/common/firmware_info.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
* Boston, MA 02110-1301, USA.
2020
*/
2121

22-
#ifndef FIRMWARE_INFO_H
23-
#define FIRMWARE_INFO_H
22+
#pragma once
2423

2524
#include <stdint.h>
2625

@@ -33,5 +32,3 @@ struct firmware_info_t {
3332
} __attribute__((packed, aligned(1)));
3433

3534
extern const struct firmware_info_t firmware_info;
36-
37-
#endif

firmware/common/fixed_point.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
* Boston, MA 02110-1301, USA.
2020
*/
2121

22-
#ifndef __FIXED_POINT_H__
23-
#define __FIXED_POINT_H__
22+
#pragma once
2423

2524
#include <stdint.h>
2625

@@ -32,5 +31,3 @@ typedef uint64_t fp_40_24_t;
3231

3332
/* one in 40.24 fixed-point */
3433
#define FP_ONE_HZ (1 << 24)
35-
36-
#endif /*__FIXED_POINT_H__*/

0 commit comments

Comments
 (0)