Skip to content

Commit

Permalink
binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
anklimov committed Nov 23, 2023
1 parent 4d909dd commit 7ab78ab
Showing 18 changed files with 50,957 additions and 50,816 deletions.
Binary file modified compiled/Mega2560-optiboot/firmware.bin
Binary file not shown.
14,946 changes: 7,474 additions & 7,472 deletions compiled/Mega2560-optiboot/firmware.hex

Large diffs are not rendered by default.

19,136 changes: 9,581 additions & 9,555 deletions compiled/controllino/firmware.hex

Large diffs are not rendered by default.

Binary file modified compiled/due/firmware.bin
Binary file not shown.
Binary file modified compiled/esp32-wifi/firmware.bin
Binary file not shown.
Binary file modified compiled/esp8266-wifi/firmware.bin
Binary file not shown.
Binary file modified compiled/lighthub21/firmware.bin
Binary file not shown.
Binary file modified compiled/m5stack/firmware.bin
Binary file not shown.
20,435 changes: 10,229 additions & 10,206 deletions compiled/mega2560-5100/firmware.hex

Large diffs are not rendered by default.

18,616 changes: 9,320 additions & 9,296 deletions compiled/mega2560-5500/firmware.hex

Large diffs are not rendered by default.

Binary file modified compiled/mega2560slim/firmware.bin
Binary file not shown.
13,767 changes: 6,884 additions & 6,883 deletions compiled/mega2560slim/firmware.hex

Large diffs are not rendered by default.

11,397 changes: 5,699 additions & 5,698 deletions compiled/nrf52840/firmware.hex

Large diffs are not rendered by default.

Binary file modified compiled/stm32-enc2860/firmware.bin
Binary file not shown.
Binary file modified compiled/stm32/firmware.bin
Binary file not shown.
Binary file modified compiled/stm32/firmware.elf
Binary file not shown.
3,413 changes: 1,707 additions & 1,706 deletions compiled/stm32/firmware.map

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions lighthub/dmx.cpp
Original file line number Diff line number Diff line change
@@ -62,6 +62,61 @@ extern aJsonObject *items;
extern aJsonObject *dmxArr;



itemCmd rgb2hsv(itemCmd in)
{
itemCmd out;
out.setArgType(ST_HSV255);

double min, max, delta;

double inr=in.param.r/255;
double ing=in.param.g/255;
double inb=in.param.b/255;
double inw=in.param.w/255;

min = inr < ing ? inr : ing;
min = min < inb ? min : inb;

max = inr > ing ? inr : ing;
max = max > inb ? max : inb;
max = max > inw ? max : inw;

out.param.v = max*255; // v
delta = max - min;
if (delta < 0.00001)
{
out.param.s = 0;
out.param.h = 0; // undefined, maybe nan?
return out;
}
if( max > 0.0 ) { // NOTE: if Max is == 0, this divide would cause a crash
out.param.s = (delta / max)*100; // s
} else {
// if max is 0, then r = g = b = 0
// s = 0, h is undefined
out.param.s = 0;
out.param.h = 0; // its now undefined
return out;
}
double outh;
if( inr >= max ) // > is bogus, just keeps compilor happy
outh = ( ing - inb ) / delta; // between yellow & magenta
else
if( ing >= max )
outh = 2.0 + ( inb - inr ) / delta; // between cyan & yellow
else
outh = 4.0 + ( inr - ing ) / delta; // between magenta & cyan

outh *= 60.0; // degrees

if( outh < 0.0 )
outh += 360.0;
out.param.h=outh;
return out;
}


int itemCtrl2(char* name,int r,int g, int b, int w)
{
if (!items) return 0;
@@ -133,7 +188,15 @@ void DMXSemiImmediateUpdate(short tch,short r, short g, short b, short w)
if (!r && !g && !b && !w) it.Ctrl(itemCmd().Cmd(CMD_OFF).setSuffix(S_CMD));
else
{
/*
CRGB rgb;
rgb.r = r;
rgb.g = g;
rgb.b = b;
CHSV hsv = rgb2hsv_approximate(rgb);
it.Ctrl(itemCmd().HSV255(hsv.h,hsv.s,hsv.v).setSuffix(S_SET)); */
it.Ctrl(itemCmd().RGBW(r,g,b,w).setSuffix(S_SET));
//it.Ctrl(rgb2hsv(itemCmd().RGBW(r,g,b,w)).setSuffix(S_SET));
it.Ctrl(itemCmd().Cmd(CMD_ON).setSuffix(S_CMD));
}
}

0 comments on commit 7ab78ab

Please sign in to comment.