Skip to content

Commit 644e355

Browse files
committed
Removed class Hardware
- Makes it easier to support FreeRTOS - Makes it easier to support GD32 ARM firmware -> https://www.gd32-dmx.org/github.html
1 parent cd85cce commit 644e355

File tree

234 files changed

+574
-968
lines changed

Some content is hidden

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

234 files changed

+574
-968
lines changed
Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* @file hardware.h
2+
* @file ctime
33
*
44
*/
5-
/* Copyright (C) 2020-2025 by Arjan van Vught mailto:[email protected]
5+
/* Copyright (C) 2025 by Arjan van Vught mailto:[email protected]
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
@@ -23,19 +23,32 @@
2323
* THE SOFTWARE.
2424
*/
2525

26-
#ifndef H3_HARDWARE_H_
27-
#define H3_HARDWARE_H_
26+
#ifndef CTIME_
27+
#define CTIME_
2828

29-
class Hardware {
30-
public:
31-
Hardware();
29+
#include <time.h>
3230

33-
static Hardware *Get() {
34-
return s_pThis;
35-
}
31+
// Get rid of those macros defined in <time.h> in lieu of real functions.
32+
#undef time
33+
#undef mktime
34+
#undef gmtime
35+
#undef localtime
36+
#undef asctime
3637

37-
private:
38-
static inline Hardware *s_pThis;
39-
};
38+
#undef clock_getres
39+
#undef clock_gettime
40+
#undef clock_settime
4041

41-
#endif /* H3_HARDWARE_H_ */
42+
namespace std {
43+
using ::time;
44+
using ::mktime;
45+
using ::gmtime;
46+
using ::localtime;
47+
using ::asctime;
48+
49+
using ::clock_getres;
50+
using ::clock_gettime;
51+
using ::clock_settime;
52+
}
53+
54+
#endif /* CTIME_ */

include/time.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file time.h
33
*
44
*/
5-
/* Copyright (C) 2017-2024 by Arjan van Vught mailto:info@orangepi-dmx.nl
5+
/* Copyright (C) 2017-2025 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

lib-artnet/.settings/language.settings.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
66
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
77
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="([^/\\\\]*)((g?cc)|([gc]\+\+)|(clang))" prefer-non-shared="true"/>
8-
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-868621165313389684" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
8+
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-938232512982609960" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
99
<language-scope id="org.eclipse.cdt.core.gcc"/>
1010
<language-scope id="org.eclipse.cdt.core.g++"/>
1111
</provider>
@@ -17,7 +17,7 @@
1717
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
1818
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
1919
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
20-
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-868621165313389684" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
20+
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-938232512982609960" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
2121
<language-scope id="org.eclipse.cdt.core.gcc"/>
2222
<language-scope id="org.eclipse.cdt.core.g++"/>
2323
</provider>
@@ -26,7 +26,7 @@
2626
</configuration>
2727
<configuration id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.base.309283989.303033930.1702909156.1968016134.361802700" name="H3">
2828
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
29-
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="true" env-hash="1336034927518546206" id="org.eclipse.embedcdt.managedbuild.cross.arm.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Arm Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
29+
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="true" env-hash="1898895772183673938" id="org.eclipse.embedcdt.managedbuild.cross.arm.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Arm Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
3030
<language-scope id="org.eclipse.cdt.core.gcc"/>
3131
<language-scope id="org.eclipse.cdt.core.g++"/>
3232
</provider>

lib-artnet/include/artnetcontroller.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file artnetcontroller.h
33
*
44
*/
5-
/* Copyright (C) 2017-2024 by Arjan van Vught mailto:[email protected]
5+
/* Copyright (C) 2017-2025 by Arjan van Vught mailto:[email protected]
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
@@ -161,7 +161,7 @@ class ArtNetController: public ArtNetPollTable {
161161
#ifdef CONFIG_ARTNET_CONTROLLER_ENABLE_MASTER
162162
uint32_t m_nMaster { dmxnode::DMX_MAX_VALUE };
163163
#endif
164-
static ArtNetController *s_pThis;
164+
static inline ArtNetController *s_pThis;
165165
};
166166

167167
#endif /* ARTNETCONTROLLER_H_ */

lib-artnet/include/artnetnode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
#include "dmxnode_data.h"
7070
#include "dmxnode_outputtype.h"
7171

72-
#include "hardware.h"
72+
#include "hal.h"
7373
#include "network.h"
7474
#include "softwaretimers.h"
7575

lib-artnet/src/controller/artnetcontroller.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/**
22
* @file artnetcontroller.cpp
3-
*
43
*/
5-
/* Copyright (C) 2017-2024 by Arjan van Vught mailto:[email protected]
4+
/* Copyright (C) 2017-2025 by Arjan van Vught mailto:[email protected]
65
*
76
* Permission is hereby granted, free of charge, to any person obtaining a copy
87
* of this software and associated documentation files (the "Software"), to deal
@@ -37,13 +36,11 @@
3736
# include "e131.h"
3837
#endif
3938

40-
#include "hardware.h"
39+
#include "hal.h"
4140
#include "network.h"
4241

4342
#include "debug.h"
4443

45-
ArtNetController *ArtNetController::s_pThis;
46-
4744
using namespace artnet;
4845

4946
static constexpr uint32_t ARTNET_MIN_HEADER_SIZE = 12;

lib-artnet/src/controller/artnetpolltable.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
/**
22
* @file artnetpolltable.cpp
3-
*
4-
*/
5-
/**
6-
* Art-Net Designed by and Copyright Artistic Licence Holdings Ltd.
73
*/
8-
/* Copyright (C) 2017-2024 by Arjan van Vught mailto:[email protected]
4+
/* Copyright (C) 2017-2025 by Arjan van Vught mailto:[email protected]
95
*
106
* Permission is hereby granted, free of charge, to any person obtaining a copy
117
* of this software and associated documentation files (the "Software"), to deal
@@ -40,7 +36,7 @@
4036

4137
#include "artnetpolltable.h"
4238

43-
#include "hardware.h"
39+
#include "hal.h"
4440
#include "network.h"
4541

4642
#include "debug.h"
@@ -78,6 +74,8 @@ ArtNetPollTable::ArtNetPollTable() {
7874
}
7975

8076
ArtNetPollTable::~ArtNetPollTable() {
77+
DEBUG_ENTRY
78+
8179
for (uint32_t nIndex = 0; nIndex < artnet::POLL_TABLE_SIZE_UNIVERSES; nIndex++) {
8280
delete[] m_pTableUniverses[nIndex].pIpAddresses;
8381
m_pTableUniverses[nIndex].pIpAddresses = nullptr;
@@ -88,6 +86,8 @@ ArtNetPollTable::~ArtNetPollTable() {
8886

8987
delete[] m_pPollTable;
9088
m_pPollTable = nullptr;
89+
90+
DEBUG_EXIT
9191
}
9292

9393
const struct artnet::PollTableUniverses *ArtNetPollTable::GetIpAddress(uint16_t nUniverse) const {

lib-artnet/src/node/artnetnode.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@ void record(const struct artnet::ArtSync *pArtSync, const uint32_t nMillis);
5353
} // namespace showfile
5454
#endif
5555

56+
#include "artnetnode_internal.h"
57+
5658
#include "dmxnode.h"
5759
#include "dmxnodedata.h"
5860

59-
#include "hardware.h"
6061
#include "network.h"
6162
#include "softwaretimers.h"
6263

64+
#include "hal_statusled.h"
6365
#include "panel_led.h"
6466

65-
#include "artnetnode_internal.h"
66-
6767
#include "debug.h"
6868

6969
static constexpr auto ARTNET_MIN_HEADER_SIZE = 12;

lib-artnet/src/node/artnetnodehandleaddress.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434

3535
#include "dmxnodedata.h"
3636
#include "dmxnode_data.h"
37-
#include "hardware.h"
37+
38+
#include "hal_statusled.h"
3839

3940
#include "debug.h"
4041

lib-artnet/src/node/artnetnodehandlepoll.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
/**
22
* @file artnetnodehandlepoll.cpp
3-
*
4-
*/
5-
/**
6-
* Art-Net Designed by and Copyright Artistic Licence Holdings Ltd.
73
*/
8-
/* Copyright (C) 2021-2024 by Arjan van Vught mailto:[email protected]
4+
/* Copyright (C) 2021-2025 by Arjan van Vught mailto:[email protected]
95
*
106
* Permission is hereby granted, free of charge, to any person obtaining a copy
117
* of this software and associated documentation files (the "Software"), to deal
@@ -49,7 +45,7 @@
4945

5046
#include "artnetnode_internal.h"
5147

52-
#include "hardware.h"
48+
#include "hal.h"
5349
#include "network.h"
5450

5551
#include "debug.h"

0 commit comments

Comments
 (0)