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

Commit 2da0f6a

Browse files
committed
Pre Sysex
1 parent cca5fa2 commit 2da0f6a

10 files changed

Lines changed: 139 additions & 271 deletions

File tree

Matrix.ino

Lines changed: 3 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Project Matrix
3-
Copyright © 203 Industries 2017–2019. All rights reserved.
3+
Copyright © 203 Industries 2017–2020. All rights reserved.
44
55
TODO
66
EEPROM load KeyMap
@@ -17,15 +17,11 @@ NexusRevamped while USB unreconized
1717
#include "src/Parameter/MatrixVariable.h"
1818
#include "src/Parameter/MatrixParameter.h"
1919
#include "src/Core/MatrixSystem.h"
20-
//#include "../Serials.h"
2120
#include "src/Core/MatrixSystem.h"
2221
#include "src/HAL/KeyPad.h"
2322
#include "src/HAL/LED.h"
2423
#include "src/HAL/Timer.h"
25-
//#include "src/HAL/ADCTouch.h"
26-
//#include "src/Protocol/USBmidi.h"
2724
#include "src/Protocol/MIDI.h"
28-
//#include "src/protocol/M2P.h"
2925
#include "src/Components/UI.h"
3026

3127
UI UI;
@@ -35,9 +31,8 @@ LED LED;
3531
KeyPad KeyPad;
3632
//ADCTouch TouchBar;
3733
Timer mainTimer;
38-
Timer keypadTimer;
3934
MicroTimer microTimer;
40-
//bool scanKeypad = true;
35+
4136
bool flag_leftFN = false;
4237

4338
void setup()
@@ -53,44 +48,7 @@ void setup()
5348
CompositeSerial.println("Setup Complete");
5449
#endif
5550

56-
mainTimer.recordCurrent();
57-
while(!USBComposite.isReady() && !KeyPad.fn.state == PRESSED)
58-
{
59-
KeyPad.scan();
60-
if (mainTimer.isLonger(9900000))
61-
{
62-
LED.setXYHEX(0x07,0xff0000); //NexusRevamped Entence point
63-
LED.update();
64-
}
65-
else
66-
{
67-
switch(bootAnimationSelector)
68-
{
69-
case 0:
70-
break;
71-
72-
case 1:
73-
UI.kaskobiWaitAnimation();
74-
break;
75-
}
76-
}
77-
}
78-
79-
if(!KeyPad.fn.velocity)
80-
{
81-
switch(bootAnimationSelector)
82-
{
83-
case 0:
84-
break;
85-
86-
case 1:
87-
UI.kaskobiBootAnimation();
88-
break;
89-
}
90-
}
91-
92-
LED.fill(0x000000);
93-
LED.update();
51+
UI.enterBootAnimation();
9452

9553
#ifdef DEBUG
9654
CompositeSerial.println("Enter Main Program");
@@ -233,65 +191,3 @@ void loop()
233191
// #endif
234192
}
235193
}
236-
237-
void specialBoot()
238-
{
239-
if (KeyPad.scan())
240-
{
241-
if(KeyPad.checkXY(0, 5, true) && KeyPad.checkXY(0, 6, true) && KeyPad.checkXY(0, 7, true))
242-
{
243-
formatEEPROM();
244-
LED.fill(0xFF00FF);
245-
}
246-
247-
if(KeyPad.checkXY(1, 1, true) && KeyPad.checkXY(0, 0, true))
248-
{
249-
factoryTest();
250-
}
251-
252-
if(KeyPad.checkXY(7, 0, true))
253-
{
254-
setBrightness(16);
255-
}
256-
257-
if(KeyPad.checkXY(7, 0, true) && KeyPad.checkXY(6, 1, true))
258-
{
259-
setBrightness(255);
260-
}
261-
262-
}
263-
}
264-
265-
void factoryTest()
266-
{
267-
LED.setBrightness(64);
268-
LED.fill(0);
269-
LED.update();
270-
271-
while(KeyPad.fn.state != PRESSED)
272-
{
273-
if (mainTimer.tick(1000/fps))
274-
{
275-
if(KeyPad.scan())
276-
{
277-
for(int i = 0; i < MULTIPRESS; i++)
278-
{
279-
u8 x = xytox(KeyPad.changelist[i]);
280-
u8 y = xytoy(KeyPad.changelist[i]);
281-
if(KeyPad.getKey(KeyPad.changelist[i]).state == PRESSED)
282-
{
283-
if(LED.readLED(KeyPad.changelist[i]))
284-
{
285-
LED.offXY(KeyPad.changelist[i], true);
286-
}
287-
else
288-
{
289-
LED.setXYHEX(KeyPad.changelist[i], 0xFFFFFF, true, true);
290-
}
291-
}
292-
}
293-
LED.update();
294-
}
295-
}
296-
}
297-
}

WIP/ADCTouch.cpp

Lines changed: 0 additions & 108 deletions
This file was deleted.

WIP/ADCTouch.h

Lines changed: 0 additions & 41 deletions
This file was deleted.

WIP/M2P.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class M2P
2626
private:
2727
u16 deviceAddress;
2828
u8 hostport;
29-
u16 magicnumber[] = {781,156,31,6}; // decode diveder
29+
u16 magicnumber[] = {781,156,31,6}; // decode diveder
3030
};
3131

3232
#endif

src/Components/UI.cpp

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void UI::fnMenu()
5757
UI::exitFNmenu();
5858
return;
5959
}
60-
else if(KeyPad.fn.state == RELEASED && !fn_hold && (KeyPad.fn.hold || hadAction )) //if fn off and longer then threshold, will count as hold, release to back to main menu
60+
else if(KeyPad.fn.state == RELEASED && !fn_hold && (KeyPad.fn.hold || hadAction )) //if fn off and longer then threshold, will count as hold, release to back to main menu
6161
{
6262
UI::exitFNmenu();
6363
return;
@@ -881,3 +881,45 @@ void UI::scrollText(char ascii[], u32 colour, bool loop /* = false */)
881881
}while(loop);
882882
LED.fill(0, true);
883883
}
884+
885+
void UI::enterBootAnimation()
886+
{
887+
uiTimer.recordCurrent();
888+
while(!USBComposite.isReady() && !KeyPad.fn.state == PRESSED)
889+
{
890+
KeyPad.scan();
891+
if (uiTimer.isLonger(9900000))
892+
{
893+
LED.setXYHEX(0x07,0xff0000); //NexusRevamped Entence point
894+
LED.update();
895+
}
896+
else
897+
{
898+
switch(bootAnimationSelector)
899+
{
900+
case 0:
901+
break;
902+
903+
case 1:
904+
UI::kaskobiWaitAnimation();
905+
break;
906+
}
907+
}
908+
}
909+
910+
if(!KeyPad.fn.velocity)
911+
{
912+
switch(bootAnimationSelector)
913+
{
914+
case 0:
915+
break;
916+
917+
case 1:
918+
UI::kaskobiBootAnimation();
919+
break;
920+
}
921+
}
922+
923+
LED.fill(0x000000);
924+
LED.update();
925+
}

src/Components/UI.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ class UI
3636
u32 numSelectorRGB(u32 colour, bool ignore_gamma = false);
3737
//u32 numSelectorWRGB(u32 colour, bool ignore_gamma = false);
3838
void scrollText(char ascii[], u32 colour, bool loop = false);
39+
40+
void enterBootAnimation();
41+
3942
void kaskobiWaitAnimation();
4043
void kaskobiBootAnimation();
4144
private:

0 commit comments

Comments
 (0)