gzweigle / open-hybrid-piano

Building a hybrid MIDI digital piano
https://www.youtube.com/@gzpiano88
GNU General Public License v3.0
43 stars 2 forks source link

SW: compilation error #92

Closed davidedelvento closed 2 months ago

davidedelvento commented 2 months ago
/home/davide/Arduino/src_hammer/src_hammer.ino: In function 'void setup()':
/home/davide/Arduino/src_hammer/src_hammer.ino:166:7: error: 'class TftDisplay' has no member named 'Clear'
  166 |   Tft.Clear();
      |       ^~~~~

exit status 1

Compilation error: 'class TftDisplay' has no member named 'Clear'

fixed by

--- a/firmware/releases/ips2_hammer/src_hammer.ino
+++ b/firmware/releases/ips2_hammer/src_hammer.ino
@@ -65,7 +65,9 @@ Switches SwSCA1;
 Switches SwSCA2;
 TestpointLed Tpl;
 Timing Tmg;
+#ifdef TFT_INSTALLED
 TftDisplay Tft;
+#endif

 MIDI_CREATE_INSTANCE(HardwareSerial, Serial1, mi);
 uint8_t Midi_Buffer[MIDI_BUFFER_SIZE];
@@ -97,8 +99,10 @@ void setup(void) {
   if (Set.debug_level >= DEBUG_STATS) {
     Serial.println("Beginning hammer board initialization.");
   }
+#ifdef TFT_INSTALLED
   Tft.Setup(Set.using_display, Set.debug_level);
   Tft.HelloWorld();
+#endif

   // Initialize the nonvolatile memory.
   // Initialize early in case any setup() uses storage.
@@ -163,7 +167,9 @@ void setup(void) {
     Serial.println("Finished hammer board initialization.");
   }
   delay(2000);
+#ifdef TFT_INSTALLED
   Tft.Clear();
+#endif

 }

@@ -300,7 +306,9 @@ void loop() {

     if (Set.test_index < 0) {
       // Run the TFT display.
+#ifdef TFT_INSTALLED
       Tft.Display(switch_tft_display, calibrated_floats, damper_position);
+#endif
     }

     // Debug and display information.
@@ -317,4 +325,4 @@ void loop() {

     Tpl.SetTp8(false);
   }
gzweigle commented 2 months ago

thanks, and I pushed a commit that fixes