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 24, 2023
1 parent 92f05a9 commit b3dd42d
Show file tree
Hide file tree
Showing 29 changed files with 92 additions and 181 deletions.
18 changes: 8 additions & 10 deletions gd32_emac_artnet_pixel_dmx_multi/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,14 @@ void main() {
display.Set(4, displayudf::Labels::UNIVERSE_PORT_A);
display.Set(5, displayudf::Labels::DMX_DIRECTION);

StoreDisplayUdf storeDisplayUdf;
DisplayUdfParams displayUdfParams(&storeDisplayUdf);
DisplayUdfParams displayUdfParams;

if (displayUdfParams.Load()) {
displayUdfParams.Dump();
displayUdfParams.Set(&display);
}
displayUdfParams.Load();
displayUdfParams.Dump();
displayUdfParams.Set(&display);

display.Show(&node, DMXPORT_OFFSET);

display.Printf(7, "%s:%d G%d %s",
PixelType::GetType(pixelDmxConfiguration.GetType()),
pixelDmxConfiguration.GetCount(),
Expand All @@ -270,10 +269,9 @@ void main() {
StoreRemoteConfig storeRemoteConfig;
RemoteConfigParams remoteConfigParams(&storeRemoteConfig);

if(remoteConfigParams.Load()) {
remoteConfigParams.Dump();
remoteConfigParams.Set(&remoteConfig);
}
remoteConfigParams.Load();
remoteConfigParams.Dump();
remoteConfigParams.Set(&remoteConfig);

while (configStore.Flash())
;
Expand Down
18 changes: 8 additions & 10 deletions gd32_emac_artnet_pixel_multi/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,14 @@ void main() {
display.Set(4, displayudf::Labels::UNIVERSE_PORT_A);
display.Set(5, displayudf::Labels::BOARDNAME);

StoreDisplayUdf storeDisplayUdf;
DisplayUdfParams displayUdfParams(&storeDisplayUdf);
DisplayUdfParams displayUdfParams;

if (displayUdfParams.Load()) {
displayUdfParams.Dump();
displayUdfParams.Set(&display);
}
displayUdfParams.Load();
displayUdfParams.Dump();
displayUdfParams.Set(&display);

display.Show(&node, DMXPORT_OFFSET);

display.Printf(7, "%s:%d G%d %s",
PixelType::GetType(pixelDmxConfiguration.GetType()),
pixelDmxConfiguration.GetCount(),
Expand All @@ -222,10 +221,9 @@ void main() {
StoreRemoteConfig storeRemoteConfig;
RemoteConfigParams remoteConfigParams(&storeRemoteConfig);

if(remoteConfigParams.Load()) {
remoteConfigParams.Dump();
remoteConfigParams.Set(&remoteConfig);
}
remoteConfigParams.Load();
remoteConfigParams.Dump();
remoteConfigParams.Set(&remoteConfig);

while (configStore.Flash())
;
Expand Down
18 changes: 8 additions & 10 deletions gd32_emac_ddp_pixel_dmx_multi/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,14 @@ void main() {
display.Set(5, displayudf::Labels::DEFAULT_GATEWAY);
display.Set(6, displayudf::Labels::DMX_DIRECTION);

StoreDisplayUdf storeDisplayUdf;
DisplayUdfParams displayUdfParams(&storeDisplayUdf);
DisplayUdfParams displayUdfParams;

if (displayUdfParams.Load()) {
displayUdfParams.Dump();
displayUdfParams.Set(&display);
}
displayUdfParams.Load();
displayUdfParams.Dump();
displayUdfParams.Set(&display);

display.Show();

display.Printf(7, "%s:%d G%d %s",
PixelType::GetType(pixelDmxConfiguration.GetType()),
pixelDmxConfiguration.GetCount(),
Expand All @@ -214,10 +213,9 @@ void main() {
StoreRemoteConfig storeRemoteConfig;
RemoteConfigParams remoteConfigParams(&storeRemoteConfig);

if(remoteConfigParams.Load()) {
remoteConfigParams.Dump();
remoteConfigParams.Set(&remoteConfig);
}
remoteConfigParams.Load();
remoteConfigParams.Dump();
remoteConfigParams.Set(&remoteConfig);

while (configStore.Flash())
;
Expand Down
18 changes: 8 additions & 10 deletions gd32_emac_ddp_pixel_multi/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,14 @@ void main() {
display.Set(5, displayudf::Labels::DEFAULT_GATEWAY);
display.Set(6, displayudf::Labels::BOARDNAME);

StoreDisplayUdf storeDisplayUdf;
DisplayUdfParams displayUdfParams(&storeDisplayUdf);
DisplayUdfParams displayUdfParams;

if (displayUdfParams.Load()) {
displayUdfParams.Dump();
displayUdfParams.Set(&display);
}
displayUdfParams.Load();
displayUdfParams.Dump();
displayUdfParams.Set(&display);

display.Show();

display.Printf(7, "%s:%d G%d %s",
PixelType::GetType(pixelDmxConfiguration.GetType()),
pixelDmxConfiguration.GetCount(),
Expand All @@ -186,10 +185,9 @@ void main() {
StoreRemoteConfig storeRemoteConfig;
RemoteConfigParams remoteConfigParams(&storeRemoteConfig);

if(remoteConfigParams.Load()) {
remoteConfigParams.Dump();
remoteConfigParams.Set(&remoteConfig);
}
remoteConfigParams.Load();
remoteConfigParams.Dump();
remoteConfigParams.Set(&remoteConfig);

while (configStore.Flash())
;
Expand Down
18 changes: 8 additions & 10 deletions gd32_emac_e131_pixel_dmx_multi/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,14 @@ void main() {
display.Set(5, displayudf::Labels::DEFAULT_GATEWAY);
display.Set(6, displayudf::Labels::DMX_DIRECTION);

StoreDisplayUdf storeDisplayUdf;
DisplayUdfParams displayUdfParams(&storeDisplayUdf);
DisplayUdfParams displayUdfParams;

if (displayUdfParams.Load()) {
displayUdfParams.Dump();
displayUdfParams.Set(&display);
}
displayUdfParams.Load();
displayUdfParams.Dump();
displayUdfParams.Set(&display);

display.Show(&bridge, DMXPORT_OFFSET);

display.Printf(7, "%s:%d G%d %s",
PixelType::GetType(pixelDmxConfiguration.GetType()),
pixelDmxConfiguration.GetCount(),
Expand All @@ -266,10 +265,9 @@ void main() {
StoreRemoteConfig storeRemoteConfig;
RemoteConfigParams remoteConfigParams(&storeRemoteConfig);

if(remoteConfigParams.Load()) {
remoteConfigParams.Dump();
remoteConfigParams.Set(&remoteConfig);
}
remoteConfigParams.Load();
remoteConfigParams.Dump();
remoteConfigParams.Set(&remoteConfig);

while (configStore.Flash())
;
Expand Down
18 changes: 8 additions & 10 deletions gd32_emac_e131_pixel_multi/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,14 @@ void main() {
display.Set(5, displayudf::Labels::UNIVERSE_PORT_A);
display.Set(6, displayudf::Labels::BOARDNAME);

StoreDisplayUdf storeDisplayUdf;
DisplayUdfParams displayUdfParams(&storeDisplayUdf);
DisplayUdfParams displayUdfParams;

if (displayUdfParams.Load()) {
displayUdfParams.Dump();
displayUdfParams.Set(&display);
}
displayUdfParams.Load();
displayUdfParams.Dump();
displayUdfParams.Set(&display);

display.Show(&bridge);

display.Printf(7, "%s:%d G%d %s",
PixelType::GetType(pixelDmxConfiguration.GetType()),
pixelDmxConfiguration.GetCount(),
Expand All @@ -214,10 +213,9 @@ void main() {
StoreRemoteConfig storeRemoteConfig;
RemoteConfigParams remoteConfigParams(&storeRemoteConfig);

if (remoteConfigParams.Load()) {
remoteConfigParams.Dump();
remoteConfigParams.Set(&remoteConfig);
}
remoteConfigParams.Load();
remoteConfigParams.Dump();
remoteConfigParams.Set(&remoteConfig);

while (configStore.Flash())
;
Expand Down
18 changes: 0 additions & 18 deletions lib-configstore/Rules.mk
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ ifneq ($(MAKE_FLAGS),)
EXTRA_INCLUDES+=../lib-remoteconfig/include
endif

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

ifeq ($(findstring NODE_ARTNET,$(MAKE_FLAGS)), NODE_ARTNET)
EXTRA_SRCDIR+=src/artnet
EXTRA_INCLUDES+=../lib-artnet/include
Expand All @@ -57,14 +52,6 @@ ifneq ($(MAKE_FLAGS),)
EXTRA_INCLUDES+=../lib-e131/include
endif

ifeq ($(findstring NODE_LTC_SMPTE,$(MAKE_FLAGS)), NODE_LTC_SMPTE)
EXTRA_SRCDIR+=src/ltc
EXTRA_INCLUDES+=../lib-ltc/include ../lib-tcnet/include
EXTRA_INCLUDES+=../lib-gps/include
EXTRA_INCLUDES+=../lib-rgbpanel/include
EXTRA_INCLUDES+=../lib-ws28xx/include
endif

ifeq ($(findstring NODE_NODE,$(MAKE_FLAGS)), NODE_NODE)
EXTRA_SRCDIR+=src/node
EXTRA_INCLUDES+=../lib-node/include ../lib-artnet/include ../lib-e131/include
Expand Down Expand Up @@ -122,10 +109,6 @@ else
EXTRA_INCLUDES+=../lib-e131/include
EXTRA_SRCDIR+=src/node
EXTRA_INCLUDES+=../lib-node/include ../lib-rdmdiscovery/include
EXTRA_SRCDIR+=src/ltc
EXTRA_INCLUDES+=../lib-ltc/include ../lib-tcnet/include
EXTRA_INCLUDES+=../lib-gps/include
EXTRA_INCLUDES+=../lib-rgbpanel/include
endif

EXTRA_INCLUDES+=../lib-ws28xx/include
Expand All @@ -139,6 +122,5 @@ else
endif

EXTRA_INCLUDES+=../lib-displayudf/include ../lib-display/include
EXTRA_INCLUDES+=../lib-dmxsend/include
EXTRA_INCLUDES+=../lib-dmxreceiver/include ../lib-dmx/include
EXTRA_INCLUDES+=../lib-device/include
Empty file modified lib-configstore/device/i2c/storedevice.cpp
100644 → 100755
Empty file.
Empty file modified lib-configstore/device/rom/storedevice.cpp
100644 → 100755
Empty file.
Empty file modified lib-configstore/device/spi/storedevice.cpp
100644 → 100755
Empty file.
Empty file modified lib-configstore/include/configstore.h
100644 → 100755
Empty file.
Empty file modified lib-configstore/include/storeartnet.h
100644 → 100755
Empty file.
Empty file modified lib-configstore/include/storedevice.h
100644 → 100755
Empty file.
Empty file modified lib-configstore/include/storee131.h
100644 → 100755
Empty file.
Empty file modified lib-configstore/include/storenetwork.h
100644 → 100755
Empty file.
Empty file modified lib-configstore/include/storepixeldmx.h
100644 → 100755
Empty file.
Empty file modified lib-configstore/include/storeremoteconfig.h
100644 → 100755
Empty file.
Empty file modified lib-configstore/src/artnet/storeartnet.cpp
100644 → 100755
Empty file.
Empty file modified lib-configstore/src/configstore.cpp
100644 → 100755
Empty file.
Empty file modified lib-configstore/src/e131/storee131.cpp
100644 → 100755
Empty file.
Empty file modified lib-configstore/src/pixel/storepixeldmx.cpp
100644 → 100755
Empty file.
Empty file modified lib-configstore/src/platform_configstore.h
100644 → 100755
Empty file.
42 changes: 0 additions & 42 deletions lib-configstore/src/storedisplayudf.cpp

This file was deleted.

13 changes: 2 additions & 11 deletions lib-displayudf/include/displayudfparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,11 @@ struct Mask {
};
} // namespace displayudfparams

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

virtual void Update(const struct displayudfparams::Params *ptDisplayUdfParams)=0;
virtual void Copy(struct displayudfparams::Params *ptDisplayUdfParams)=0;
};

class DisplayUdfParams {
public:
DisplayUdfParams(DisplayUdfParamsStore *pDisplayUdfParamsStore);
DisplayUdfParams();

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

void Builder(const struct displayudfparams::Params *ptDisplayUdfParams, char *pBuffer, uint32_t nLength, uint32_t& nSize);
Expand All @@ -81,7 +73,6 @@ class DisplayUdfParams {
}

private:
DisplayUdfParamsStore *m_pDisplayUdfParamsStore;
displayudfparams::Params m_tDisplayUdfParams;
};

Expand Down
28 changes: 16 additions & 12 deletions lib-configstore/include/storedisplayudf.h → lib-displayudf/include/storedisplayudf.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @file storedisplayudf.h
*
*/
/* Copyright (C) 2019-2022 by Arjan van Vught mailto:[email protected]
/* Copyright (C) 2019-2023 by Arjan van Vught mailto:[email protected]
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -27,27 +27,31 @@
#define STOREDISPLAYUDF_H_

#include "displayudfparams.h"

#include "configstore.h"

class StoreDisplayUdf final: public DisplayUdfParamsStore {
class StoreDisplayUdf {
public:
StoreDisplayUdf();

void Update(const struct displayudfparams::Params *pDisplayUdfParams) override {
ConfigStore::Get()->Update(configstore::Store::DISPLAYUDF, pDisplayUdfParams, sizeof(struct displayudfparams::Params));
static StoreDisplayUdf& Get() {
static StoreDisplayUdf instance;
return instance;
}

void Copy(struct displayudfparams::Params *pDisplayUdfParams) override {
ConfigStore::Get()->Copy(configstore::Store::DISPLAYUDF, pDisplayUdfParams, sizeof(struct displayudfparams::Params));
static void Update(const struct displayudfparams::Params *pDisplayUdfParams) {
Get().IUpdate(pDisplayUdfParams);
}

static StoreDisplayUdf *Get() {
return s_pThis;
static void Copy(struct displayudfparams::Params *pDisplayUdfParams) {
Get().ICopy(pDisplayUdfParams);
}

private:
static StoreDisplayUdf *s_pThis;
void IUpdate(const struct displayudfparams::Params *pDisplayUdfParams) {
ConfigStore::Get()->Update(configstore::Store::DISPLAYUDF, pDisplayUdfParams, sizeof(struct displayudfparams::Params));
}

void ICopy(struct displayudfparams::Params *pDisplayUdfParams) {
ConfigStore::Get()->Copy(configstore::Store::DISPLAYUDF, pDisplayUdfParams, sizeof(struct displayudfparams::Params));
}
};

#endif /* STOREDISPLAYUDF_H_ */
Loading

0 comments on commit b3dd42d

Please sign in to comment.