Skip to content

Commit 394ef17

Browse files
author
Adafruit Adabot
committed
fix hallowing m4 compile
1 parent 5a476ec commit 394ef17

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

M4_Eyes/M4_Eyes.ino

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,12 @@ void setup() {
173173

174174
yield();
175175
// Initialize displays
176-
eye[0].display = arcada._display;
177-
if (NUM_EYES > 1) {
176+
#if (NUM_EYES > 1)
177+
eye[0].display = arcada._display;
178178
eye[1].display = arcada.display2;
179-
}
179+
#else
180+
eye[0].display = arcada.display;
181+
#endif
180182

181183
yield();
182184
if (arcada.drawBMP("/splash.bmp", 0, 0, (eye[0].display)) == IMAGE_SUCCESS) {
@@ -200,10 +202,9 @@ void setup() {
200202

201203
// Initialize DMAs
202204
yield();
203-
uint8_t e, rtna = 0x01; // Screen refresh rate control (datasheet 9.2.18, FRCTRL2)
205+
uint8_t e;
204206
for(e=0; e<NUM_EYES; e++) {
205207
eye[e].spi->setClockSource(DISPLAY_CLKSRC);
206-
eye[e].display->sendCommand(0xC6, &rtna, 1);
207208
eye[e].display->fillScreen(0);
208209
eye[e].dma.allocate();
209210
eye[e].dma.setTrigger(eye[e].spi->getDMAC_ID_TX());
@@ -888,6 +889,7 @@ void loop() {
888889
irisValue = irisMin + (sum * irisRange); // 0.0-1.0 -> iris min/max
889890
if((++iris_frame) >= (1 << IRIS_LEVELS)) iris_frame = 0;
890891
}
892+
#if defined(ADAFRUIT_MONSTER_M4SK_EXPRESS)
891893
if(voiceOn) {
892894
// Read buttons, change pitch
893895
arcada.readButtons();
@@ -906,6 +908,7 @@ void loop() {
906908
Serial.println(currentPitch);
907909
}
908910
}
911+
#endif
909912
user_loop();
910913
}
911914
} // end first-column check

M4_Eyes/globals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ typedef struct {
152152
int8_t winkPin; // Manual eye wink control (-1 = none)
153153
// Remaining values are initialized in code:
154154
columnStruct column[2]; // Alternating column structures A/B
155-
Adafruit_ST7789 *display; // Pointer to display object
155+
Adafruit_SPITFT *display; // Pointer to display object
156156
DMAbuddy dma; // DMA channel object with fix() function
157157
DmacDescriptor *dptr; // DMA channel descriptor pointer
158158
uint32_t dmaStartTime; // For DMA timeout handler

0 commit comments

Comments
 (0)