Skip to content

Commit

Permalink
system: set dmx serial number in init
Browse files Browse the repository at this point in the history
  • Loading branch information
paradajz committed Sep 17, 2021
1 parent 87b1710 commit 987e8d8
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions src/application/system/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,26 +261,6 @@ bool System::init()

_hwa.registerOnUSBconnectionHandler([this]() {
forceComponentRefresh();

static bool dmxSerialNrSet = false;

if (!dmxSerialNrSet)
{
uniqueID_t uniqueID;
_hwa.uniqueID(uniqueID);

uint32_t uid = uniqueID[0];
uid <<= 8;
uid |= uniqueID[1];
uid <<= 8;
uid |= uniqueID[2];
uid <<= 8;
uid |= uniqueID[3];

_dmx.setSerialNumber(uid);

dmxSerialNrSet = true;
}
});

if (!_hwa.init())
Expand All @@ -299,6 +279,19 @@ bool System::init()

configureMIDI();

uniqueID_t uniqueID;
_hwa.uniqueID(uniqueID);

uint32_t uid = uniqueID[0];
uid <<= 8;
uid |= uniqueID[1];
uid <<= 8;
uid |= uniqueID[2];
uid <<= 8;
uid |= uniqueID[3];

_dmx.setSerialNumber(uid);

if (_database.read(Database::Section::global_t::dmx, dmxSetting_t::enabled))
_dmx.init();

Expand Down

0 comments on commit 987e8d8

Please sign in to comment.