Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document default pin mappings in the built binary #408

Merged
merged 2 commits into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions headers/build_info.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/* generate build information (such as stuff auto-included in the .uf2) */
#include "pico/binary_info.h"
#include "pico/binary_info/code.h"

#include "BoardConfig.h"

// generate binary information for picotool info, etc.
#if(PIN_DPAD_UP >= 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't 0 a valid pin definition?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

bi_decl(bi_1pin_with_name(PIN_DPAD_UP, "Up"));
#endif

#if(PIN_DPAD_DOWN >= 1)
bi_decl(bi_1pin_with_name(PIN_DPAD_DOWN, "Down"));
#endif

#if(PIN_DPAD_LEFT >= 1)
bi_decl(bi_1pin_with_name(PIN_DPAD_LEFT, "Left"));
#endif

#if(PIN_DPAD_RIGHT >= 1)
bi_decl(bi_1pin_with_name(PIN_DPAD_RIGHT, "Right"));
#endif

#if(PIN_BUTTON_B1 >= 1)
bi_decl(bi_1pin_with_name(PIN_BUTTON_B1, "B1"));
#endif

#if(PIN_BUTTON_B2 >= 1)
bi_decl(bi_1pin_with_name(PIN_BUTTON_B2, "B2"));
#endif

#if(PIN_BUTTON_B3 >= 1)
bi_decl(bi_1pin_with_name(PIN_BUTTON_B3, "B3"));
#endif

#if(PIN_BUTTON_B4 >= 1)
bi_decl(bi_1pin_with_name(PIN_BUTTON_B4, "B4"));
#endif

#if(PIN_BUTTON_L1 >= 1)
bi_decl(bi_1pin_with_name(PIN_BUTTON_L1, "L1"));
#endif

#if(PIN_BUTTON_R1 >= 1)
bi_decl(bi_1pin_with_name(PIN_BUTTON_R1, "R1"));
#endif

#if(PIN_BUTTON_L2 >= 1)
bi_decl(bi_1pin_with_name(PIN_BUTTON_L2, "L2"));
#endif

#if(PIN_BUTTON_R2 >= 1)
bi_decl(bi_1pin_with_name(PIN_BUTTON_R2, "R2"));
#endif

#if(PIN_BUTTON_S1 >= 1)
bi_decl(bi_1pin_with_name(PIN_BUTTON_S1, "S1"));
#endif

#if(PIN_BUTTON_S2 >= 1)
bi_decl(bi_1pin_with_name(PIN_BUTTON_S2, "S2"));
#endif

#if(PIN_BUTTON_L3 >= 1)
bi_decl(bi_1pin_with_name(PIN_BUTTON_L3, "L3"));
#endif

#if(PIN_BUTTON_R3 >= 1)
bi_decl(bi_1pin_with_name(PIN_BUTTON_R3, "R3"));
#endif

#if(PIN_BUTTON_A1 >= 1)
bi_decl(bi_1pin_with_name(PIN_BUTTON_A1, "A1"));
#endif

#if(PIN_BUTTON_A2 >= 1)
bi_decl(bi_1pin_with_name(PIN_BUTTON_A2, "A2"));
#endif

#if(PIN_BUTTON_FN >= 1)
bi_decl(bi_1pin_with_name(PIN_BUTTON_FN, "Fn"));
#endif
1 change: 1 addition & 0 deletions src/gp2040.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "system.h"
#include "enums.pb.h"

#include "build_info.h"
#include "configmanager.h" // Global Managers
#include "storagemanager.h"
#include "addonmanager.h"
Expand Down