Minor memory optimizations and stencil production file

This commit is contained in:
2023-07-31 21:32:32 +03:00
parent dc5e7acb8c
commit 72093d7d20
9 changed files with 24 additions and 2711 deletions

1
.gitignore vendored
View File

@ -10,3 +10,4 @@ Hardware/gtoe/_autosave-gtoe.kicad_pcb
Hardware/gtoe/gtoe.kicad_sch-bak Hardware/gtoe/gtoe.kicad_sch-bak
Hardware/gtoe/_autosave-gtoe.kicad_sch Hardware/gtoe/_autosave-gtoe.kicad_sch
Software/Gravity/build/arduino.avr.nano Software/Gravity/build/arduino.avr.nano
Software/Gravity/build/arduino.avr.nano

View File

@ -69,14 +69,26 @@ bool seqA1[16] = {1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0};
bool seqA2[16] = {0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0}; bool seqA2[16] = {0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0};
bool seqA3[16] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; bool seqA3[16] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
bool seqA4[16] = {1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0}; bool seqA4[16] = {1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0};
bool seqA5[16] = {1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0};
bool seqA6[16] = {0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0};
bool seqA7[16] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
bool seqA8[16] = {1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0};
bool seqB1[16] = {1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0};
bool seqB2[16] = {0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0};
bool seqB3[16] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
bool seqB4[16] = {1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0};
bool seqB5[16] = {1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0};
bool seqB6[16] = {0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0};
bool seqB7[16] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
bool seqB8[16] = {1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0};
bool *currentSeq; bool *currentSeq;
int currentStep = 0; byte currentStep = 0;
byte memCode = 'A'; //Change to different letter if you changed the data structure byte memCode = 'A'; //Change to different letter if you changed the data structure
int channelPulseCount[6]; unsigned int channelPulseCount[6];
int channelPulsesPerCycle[6]; unsigned int channelPulsesPerCycle[6];
int sixteenthPulseCount = 0; byte sixteenthPulseCount = 0;
int playingModes[6]; //actual channel modes array updated from channels object on each beat int playingModes[6]; //actual channel modes array updated from channels object on each beat
unsigned int pulsePeriod; unsigned int pulsePeriod;
@ -84,8 +96,6 @@ bool isPlaying = false;
unsigned int tickCount = 0; unsigned int tickCount = 0;
unsigned int pulseCount = 0; unsigned int pulseCount = 0;
unsigned int extTriggerCount = 0;
byte extResetCountdown = 0;
byte masterClockMode = 0; // 0 - internal, 1 - external 24ppqn, 2 - external beat byte masterClockMode = 0; // 0 - internal, 1 - external 24ppqn, 2 - external beat
unsigned long lastExtPulseTime; unsigned long lastExtPulseTime;
@ -93,11 +103,10 @@ unsigned long newExtPulseTime;
bool needPulseReset[6] = { true, true, true, true, true, true }; bool needPulseReset[6] = { true, true, true, true, true, true };
unsigned int displayTab = 0; byte displayTab = 0;
unsigned int displayTabOld;
bool insideTab = false; bool insideTab = false;
unsigned int menuItem = 0; byte menuItem = 0;
unsigned int lastMenuItem = 3; byte lastMenuItem = 3;
bool playBtnPushed = false; bool playBtnPushed = false;
bool shiftBtnPushed = false; bool shiftBtnPushed = false;
@ -109,7 +118,7 @@ unsigned long encPressedTime;
unsigned long encReleasedTime; unsigned long encReleasedTime;
bool encPressRegistered; bool encPressRegistered;
unsigned long lastInteractionTime; // used for display timeout //unsigned long lastInteractionTime; // used for display timeout
Adafruit_SSD1306 display(128, 64, &Wire, -1); Adafruit_SSD1306 display(128, 64, &Wire, -1);
RotaryEncoder encoder(ENC_D1_PIN, ENC_D2_PIN, RotaryEncoder::LatchMode::TWO03); RotaryEncoder encoder(ENC_D1_PIN, ENC_D2_PIN, RotaryEncoder::LatchMode::TWO03);

View File

@ -1,7 +1,8 @@
void updateScreen() { void updateScreen() {
display.clearDisplay(); display.clearDisplay();
lastInteractionTime = millis(); //not sure if it's a right place for this, but should do for now //lastInteractionTime = millis(); //not sure if it's a right place for this, but should do for now
//Tabs //Tabs
display.drawRect(0, 48, 128, 1, SSD1306_WHITE); display.drawRect(0, 48, 128, 1, SSD1306_WHITE);
@ -81,9 +82,7 @@ void updateScreen() {
} }
} else { //CHANNELS } else { //CHANNELS
if (true) { //placeholder for channel modes with different amount of submenu items lastMenuItem = 3;
lastMenuItem = 3;
}
if (menuItem == 0 && insideTab) { if (menuItem == 0 && insideTab) {
display.setTextColor(SSD1306_BLACK); display.setTextColor(SSD1306_BLACK);
} else { } else {

View File

@ -1 +0,0 @@
:00000001FF

File diff suppressed because it is too large Load Diff