USBHost_t36 library is very chatty in the monitor screen.

CVierhout

Member
I'm working on a Joystick project and the Joystick is reading the Logitech 3D Pro but when I open the serial monitor is non-stop filling the screen with data like this....
hid_process_in_data 20002530 7: 00 02 88 7f 00 ff 00
hid_process_in_data 20002570 7: 00 02 88 7f 00 ff 00
hid_process_in_data 20002530 7: 00 02 88 7f 00 ff 00
hid_process_in_data 20002570 7: 00 02 88 7f 00 ff 00
hid_process_in_data 20002530 7: 00 02 88 7f 00 ff 00

This makes is hard to read the data that I'm looking for....

Joystick(0): buttons = 0 0:511 1:511 5:122 9:8

Is there a way to suppress this data? Like the option - bool show_changed_only = true;

Thanks.
 
I believe that message is this one:
Code:
bool JoystickController::hid_process_in_data(const Transfer_t *transfer)
{
    uint8_t *buffer = (uint8_t *)transfer->buffer;
    if (*buffer) report_id_ = *buffer;
    uint8_t cnt = transfer->length;
    if (!buffer || *buffer == 1) return false; // don't do report 1

    DBGPrintf("hid_process_in_data %x %u %u %p %x %x:", transfer->buffer, transfer->length, joystickType_, txpipe_, initialPass_, connectedComplete_pending_);
    for (uint8_t i = 0; i < cnt; i++) DBGPrintf(" %02x", buffer[i]);
DBGPrintf in this area is controlled by:

Code:
//#define DEBUG_JOYSTICK
#ifdef  DEBUG_JOYSTICK
#define DBGPrintf USBHDBGSerial.printf
#else
#define DBGPrintf(...)
#endif
Which is about line 30 in joystick.cpp.
If that line is uncommented it would print out that message...
 
Thank you for looking. It's commented out like in your code sample. I searched Joystick.ccp and found DBGPrintf("hid_process_in_data %x %u %u %p %x %x:", transfer->buffer, transfer->length, joystickType_, txpipe_, initialPass_, connectedComplete_pending_); on line 864 and commented it and the next two lines out with no change.

Code:
   DBGPrintf("hid_process_in_data %x %u %u %p %x %x:", transfer->buffer, transfer->length, joystickType_, txpipe_, initialPass_, connectedComplete_pending_);
    for (uint8_t i = 0; i < cnt; i++) DBGPrintf(" %02x", buffer[i]);
    DBGPrintf("\n");
 
Back
Top