@@ -105,7 +105,7 @@ SPISettings settings(DISPLAY_FREQ, MSBFIRST, SPI_MODE0);
105105// below, to allow for caching/scheduling fudge). If so, that's our signal
106106// that something is likely amiss and we take evasive maneuvers, resetting
107107// the affected DMA channel (DMAbuddy::fix()).
108- #define DMA_TIMEOUT ((DISPLAY_SIZE * 16 * 4000 ) / (DISPLAY_FREQ / 1000 ))
108+ #define DMA_TIMEOUT (uint32_t )( (DISPLAY_SIZE * 16 * 4000 ) / (DISPLAY_FREQ / 1000 ))
109109
110110static inline uint16_t readBoop (void ) {
111111 uint16_t counter = 0 ;
@@ -142,6 +142,9 @@ void setup() {
142142#else
143143 if (!arcada.filesysBegin ()) fatal (" No filesystem found!" , 250 );
144144#endif
145+
146+ user_setup ();
147+
145148 arcada.displayBegin ();
146149
147150 DISPLAY_SIZE = min (ARCADA_TFT_WIDTH, ARCADA_TFT_HEIGHT);
@@ -163,15 +166,15 @@ void setup() {
163166 // config1.eye, config2.eye or config3.eye instead). Keep fingers clear
164167 // of the nose booper when doing this...it self-calibrates on startup.
165168 // DO THIS BEFORE THE SPLASH SO IT DOESN'T REQUIRE A LENGTHY HOLD.
166- char *filename = " config.eye" ;
169+ char *filename = ( char *) " config.eye" ;
167170
168171 uint32_t buttonState = arcada.readButtons ();
169172 if ((buttonState & ARCADA_BUTTONMASK_UP) && arcada.exists (" config1.eye" )) {
170- filename = " config1.eye" ;
173+ filename = ( char *) " config1.eye" ;
171174 } else if ((buttonState & ARCADA_BUTTONMASK_A) && arcada.exists (" config2.eye" )) {
172- filename = " config2.eye" ;
175+ filename = ( char *) " config2.eye" ;
173176 } else if ((buttonState & ARCADA_BUTTONMASK_DOWN) && arcada.exists (" config3.eye" )) {
174- filename = " config3.eye" ;
177+ filename = ( char *) " config3.eye" ;
175178 }
176179
177180 yield ();
@@ -184,11 +187,11 @@ void setup() {
184187 #endif
185188
186189 yield ();
187- if (arcada.drawBMP (" /splash.bmp" , 0 , 0 , (eye[0 ].display )) == IMAGE_SUCCESS) {
190+ if (arcada.drawBMP (( char *) " /splash.bmp" , 0 , 0 , (eye[0 ].display )) == IMAGE_SUCCESS) {
188191 Serial.println (" Splashing" );
189192 if (NUM_EYES > 1 ) { // other eye
190193 yield ();
191- arcada.drawBMP (" /splash.bmp" , 0 , 0 , (eye[1 ].display ));
194+ arcada.drawBMP (( char *) " /splash.bmp" , 0 , 0 , (eye[1 ].display ));
192195 }
193196 // backlight on for a bit
194197 for (int bl=0 ; bl<=250 ; bl+=20 ) {
@@ -295,7 +298,6 @@ void setup() {
295298 // leave some RAM for the stack to operate over the lifetime of this
296299 // program and to handle small heap allocations.
297300
298- ImageReturnCode status;
299301 uint32_t maxRam = availableRAM () - stackReserve;
300302
301303 // Load texture maps for eyes
@@ -356,6 +358,7 @@ void setup() {
356358
357359 // Load eyelid graphics.
358360 yield ();
361+ ImageReturnCode status;
359362
360363 status = loadEyelid (upperEyelidFilename ?
361364 upperEyelidFilename : (char *)" upper.bmp" ,
@@ -415,8 +418,6 @@ void setup() {
415418 boopThreshold = boopThreshold * 110 / 100 ; // 10% overhead
416419 }
417420
418- user_setup ();
419-
420421 lastLightReadTime = micros () + 2000000 ; // Delay initial light reading
421422}
422423
0 commit comments