Skip to content

Commit a9f1c62

Browse files
committed
temp fix for mm32 redundant-decls of SystemCoreClock
1 parent 4977853 commit a9f1c62

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

hw/bsp/mm32/family.c

+16-8
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@
3030
#include "bsp/board_api.h"
3131
#include "board.h"
3232

33+
//--------------------------------------------------------------------+
34+
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
35+
//--------------------------------------------------------------------+
36+
37+
#ifdef __GNUC__ // caused by extra declaration of SystemCoreClock in freeRTOSConfig.h
38+
#pragma GCC diagnostic push
39+
#pragma GCC diagnostic ignored "-Wredundant-decls"
40+
#endif
41+
42+
extern u32 SystemCoreClock;
43+
44+
#ifdef __GNUC__
45+
#pragma GCC diagnostic pop
46+
#endif
47+
3348
//--------------------------------------------------------------------+
3449
// Forward USB interrupt events to TinyUSB IRQ Handler
3550
//--------------------------------------------------------------------+
@@ -46,19 +61,12 @@ void USB_DeviceClockInit(void) {
4661
/* Enable USB clock */
4762
RCC->AHB2ENR |= 0x1 << 7;
4863
}
49-
//--------------------------------------------------------------------+
50-
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
51-
//--------------------------------------------------------------------+
52-
53-
extern u32 SystemCoreClock;
5464

5565
void board_init(void) {
5666
// usb clock
5767
USB_DeviceClockInit();
5868

59-
if (SysTick_Config(SystemCoreClock / 1000)) {
60-
while (1);
61-
}
69+
SysTick_Config(SystemCoreClock / 1000);
6270
NVIC_SetPriority(SysTick_IRQn, 0x0);
6371

6472
RCC_AHBPeriphClockCmd(RCC_AHBENR_GPIOA, ENABLE);

src/portable/mindmotion/mm32/dcd_mm32f327x_otg.c

+11
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,18 @@ void dcd_set_address(uint8_t rhport, uint8_t dev_addr)
283283
/* Response with status first before changing device address */
284284
dcd_edpt_xfer(rhport, tu_edpt_addr(0, TUSB_DIR_IN), NULL, 0);
285285
}
286+
287+
#ifdef __GNUC__ // caused by extra declaration of SystemCoreClock in freeRTOSConfig.h
288+
#pragma GCC diagnostic push
289+
#pragma GCC diagnostic ignored "-Wredundant-decls"
290+
#endif
291+
286292
extern u32 SystemCoreClock;
293+
294+
#ifdef __GNUC__
295+
#pragma GCC diagnostic pop
296+
#endif
297+
287298
void dcd_remote_wakeup(uint8_t rhport)
288299
{
289300
(void) rhport;

0 commit comments

Comments
 (0)