Skip to content

Commit

Permalink
V1.3
Browse files Browse the repository at this point in the history
- lib-devices : Added support for  adc MCP3424
- lib-display : DisplayHandler is now a free function
- lib-hal : Removed class LedBlink. The status led functionality is now in class Hardware
- lib-rdmsensors : Added support for thermistor. Based on https://www.abelectronics.co.uk/p/69/adc-pi-raspberry-pi-analogue-to-digital-converter with https://www.adafruit.com/product/372
  • Loading branch information
vanvught committed Mar 19, 2023
1 parent bf14246 commit 81c6f2e
Show file tree
Hide file tree
Showing 109 changed files with 33,697 additions and 36,941 deletions.
5,484 changes: 2,629 additions & 2,855 deletions Board-tester/gd32f30x.list

Large diffs are not rendered by default.

677 changes: 321 additions & 356 deletions Board-tester/gd32f30x.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions firmware-template-gd32/include/software_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @file software_version.h
*
*/
/* Copyright (C) 2022 by Arjan van Vught mailto:[email protected]
/* Copyright (C) 2022-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 @@ -26,6 +26,6 @@
#ifndef SOFTWARE_VERSION_H_
#define SOFTWARE_VERSION_H_

constexpr char SOFTWARE_VERSION[] = "1.2";
constexpr char SOFTWARE_VERSION[] = "1.3";

#endif /* SOFTWARE_VERSION_H_ */
6 changes: 2 additions & 4 deletions gd32_dmx_usb_pro/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @file main.cpp
*
*/
/* Copyright (C) 2021-2022 by Arjan van Vught mailto:[email protected]
/* Copyright (C) 2021-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 @@ -28,7 +28,6 @@

#include "hardware.h"
#include "network.h"
#include "ledblink.h"
#include "display.h"

#include "widget.h"
Expand All @@ -53,7 +52,6 @@ static constexpr TRDMDeviceInfoData deviceLabel ALIGNED = { const_cast<char*>("G
void main() {
Hardware hw;
Network nw;
LedBlink lb;
Display display; // Not supported, yet.

ConfigStore configStore;
Expand Down Expand Up @@ -103,6 +101,6 @@ void main() {
hw.WatchdogFeed();
widget.Run();
configStore.Flash();
lb.Run();
hw.Run();
}
}
16,126 changes: 8,037 additions & 8,089 deletions gd32_dmx_usb_pro/gd32f30x.list

Large diffs are not rendered by default.

1,744 changes: 856 additions & 888 deletions gd32_dmx_usb_pro/gd32f30x.map

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions gd32_rdm_responder/Makefile.GD32
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
DEFINES=RDM_RESPONDER NO_EMAC

DEFINES+=ENABLE_RDM_SELF_TEST
DEFINES+=CONFIG_PIXELDMX_MAX_PORTS=1

DEFINES+=OUTPUT_DMX_PIXEL
DEFINES+=CONFIG_PIXELDMX_MAX_PORTS=1

DEFINES+=USE_SPI_DMA

DEFINES+=DISPLAY_UDF
DEFINES+=DISABLE_TFTP DISABLE_FS
DEFINES+=DISABLE_FS

DEFINES+=NDEBUG

SRCDIR=firmware lib
Expand Down
77 changes: 55 additions & 22 deletions gd32_rdm_responder/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @file main.cpp
*
*/
/* Copyright (C) 2021-2022 by Arjan van Vught mailto:[email protected]
/* Copyright (C) 2021-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 @@ -28,7 +28,6 @@

#include "hardware.h"
#include "network.h"
#include "ledblink.h"

#include "displayudf.h"
#include "display_timeout.h"
Expand All @@ -37,19 +36,30 @@
#include "rdmpersonality.h"
#include "rdmdeviceparams.h"
#include "rdmsensorsparams.h"
#include "rdmsubdevicesparams.h"
#if defined (ENABLE_RDM_SUBDEVICES)
# include "rdmsubdevicesparams.h"
#endif

#include "pixeldmxparams.h"
#include "ws28xxdmx.h"
#include "pixeldmxstartstop.h"
#include "pixeldmxparamsrdm.h"
#include "pixeltestpattern.h"

#if !defined(NO_EMAC)
# include "remoteconfig.h"
# include "remoteconfigparams.h"
# include "storeremoteconfig.h"
# include "storenetwork.h"
#endif

#include "configstore.h"
#include "storepixeldmx.h"
#include "storerdmdevice.h"
#include "storerdmsensors.h"
#include "storerdmsubdevices.h"
#if defined (ENABLE_RDM_SUBDEVICES)
# include "storerdmsubdevices.h"
#endif
#include "storedisplayudf.h"

#include "firmwareversion.h"
Expand All @@ -64,17 +74,21 @@ void Hardware::RebootHandler() {
void main() {
Hardware hw;
Network nw;
LedBlink lb;
DisplayUdf display;
FirmwareVersion fw(SOFTWARE_VERSION, __DATE__, __TIME__);

ConfigStore configStore;

lb.SetMode(ledblink::Mode::OFF_ON);

const auto isConfigMode = is_config_mode();

fw.Print();
fw.Print("RDM Responder");

#if !defined(NO_EMAC)
StoreNetwork storeNetwork;
nw.SetNetworkStore(&storeNetwork);
nw.Init(&storeNetwork);
nw.Print();
#endif

PixelDmxConfiguration pixelDmxConfiguration;

Expand Down Expand Up @@ -117,6 +131,17 @@ void main() {

PixelDmxParamsRdm pixelDmxParamsRdm(&storePixelDmx);

char aDescription[rdm::personality::DESCRIPTION_MAX_LENGTH];
snprintf(aDescription, sizeof(aDescription) - 1U, "%s:%u G%u [%s]",
PixelType::GetType(pixelDmxConfiguration.GetType()),
pixelDmxConfiguration.GetCount(),
pixelDmxConfiguration.GetGroupingCount(),
PixelType::GetMap(pixelDmxConfiguration.GetMap()));

RDMPersonality *personalities[2] = { new RDMPersonality(aDescription, &pixelDmx), new RDMPersonality("Config mode", &pixelDmxParamsRdm) };

RDMResponder rdmResponder(personalities, 2);

StoreRDMSensors storeRdmSensors;
RDMSensorsParams rdmSensorsParams(&storeRdmSensors);

Expand All @@ -125,24 +150,16 @@ void main() {
rdmSensorsParams.Dump();
}

#if defined (ENABLE_RDM_SUBDEVICES)
StoreRDMSubDevices storeRdmSubDevices;
RDMSubDevicesParams rdmSubDevicesParams(&storeRdmSubDevices);

if (rdmSubDevicesParams.Load()) {
rdmSubDevicesParams.Set();
rdmSubDevicesParams.Dump();
}
#endif

char aDescription[rdm::personality::DESCRIPTION_MAX_LENGTH];
snprintf(aDescription, sizeof(aDescription) - 1U, "%s:%u G%u [%s]",
PixelType::GetType(pixelDmxConfiguration.GetType()),
pixelDmxConfiguration.GetCount(),
pixelDmxConfiguration.GetGroupingCount(),
PixelType::GetMap(pixelDmxConfiguration.GetMap()));

RDMPersonality *personalities[2] = { new RDMPersonality(aDescription, &pixelDmx), new RDMPersonality("Config mode", &pixelDmxParamsRdm) };

RDMResponder rdmResponder(personalities, 2);
rdmResponder.Init();

StoreRDMDevice storeRdmDevice;
Expand Down Expand Up @@ -170,6 +187,19 @@ void main() {
printf("Test pattern : %s [%u]\n", PixelPatterns::GetName(nTestPattern), static_cast<uint32_t>(nTestPattern));
}

#if !defined(NO_EMAC)
RemoteConfig remoteConfig(remoteconfig::Node::RDMNET_LLRP_ONLY, remoteconfig::Output::PIXEL);
RemoteConfigParams remoteConfigParams(new StoreRemoteConfig);

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

while (configStore.Flash())
;
#endif

display.SetTitle("RDM Responder Pixel 1");
display.Set(2, displayudf::Labels::VERSION);
display.Set(6, displayudf::Labels::DMX_START_ADDRESS);
Expand All @@ -183,8 +213,8 @@ void main() {
DisplayUdfParams displayUdfParams(&storeDisplayUdf);

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

display.Show();
Expand All @@ -199,18 +229,21 @@ void main() {
display.Printf(6, "%s:%u", PixelPatterns::GetName(nTestPattern), static_cast<uint32_t>(nTestPattern));
}

lb.SetMode(ledblink::Mode::NORMAL);

hw.SetMode(hardware::ledblink::Mode::NORMAL);
hw.WatchdogInit();

for(;;) {
hw.WatchdogFeed();
rdmResponder.Run();
configStore.Flash();
#if !defined(NO_EMAC)
nw.Run();
remoteConfig.Run();
#endif
if (__builtin_expect((PixelTestPattern::GetPattern() != pixelpatterns::Pattern::NONE), 0)) {
pixelTestPattern.Run();
}
display.Run();
lb.Run();
hw.Run();
}
}
Loading

0 comments on commit 81c6f2e

Please sign in to comment.