Skip to content

Commit

Permalink
Sync with local development
Browse files Browse the repository at this point in the history
  • Loading branch information
vanvught committed Dec 23, 2023
1 parent 572c01a commit 92f05a9
Show file tree
Hide file tree
Showing 19 changed files with 143 additions and 343 deletions.
11 changes: 4 additions & 7 deletions gd32_emac_artnet_pixel_dmx_multi/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,12 @@ void main() {
}
}

StoreDmxSend storeDmxSend;
DmxParams dmxparams(&storeDmxSend);

DmxParams dmxparams;
Dmx dmx;

if (dmxparams.Load()) {
dmxparams.Dump();
dmxparams.Set(&dmx);
}
dmxparams.Load();
dmxparams.Dump();
dmxparams.Set(&dmx);

for (uint32_t nPortIndex = DMXPORT_OFFSET; nPortIndex < artnetnode::MAX_PORTS; nPortIndex++) {
const auto nDmxPortIndex = nPortIndex - DMXPORT_OFFSET;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1703179673;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1702811908;
2 changes: 1 addition & 1 deletion gd32_emac_artnet_pixel_multi/include/sofware_version_id.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1703179698;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1702811908;
11 changes: 4 additions & 7 deletions gd32_emac_ddp_pixel_dmx_multi/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,12 @@ void main() {

// LightSet B - DMX - 2 Universes

StoreDmxSend storeDmxSend;
DmxParams dmxparams(&storeDmxSend);

DmxParams dmxparams;
Dmx dmx;

if (dmxparams.Load()) {
dmxparams.Dump();
dmxparams.Set(&dmx);
}
dmxparams.Load();
dmxparams.Dump();
dmxparams.Set(&dmx);

DmxSend dmxSend;
dmxSend.Print();
Expand Down
2 changes: 1 addition & 1 deletion gd32_emac_ddp_pixel_dmx_multi/include/sofware_version_id.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1703179706;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1702811913;
2 changes: 1 addition & 1 deletion gd32_emac_ddp_pixel_multi/include/sofware_version_id.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1703179714;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1702811915;
11 changes: 4 additions & 7 deletions gd32_emac_e131_pixel_dmx_multi/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,12 @@ void main() {
nDmxUniverses++;
}

StoreDmxSend storeDmxSend;
DmxParams dmxparams(&storeDmxSend);

DmxParams dmxparams;
Dmx dmx;

if (dmxparams.Load()) {
dmxparams.Dump();
dmxparams.Set(&dmx);
}
dmxparams.Load();
dmxparams.Dump();
dmxparams.Set(&dmx);

for (uint32_t nPortIndex = DMXPORT_OFFSET; nPortIndex < e131bridge::MAX_PORTS; nPortIndex++) {
uint16_t nUniverse;
Expand Down
3 changes: 2 additions & 1 deletion gd32_emac_e131_pixel_dmx_multi/include/sofware_version_id.h
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1703179728;
// Generated do 14 sep 2023 12:39:45 CEST
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1694687985;
3 changes: 2 additions & 1 deletion gd32_emac_e131_pixel_multi/include/sofware_version_id.h
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1703179736;
// Generated do 14 sep 2023 12:39:46 CEST
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1694687986;
2 changes: 0 additions & 2 deletions lib-configstore/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
<entry excluding="scr/e131|examples|src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry excluding="dmx|oscclient|rdm|widget|device|ddp|pixel|e131|artnet|stepper|ltc|node" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src/artnet"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src/dmx"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src/e131"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src/pixel"/>
</sourceEntries>
Expand Down Expand Up @@ -181,7 +180,6 @@
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="device/i2c"/>
<entry excluding="dmx|artnet|e131|ltc|node|oscclient|pixel|rdm|stepper|widget" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src/artnet"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src/dmx"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src/e131"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src/pixel"/>
</sourceEntries>
Expand Down
58 changes: 2 additions & 56 deletions lib-configstore/Rules.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
$(info $$MAKE_FLAGS [${MAKE_FLAGS}])

EXTRA_INCLUDES =../lib-flashcode/include
EXTRA_INCLUDES+=../lib-hal/include ../lib-properties/include ../lib-lightset/include ../lib-network/include
EXTRA_INCLUDES=../lib-flashcode/include ../lib-hal/include ../lib-properties/include ../lib-lightset/include ../lib-network/include

ifneq ($(MAKE_FLAGS),)
ifneq (,$(findstring CONFIG_STORE_USE_FILE,$(MAKE_FLAGS)))
Expand Down Expand Up @@ -72,56 +71,16 @@ ifneq ($(MAKE_FLAGS),)
RDM=1
endif

ifeq ($(findstring NODE_OSC_CLIENT,$(MAKE_FLAGS)), NODE_OSC_CLIENT)
EXTRA_SRCDIR+=src/oscclient
EXTRA_INCLUDES+=../lib-oscclient/include
endif

ifeq ($(findstring NODE_OSC_SERVER,$(MAKE_FLAGS)), NODE_OSC_SERVER)
EXTRA_SRCDIR+=src/oscserver
EXTRA_INCLUDES+=../lib-oscserver/include
endif

ifeq ($(findstring OUTPUT_DMX_SEND,$(MAKE_FLAGS)),OUTPUT_DMX_SEND)
EXTRA_SRCDIR+=src/dmx
EXTRA_INCLUDES+=../lib-dmx/include
endif

ifeq ($(findstring OUTPUT_DMX_PIXEL,$(MAKE_FLAGS)), OUTPUT_DMX_PIXEL)
EXTRA_SRCDIR+=src/pixel
EXTRA_INCLUDES+=../lib-ws28xxdmx/include ../lib-ws28xx/include
endif

ifeq ($(findstring OUTPUT_DMX_SHOWFILE,$(MAKE_FLAGS)), OUTPUT_DMX_SHOWFILE)
EXTRA_SRCDIR+=src/showfile
EXTRA_INCLUDES+=../lib-showfile/include
endif

ifeq ($(findstring OUTPUT_DMX_SERIAL,$(MAKE_FLAGS)), OUTPUT_DMX_SERIAL)
EXTRA_SRCDIR+=src/dmxserial
EXTRA_INCLUDES+=../lib-dmxserial/include
endif

ifeq ($(findstring OUTPUT_DMX_STEPPER,$(MAKE_FLAGS)), OUTPUT_DMX_STEPPER)
EXTRA_SRCDIR+=src/stepper
EXTRA_INCLUDES+=../lib-l6470dmx/include ../lib-l6470/include
endif

ifeq ($(findstring OUTPUT_DMX_TLC59711,$(MAKE_FLAGS)), OUTPUT_DMX_TLC59711)
EXTRA_SRCDIR+=src/tlc59711
EXTRA_INCLUDES+=../lib-tlc59711dmx/include ../lib-tlc59711/include
endif

ifeq ($(findstring OUTPUT_DMX_PCA9685,$(MAKE_FLAGS)), OUTPUT_DMX_PCA9685)
EXTRA_SRCDIR+=src/pca9685
EXTRA_INCLUDES+=../lib-pca9685dmx/include ../lib-pca9685/include
endif

ifeq ($(findstring OUTPUT_DMX_MONITOR,$(MAKE_FLAGS)), OUTPUT_DMX_MONITOR)
EXTRA_SRCDIR+=src/dmxmonitor
EXTRA_INCLUDES+=../lib-dmxmonitor/include
endif

ifeq ($(findstring RDM_CONTROLLER,$(MAKE_FLAGS)), RDM_CONTROLLER)
ifdef RDM
else
Expand All @@ -148,13 +107,7 @@ ifneq ($(MAKE_FLAGS),)
endif
endif

ifeq ($(findstring WIDGET_HAVE_FLASHROM,$(MAKE_FLAGS)), WIDGET_HAVE_FLASHROM)
EXTRA_SRCDIR+=src/widget
EXTRA_INCLUDES+=../lib-widget/include
endif

ifdef RDM
EXTRA_SRCDIR+=src/rdm
EXTRA_INCLUDES+=../lib-rdm/include
endif
else
Expand All @@ -176,13 +129,9 @@ else
endif

EXTRA_INCLUDES+=../lib-ws28xx/include
EXTRA_SRCDIR+=src/rdm
EXTRA_INCLUDES+=../lib-rdm/include ../lib-rdmsensor/include ../lib-rdmsubdevice/include
EXTRA_SRCDIR+=src/stepper
EXTRA_INCLUDES+=../lib-l6470dmx/include ../lib-l6470/include
EXTRA_INCLUDES+=../lib-tlc59711dmx/include ../lib-tlc59711/include
EXTRA_SRCDIR+=src/pca9685
EXTRA_INCLUDES+=../lib-pca9685dmx/include ../lib-pca9685/include

DEFINES+=LIGHTSET_PORTS=4
DEFINES+=CONFIG_PIXELDMX_MAX_PORTS=8
Expand All @@ -191,8 +140,5 @@ endif

EXTRA_INCLUDES+=../lib-displayudf/include ../lib-display/include
EXTRA_INCLUDES+=../lib-dmxsend/include
EXTRA_INCLUDES+=../lib-dmxmonitor/include
EXTRA_INCLUDES+=../lib-dmxreceiver/include ../lib-dmx/include
EXTRA_INCLUDES+=../lib-oscserver/include
EXTRA_INCLUDES+=../lib-device/include
EXTRA_INCLUDES+=../lib-midi/include
EXTRA_INCLUDES+=../lib-device/include
53 changes: 0 additions & 53 deletions lib-configstore/include/storemidi.h

This file was deleted.

42 changes: 0 additions & 42 deletions lib-configstore/src/dmx/storedmxsend.cpp

This file was deleted.

27 changes: 9 additions & 18 deletions lib-dmx/include/dmxparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,48 +30,40 @@

#include "dmx.h"

struct TDmxParams {
namespace dmxsendparams {
struct Params {
uint32_t nSetList;
uint16_t nBreakTime;
uint16_t nMabTime;
uint8_t nRefreshRate;
uint8_t nSlotsCount;
}__attribute__((packed));

static_assert(sizeof(struct TDmxParams) <= 32, "struct TDmxParams is too large");
static_assert(sizeof(struct Params) <= 32, "struct Params is too large");

struct DmxParamsMask {
struct Mask {
static constexpr auto BREAK_TIME = (1U << 0);
static constexpr auto MAB_TIME = (1U << 1);
static constexpr auto REFRESH_RATE = (1U << 2);
static constexpr auto SLOTS_COUNT = (1U << 3);
};

namespace dmxparams {
static constexpr uint8_t rounddown_slots(uint16_t n) {
return static_cast<uint8_t>((n / 2U) - 1);
}
static constexpr uint16_t roundup_slots(uint8_t n) {
return static_cast<uint16_t>((n + 1U) * 2U);
}
} // namespace dmxparams

class DmxParamsStore {
public:
virtual ~DmxParamsStore() = default;

virtual void Update(const struct TDmxParams *pDmxParams)=0;
virtual void Copy(struct TDmxParams *pDmxParams)=0;
};
} // namespace dmxsendparams]

class DmxParams {
public:
DmxParams(DmxParamsStore *pDMXParamsStore);
DmxParams();

bool Load();
void Load();
void Load(const char *pBuffer, uint32_t nLength);

void Builder(const struct TDmxParams *pTDmxParams, char *pBuffer, uint32_t nLength, uint32_t& nSize);
void Builder(const struct dmxsendparams::Params *pTDmxParams, char *pBuffer, uint32_t nLength, uint32_t& nSize);
void Save(char *pBuffer, uint32_t nLength, uint32_t& nSize) {
Builder(nullptr, pBuffer, nLength, nSize);
}
Expand All @@ -89,8 +81,7 @@ class DmxParams {
}

private:
DmxParamsStore *m_pDmxParamsStore;
struct TDmxParams m_tDmxParams;
dmxsendparams::Params m_tDmxParams;
};

#endif /* DMXPARAMS_H_ */
Loading

0 comments on commit 92f05a9

Please sign in to comment.