JonnyHaystack / HayBox

Modular cross-platform firmware for digital or mixed analog/digital game controllers
GNU General Public License v3.0
170 stars 176 forks source link

Inability to compile with fewer buttons #1

Closed Ddhuet closed 2 years ago

Ddhuet commented 3 years ago

I'm attempting to use this firmware on my Smashbox, which lacks a select and home button. If I set these to NULL in the pinout file, it throws errors. If I delete the lines they throw errors.

JonnyHaystack commented 3 years ago

Can you show the errors? Also that reminds me I should add a smashbox pinout file..

JonnyHaystack commented 3 years ago

When you say "delete the lines" do you just mean in the pinout file? You have to delete them from the pinout file and from HayB0XX.ino (and your setup file too I guess)

Ddhuet commented 3 years ago

I was just deleting them from the pinout file, or trying to NULL them. I will try it again soon with deleting from the other sources. It would be nice if there was a convenient way to mark them as not needed. I don't want random pins activating, and I would imagine most DIY boxes don't have home/select buttons.

JonnyHaystack commented 3 years ago

Agreed, I would much prefer this to work without any manual modifications. I will have to think about the best way to do that

ribbanya commented 3 years ago

I will have to think about the best way to do that

Wouldn't a #define in each of the *setup_*.h files, and a #ifdef around the references to SELECT and HOME, make the most sense? Then the user would only have to uncomment one line somewhere, or it could be predefined in certain header files (like setup_smashbox.h).

JonnyHaystack commented 3 years ago

I will have to think about the best way to do that

Wouldn't a #define in each of the *setup_*.h files, and a #ifdef around the references to SELECT and HOME, make the most sense? Then the user would only have to uncomment one line somewhere, or it could be predefined in certain header files (like setup_smashbox.h).

That would then make it specific to only adding or removing those two buttons, which is not what I want. It's better to just set the unused buttons to an unused pin if possible.

JonnyHaystack commented 2 years ago

I have commits on the platformio branch which update all the pinout files to assign unused pins to the non-existent buttons. That should solve any compilation issues, and the README on that branch is also updated to say that. This will be merged and released as 1.0.0 soon. The Arduino IDE will no longer be used and everything will be done through PlatformIO/VS Code, which makes it a lot simpler to get up and running, no need to delete files just to get it to compile for non-USB MCUs, etc.