Skip to content

Commit 2a89181

Browse files
committed
Add C++ guard, annotate #endifs, and IWYU pragmas
1 parent 811165b commit 2a89181

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

lib-gd32/include/gd32_board.h

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#error Board is unknown / not defined
6969
#endif
7070

71-
#include "board/logic_analyzer.h"
71+
#include "board/logic_analyzer.h" // IWYU pragma: keep
7272

7373
#if defined(USART0_REMAP) && !defined(I2C0_REMAP)
7474
#error Configuration error
@@ -92,43 +92,47 @@
9292
#define ENETx
9393
#endif
9494

95+
#ifdef __cplusplus
9596
#if defined(ENABLE_USB_HOST)
9697
extern "C" {
9798
#include "usbh_core.h"
9899
extern usbh_host usb_host;
99100
}
100-
#endif
101+
#endif // defined(ENABLE_USB_HOST)
101102

102103
#if defined(DEBUG_STACK)
103104
#include "firmware/debug/debug_stack.h"
104-
#endif
105+
#endif // defined(DEBUG_STACK)
106+
105107
#if defined(DEBUG_EMAC)
106108
void emac_debug_run();
107-
#endif
109+
#endif // defined(DEBUG_EMAC)
108110

109111
#if defined(USE_FREE_RTOS)
110112
#include "FreeRTOS.h"
111113
#include "task.h"
112-
#endif
114+
#endif // defined(USE_FREE_RTOS)
115+
113116
#include "softwaretimers.h" // IWYU pragma: keep
114117
#include "panelled.h"
115118

116119
namespace board {
117120
inline void Run() {
118121
#if defined(ENABLE_USB_HOST)
119122
usbh_core_task(&usb_host);
120-
#endif
123+
#endif // defined(ENABLE_USB_HOST)
121124
#if !defined(USE_FREE_RTOS)
122125
SoftwareTimerRun();
123-
#endif
126+
#endif // !defined(USE_FREE_RTOS)
124127
panelled::Run();
125128
#if defined(DEBUG_STACK)
126129
debug::stack::Run();
127-
#endif
130+
#endif // defined(DEBUG_STACK)
128131
#if defined(DEBUG_EMAC)
129132
emac_debug_run();
130-
#endif
133+
#endif // defined(DEBUG_EMAC)
131134
}
132135
} // namespace board
136+
#endif // __cplusplus
133137

134138
#endif // GD32_BOARD_H_

0 commit comments

Comments
 (0)