Skip to content

Commit bc856f0

Browse files
committed
Bump copyrights, remove prefetch pragma
Remove the GCC -fprefetch-loop-arrays optimization from multiple sources, update copyright years to 2026, and apply minor code cleanups. Changes include: rename local variable type->kType, small whitespace/indentation and include formatting fixes, collapse Sync() to a one-line implementation, and reorder RDM-related conditionals in lib-pixeldmx/Rules.mk. Files touched: lib-display/include/i2c/display.h, lib-display/include/spi/display.h, lib-hal/superloop/softwaretimers.cpp, lib-pixel/include/pixel.h, lib-pixel/src/pixel/pixeloutput.cpp, lib-pixeldmx/Rules.mk, lib-pixeldmx/include/pixeldmx.h.
1 parent 83dcf34 commit bc856f0

7 files changed

Lines changed: 22 additions & 27 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-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-pixel/include/pixel.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @file pixel.h
33
*/
4-
/* Copyright (C) 2024-2025 by Arjan van Vught mailto:info@gd32-dmx.org
4+
/* Copyright (C) 2024-2026 by Arjan van Vught mailto:info@gd32-dmx.org
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -28,7 +28,6 @@
2828
#pragma GCC push_options
2929
#pragma GCC optimize("O3")
3030
#pragma GCC optimize("no-tree-loop-distribute-patterns")
31-
#pragma GCC optimize("-fprefetch-loop-arrays")
3231

3332
#include <cstdint>
3433
#include <cassert>
@@ -109,9 +108,9 @@ inline void SetPixelColour([[maybe_unused]] uint32_t port_index, uint32_t pixel_
109108
}
110109
#else // !PIXELPATTERNS_MULTI
111110
auto& pixel_configuration = PixelConfiguration::Get();
112-
const auto type = pixel_configuration.GetType();
111+
const auto kType = pixel_configuration.GetType();
113112

114-
if (type != pixel::Type::SK6812W)
113+
if (kType != pixel::Type::SK6812W)
115114
{
116115
output_type->SetPixel(pixel_index, kColours.Red(), kColours.Green(), kColours.Blue());
117116
}
@@ -157,4 +156,4 @@ inline void Update()
157156

158157
#pragma GCC pop_options
159158

160-
#endif // PIXEL_H_
159+
#endif // PIXEL_H_

lib-pixel/src/pixel/pixeloutput.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @file pixeloutput.cpp
33
*/
4-
/* Copyright (C) 2017-2025 by Arjan van Vught mailto:info@gd32-dmx.org
4+
/* Copyright (C) 2017-2026 by Arjan van Vught mailto:info@gd32-dmx.org
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -30,7 +30,6 @@
3030
#pragma GCC push_options
3131
#pragma GCC optimize("O3")
3232
#pragma GCC optimize("-funroll-loops")
33-
#pragma GCC optimize("-fprefetch-loop-arrays")
3433
#endif
3534

3635
#include <cstdint>

lib-pixeldmx/Rules.mk

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,24 @@ EXTRA_INCLUDES+=../lib-network/include
66
EXTRA_SRCDIR+=src/json
77

88
ifneq ($(MAKE_FLAGS),)
9-
ifneq (,$(findstring NODE_RDMNET_LLRP_ONLY,$(MAKE_FLAGS)))
10-
EXTRA_INCLUDES+=../lib-rdm/include
11-
endif
129
ifeq ($(findstring OUTPUT_DMX_SEND,$(MAKE_FLAGS)), OUTPUT_DMX_SEND)
1310
EXTRA_INCLUDES+=../lib-dmx/include
1411
endif
12+
1513
ifneq (,$(findstring CONFIG_RDM_ENABLE_MANUFACTURER_PIDS,$(MAKE_FLAGS)))
1614
EXTRA_INCLUDES+=../lib-rdm/include
1715
EXTRA_SRCDIR+=src/pixeldmxrdm
1816
endif
17+
18+
ifneq (,$(findstring NODE_RDMNET_LLRP_ONLY,$(MAKE_FLAGS)))
19+
EXTRA_INCLUDES+=../lib-rdm/include
20+
endif
21+
1922
ifeq ($(findstring RDM_RESPONDER,$(MAKE_FLAGS)), RDM_RESPONDER)
2023
EXTRA_SRCDIR+=src/pixeldmxparams
2124
EXTRA_INCLUDES+=../lib-rdm/include
2225
endif
26+
2327
ifeq ($(findstring CONFIG_RDM_ENABLE_SENSORS,$(MAKE_FLAGS)), CONFIG_RDM_ENABLE_SENSORS)
2428
EXTRA_INCLUDES+=../lib-rdmsensor/include
2529
endif

lib-pixeldmx/include/pixeldmx.h

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @file pixeldmx.h
33
*/
4-
/* Copyright (C) 2016-2025 by Arjan van Vught mailto:info@gd32-dmx.org
4+
/* Copyright (C) 2016-2026 by Arjan van Vught mailto:info@gd32-dmx.org
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -36,7 +36,6 @@
3636
#pragma GCC push_options
3737
#pragma GCC optimize("O3")
3838
#pragma GCC optimize("no-tree-loop-distribute-patterns")
39-
#pragma GCC optimize("-fprefetch-loop-arrays")
4039
#endif
4140

4241
#include <cstdint>
@@ -50,7 +49,7 @@
5049
#include "hal_gpio.h"
5150
#endif
5251
#include "dmxnode.h"
53-
#include "firmware/debug/debug_debug.h"
52+
#include "firmware/debug/debug_debug.h"
5453

5554
#if defined(OUTPUT_DMX_PIXEL) && defined(RDM_RESPONDER) && !defined(NODE_ARTNET)
5655
#include "dmxnodeoutputrdmpixel.h"
@@ -97,7 +96,7 @@ class PixelDmx final : public PixelDmxConfiguration
9796
PixelDmxConfiguration::Print();
9897
#endif
9998

100-
output_type_.ApplyConfiguration();
99+
output_type_.ApplyConfiguration();
101100
output_type_.Blackout();
102101

103102
DEBUG_EXIT();
@@ -146,7 +145,7 @@ class PixelDmx final : public PixelDmxConfiguration
146145

147146
if (output_type_.IsUpdating())
148147
{
149-
puts("output_type_.IsUpdating()");
148+
puts("output_type_.IsUpdating()");
150149
return;
151150
}
152151

@@ -169,7 +168,7 @@ class PixelDmx final : public PixelDmxConfiguration
169168

170169
if ((kSwitch == 0) && (kGroups < port_info.begin_index_port[1]))
171170
{
172-
assert(PixelDmxConfiguration::GetDmxStartAddress() != 0);
171+
assert(PixelDmxConfiguration::GetDmxStartAddress() != 0);
173172
d = (PixelDmxConfiguration::GetDmxStartAddress() - 1U);
174173
}
175174

@@ -294,10 +293,7 @@ class PixelDmx final : public PixelDmxConfiguration
294293

295294
void Sync([[maybe_unused]] uint32_t port_index) {}
296295

297-
void Sync()
298-
{
299-
output_type_.Update();
300-
}
296+
void Sync() { output_type_.Update(); }
301297

302298
#if defined(OUTPUT_HAVE_STYLESWITCH)
303299
void SetOutputStyle([[maybe_unused]] uint32_t port_index, [[maybe_unused]] dmxnode::OutputStyle output_style) {}
@@ -426,4 +422,4 @@ class PixelDmx final : public PixelDmxConfiguration
426422
#define NDEBUG
427423
#endif
428424

429-
#endif // PIXELDMX_H_
425+
#endif // PIXELDMX_H_

0 commit comments

Comments
 (0)