electro-smith / DaisyDuino

Arduino Support for the Daisy Audio Platform.
https://www.electro-smith.com/daisy
MIT License
92 stars 20 forks source link

PD3 Scope Error When Building for Daisy Seed Rev4 in PlatformIO #41

Open jps723 opened 2 years ago

jps723 commented 2 years ago

This error presented when trying to upload any DaisyDuino example in PlatformIO for VSCode using a Daisy Seed Rev4.

.pio/libdeps/electrosmith_daisy/DaisyDuino/src/AudioClass.cpp: In member function 'AudioClass::BoardVersion AudioClass::BoardVersionCheck()':
.pio/libdeps/electrosmith_daisy/DaisyDuino/src/AudioClass.cpp:271:13: error: 'PD3' was not declared in this scope; did you mean 'D3'?

BoardVersionCheck() within AudioClass.cpp references 'PD3' which is defined within daisy_patch_sm.h. This is included in DaisyDuino.h but seems wrong since I'm not using a patch/submodule. I managed to work around this by hardcoding the rev4 as my board within AudioClass.cpp.

AudioClass::BoardVersion AudioClass::BoardVersionCheck()
{
  /** Version Checks:
   *  * Fall through is Daisy Seed v1 (aka Daisy Seed rev4)
   *  * PD3 tied to gnd is Daisy Seed v1.1 (aka Daisy Seed rev5)
   *  * PD4 tied to gnd reserved for future hardware
   */

  // pinMode(PD3, INPUT_PULLUP);

  // if (!digitalRead(PD3))
  // {
  //   return BoardVersion::DAISY_SEED_1_1;
  // }
  // else
  // {
  return BoardVersion::DAISY_SEED;
  //}
}