Tinwelint78 / eBaghet

Open source electronic pipes project for Arduino. Currently include Baghet (italian bagpipes), Great Highland Bagpipes, Small Pipes, Border Pipes, Uillean Pipes, Gaita Gallega and Gaita Asturiana (still in developement)
https://tinwelint78.github.io/eBaghet/
GNU General Public License v3.0
10 stars 3 forks source link

Rename primary sketch file to match folder #3

Closed per1234 closed 3 years ago

per1234 commented 3 years ago

Every Arduino sketch must contain a .ino file with name matching exactly to the sketch folder name. Previously, there was a case mismatch between the sketch file name "ebaghet.ino" and the folder name "eBaghet" (note the "b" vs. "B"). A case sensitive file system such as Linux is able to handle this just as any other name mismatch:

The file "ebaghet.ino" needs to be inside a sketch folder named "ebaghet". Create this folder, move the file, and continue?

Unfortunately, if the user clicks the "OK" button, only the file "ebaghet.ino" is moved to the new matching folder, leaving behind all the sketch's other essential files:

eBaghet:30:10: fatal error: ebaghet_config.h: No such file or directory

  #include "ebaghet_config.h"
           ^~~~~~~~~~~~~~~~~~

The case mismatch results in an even more confusing situation on the case insensitive file systems of Windows and macOS (by default) due to a bug (https://github.com/arduino/Arduino/issues/8030) in the Arduino IDE that causes the "Sample16.h" file to be renamed to "Sample16.h.cpp", resulting in a perplexing error:

ebaghet:32:10: fatal error: Sample16.h: No such file or directory

  #include "Sample16.h" // Sample template
          ^~~~~~~~~~~~

The solution is to rename the primary sketch file so that it matches the folder exactly.