Skip to content
Snippets Groups Projects
Commit e5a3b4c0 authored by ftomi's avatar ftomi
Browse files

Update universes

parent f504c872
No related branches found
No related tags found
No related merge requests found
......@@ -4,10 +4,10 @@
#include <ola/client/ClientWrapper.h>
#include "spisender.h"
// Important to go from zero.
// Important to go from one.
// Else modify the NewDmx callback
static unsigned int universes[6] = {0, 1, 2, 3, 4, 5};
// The 'n'th universe goes from (rows[n]) to (rows[n+1]-1) inclusive
static unsigned int universes[6] = {1, 2, 3, 4, 5, 6};
// The 'n'th universe (n: 1-6) goes from (rows[n-1]) to (rows[n]-1) inclusive
static int universe_rows[7] = {0, 5, 10, 15, 20, 25, 26};
static void RegisterComplete(const ola::client::Result &result);
......@@ -64,10 +64,8 @@ static void NewDmx(const ola::client::DMXMetadata &metadata,
const ola::DmxBuffer &data)
{
MxFrame frame;
if (metadata.universe > 5) return;
//printf("New Frame on universe %d\n", metadata.universe);
int startY = universe_rows[metadata.universe];
int endY = universe_rows[metadata.universe+1]-1;
int startY = universe_rows[metadata.universe-1];
int endY = universe_rows[metadata.universe]-1;
const uint8_t* arr = data.GetRaw();
int k = 0;
for (size_t y = startY; y <= endY; y++)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment