Skip to content
This repository was archived by the owner on Aug 14, 2022. It is now read-only.

Commit d6242ea

Browse files
committed
0.7.9b
Mat1jaczyyy Palette fix
1 parent 2da0f6a commit d6242ea

29 files changed

Lines changed: 415 additions & 494 deletions

Matrix.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ Copyright © 203 Industries 2017–2020. All rights reserved.
44
55
TODO
66
EEPROM load KeyMap
7+
EEPROM sys stuff
8+
microsecond timer
79
Play Animation
810
Play Midi
11+
Play Text
912
NexusRevamped while USB unreconized
1013
1114
*/
1215

16+
#define DEBUG
17+
1318
#include <Arduino.h>
1419
#include <USBMIDI.h>
1520
#include <USBComposite.h>
@@ -38,6 +43,7 @@ bool flag_leftFN = false;
3843
void setup()
3944
{
4045
setupUSB();
46+
digitalWrite(led_pin,LOW);
4147
loadDeviceConfig();
4248
setupEEPROM();
4349
variableLoad();

WIP/Color.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#include <colour.h>
1+
#include <Color.h>
22

3-
colour::colour(colourMode mode, u32 p1, u8 p2, u8 p3, u8 p4, u8 p5, u8 p6)
3+
Color::Color(ColorMode mode, u32 p1, u8 p2, u8 p3, u8 p4, u8 p5, u8 p6)
44
{
55
switch(mode)
66
{
@@ -49,11 +49,11 @@ operator u32() const
4949
return HEX;
5050
}
5151

52-
u32 applyGamma(u32 colour)
52+
u32 applyGamma(u32 color)
5353
{
5454
HEX =
55-
gamma[(colour & 0xff000000) >> 24] * 0x1000000 +
56-
gamma[(colour & 0x00ff0000) >> 16] *0x10000 +
57-
gamma[(colour & 0x0000ff00) >> 8] *0x100 +
58-
gamma[(colour & 0x000000ff)];
55+
gamma[(color & 0xff000000) >> 24] * 0x1000000 +
56+
gamma[(color & 0x00ff0000) >> 16] *0x10000 +
57+
gamma[(color & 0x0000ff00) >> 8] *0x100 +
58+
gamma[(color & 0x000000ff)];
5959
}

WIP/Color.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
#ifndef colour_H
2-
#define colour_H
1+
#ifndef COLOR_H
2+
#define COLOR_H
33

44
#include "../Core/MatrixSystem.h"
55
#include "../Parameter/MatrixParameter.h"
66

7-
enum colourMode { Off, On, W, RGB, RGBW, HEX, Palette};
8-
class colour
7+
enum ColorMode { Off, On, W, RGB, RGBW, HEX, Palette};
8+
class Color
99
{
1010
public:
11-
colour(colourMode mode, u32 p1, u8 p2 = 0, u8 p3 = 0, u8 p4 = 0, u8 p5 = 0);
11+
Color(ColorMode mode, u32 p1, u8 p2 = 0, u8 p3 = 0, u8 p4 = 0, u8 p5 = 0);
1212
operator u32() const;
13-
u32 applyGamma(u32 colour);
13+
u32 applyGamma(u32 color);
1414
protected:
1515
u32 HEX;
1616
u8 gamma[256] =

WIP/M2P.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void M2P::sysexSet()
130130
switch (CompositeSerial.read() & 0x0F)
131131
{
132132
case 8:
133-
reboot();
133+
reset();
134134
break;
135135
case 9:
136136
enterBootloader();

src/Components/Bootanimation/KaskobiBoot.cpp

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,35 @@ extern MIDI Midi;
77
void UI::kaskobiWaitAnimation()
88
{
99
brightness_cache = brightness;
10-
if(brightness > 128)
11-
LED.setBrightness(128);
10+
if(brightness > 160)
11+
LED.setBrightness(160);
1212

13-
14-
if(uiTimer.tick(800))
13+
if(uiTimer.tick(400))
1514
{
1615
if(LED.readXYLED(0x07))
1716
{
18-
for (u8 i = 7; i > 0; i--)
19-
{
20-
LED.setXYW(0x07, (i*32)-1, true);
21-
LED.update();
22-
delay(12);
23-
}
2417
LED.offXY(0x07, true);
25-
LED.update();
2618
}
2719
else
2820
{
29-
for (u8 i = 1; i <= 8; i++)
30-
{
31-
LED.setXYW(0x07, (i*32)-1, true);
32-
LED.update();
33-
delay(12);
34-
}
21+
LED.onXY(0x07, true);
3522
}
36-
uiTimer.recordCurrent();
23+
LED.update();
3724
}
3825
}
3926

4027
void UI::kaskobiBootAnimation() //8x8 only
4128
{
4229
LED.fill(0);
4330
LED.enableOverlayMode();
44-
u16 delay = 8000;
31+
//StageOne
32+
u16 delay = 60;
4533
for(s8 y = 7; y >= 0; y--)
4634
{
4735
for(u8 x = 0; x < 8; x++)
4836
{
37+
while(!uiTimer.isLonger(delay))
38+
{
4939
// if(Midi.available())
5040
// {
5141
// LED.disableOverlayMode();
@@ -59,14 +49,12 @@ void UI::kaskobiBootAnimation() //8x8 only
5949
LED.disableOverlayMode();
6050
return;
6151
}
62-
for(u8 i = 1; i < 4; i++)
63-
{
64-
LED.setXYW(xytoxy(x, y), (i*64)-1, true);
65-
LED.update();
66-
delayMicroseconds(delay);
6752
}
53+
uiTimer.recordCurrent();
54+
LED.onXY(xytoxy(x, y), true);
55+
LED.update();
6856
}
69-
delay = delay * 0.5;
57+
delay *= 0.8;
7058
}
7159

7260
// uiTimer.recordCurrent();
@@ -92,7 +80,8 @@ void UI::kaskobiBootAnimation() //8x8 only
9280
{
9381
shuffle[i] = i;
9482
}
95-
randomSeed(analogRead(PC3) * micros());
83+
//randomSeed(analogRead(PC3) * analogRead(PC4) * analogRead(PC5));
84+
randomSeed(micros());
9685

9786
for (u16 i = 0; i < 500; i++)
9887
{
@@ -103,7 +92,7 @@ void UI::kaskobiBootAnimation() //8x8 only
10392
shuffle[r2] = t;
10493
}
10594

106-
for(int i = 0; i <NUM_LEDS+10; i++)
95+
for(int i = 0; i <NUM_LEDS+15; i++)
10796
{
10897

10998
while(!uiTimer.isLonger(delay))
@@ -124,15 +113,15 @@ void UI::kaskobiBootAnimation() //8x8 only
124113
}
125114
uiTimer.recordCurrent();
126115
if(i < NUM_LEDS)
127-
LED.setPalette(shuffle[i], 1, 13, true);
116+
LED.setPalette(shuffle[i], 0, 44, true);
128117
if(i > 0 && i < NUM_LEDS + 2)
129-
LED.setPalette(shuffle[i-2], 1, 9, true);
118+
LED.setPalette(shuffle[i-2], 0, 28, true);
130119
if(i > 1 && i < NUM_LEDS + 4)
131-
LED.setPalette(shuffle[i-4], 1, 5, true);
120+
LED.setPalette(shuffle[i-4], 0, 12, true);
132121
if(i > 2 && i < NUM_LEDS + 6)
133-
LED.setPalette(shuffle[i-6], 1, 57, true);
122+
LED.setPalette(shuffle[i-6], 0, 116, true);
134123
if(i > 3 && i < NUM_LEDS + 8)
135-
LED.setPalette(shuffle[i-8], 1, 49, true);
124+
LED.setPalette(shuffle[i-8], 0, 102, true);
136125
if(i > 4 && i < NUM_LEDS + 10)
137126
LED.off(shuffle[i-10], true);
138127

0 commit comments

Comments
 (0)