Skip to content

Commit 41945fd

Browse files
committed
Remove -fprefetch pragma and adjust build
Removed GCC pragma "-fprefetch-loop-arrays" from multiple source/header files to avoid the optimization (i2c/display.h, spi/display.h, lib-e131 e131bridge.cpp, lib-hal softwaretimers.cpp). Updated copyright year in spi/display.h (2022-2026) and minor whitespace/formatting cleanups (include spacing, #endif comment style, and conditional formatting around LLRPDevice::Print). Changed Rules.mk logic so ../lib-rdm/include is only added when NODE_RDMNET_LLRP_ONLY and RDM are both present in MAKE_FLAGS (ensures lib-rdm is only pulled in when RDM is requested).
1 parent 5e57bf6 commit 41945fd

5 files changed

Lines changed: 13 additions & 15 deletions

File tree

lib-display/include/i2c/display.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#pragma GCC optimize("O3")
4040
#endif
4141
#pragma GCC optimize("no-tree-loop-distribute-patterns")
42-
#pragma GCC optimize("-fprefetch-loop-arrays")
4342
#endif
4443
#endif
4544

lib-display/include/spi/display.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file display.h
33
*
44
*/
5-
/* Copyright (C) 2022-2025 by Arjan van Vught mailto:info@gd32-dmx.org
5+
/* Copyright (C) 2022-2026 by Arjan van Vught mailto:info@gd32-dmx.org
66
*
77
* Permission is hereby granted, free of charge, to any person obtaining a copy
88
* of this software and associated documentation files (the "Software"), to deal
@@ -39,7 +39,6 @@
3939
#pragma GCC optimize("O3")
4040
#endif
4141
#pragma GCC optimize("no-tree-loop-distribute-patterns")
42-
#pragma GCC optimize("-fprefetch-loop-arrays")
4342
#endif
4443
#endif
4544

@@ -70,7 +69,7 @@ inline constexpr uint32_t CS_GPIO = SPI_LCD_CS_GPIO;
7069
inline constexpr uint32_t CS_GPIO = 0;
7170
#endif
7271

73-
#include "firmware/debug/debug_debug.h"
72+
#include "firmware/debug/debug_debug.h"
7473

7574
class Display : public LcdDriver
7675
{
@@ -356,4 +355,4 @@ class Display : public LcdDriver
356355
#endif
357356
#endif
358357

359-
#endif // SPI_DISPLAY_H_
358+
#endif // SPI_DISPLAY_H_

lib-e131/src/node/e131bridge.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -499,17 +499,16 @@ void E131Bridge::Print()
499499
{
500500
printf(" Synchronize is disabled\n");
501501
}
502-
503-
#if defined (NODE_RDMNET_LLRP_ONLY)
504-
LLRPDevice::Print();
505-
#endif
502+
503+
#if defined(NODE_RDMNET_LLRP_ONLY)
504+
LLRPDevice::Print();
505+
#endif
506506
}
507507

508508
#if defined(__GNUC__) && !defined(__clang__)
509509
#pragma GCC push_options
510510
#pragma GCC optimize("O2")
511511
#pragma GCC optimize("no-tree-loop-distribute-patterns")
512-
#pragma GCC optimize("-fprefetch-loop-arrays")
513512
#endif
514513

515514
static bool IsValidRoot(const uint8_t* buffer)

lib-hal/superloop/softwaretimers.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#pragma GCC optimize("O3")
3232
#pragma GCC optimize("no-tree-loop-distribute-patterns")
3333
#pragma GCC optimize("-funroll-loops")
34-
#pragma GCC optimize("-fprefetch-loop-arrays")
3534
#endif
3635
#endif
3736

lib-showfile/Rules.mk

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ ifneq ($(MAKE_FLAGS),)
3535
ARTNET=1
3636
endif
3737

38-
ifneq (,$(findstring NODE_RDMNET_LLRP_ONLY,$(MAKE_FLAGS)))
39-
EXTRA_INCLUDES+=../lib-rdm/include
40-
endif
41-
4238
ifdef E131
4339
EXTRA_INCLUDES+=../lib-e131/include
4440
EXTRA_INCLUDES+=../lib-dmx/include
@@ -51,6 +47,12 @@ ifneq ($(MAKE_FLAGS),)
5147
EXTRA_INCLUDES+=../lib-rdm/include ../lib-dmx/include
5248
endif
5349
endif
50+
51+
ifneq (,$(findstring NODE_RDMNET_LLRP_ONLY,$(MAKE_FLAGS)))
52+
ifneq (,$(findstring RDM,$(MAKE_FLAGS)))
53+
EXTRA_INCLUDES+=../lib-rdm/include
54+
endif
55+
endif
5456
else
5557
EXTRA_SRCDIR+=src/display
5658
EXTRA_SRCDIR+=src/formats/ola

0 commit comments

Comments
 (0)