Skip to content

PIco in host mode works but I need to declare a global variable #9235

Discussion options

You must be logged in to vote

OK I found my bug! I forget to add the file gamepad_var.c into the CMakLists.txt MICROPY_SOURCE_QSTR

this file gamepad_var.c is simple

//  global GamePadData
//  10  bytes  to transfer gamepad info
//  it is access from module gamepad.c and hid_app.c
//
// using,
// uint8_t * = (uint8_t *) MP_STATE_VM(GamePadData);

#include "py/mpstate.h"

MP_REGISTER_ROOT_POINTER(uint8_t GamePadData[10]);

Now Where do I put the poll to read the usb host in a loop to be able to get information about the gamepad when the Pico run a script.

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@dpgeorge
Comment options

@danjperron
Comment options

@dpgeorge
Comment options

@danjperron
Comment options

Answer selected by dpgeorge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants