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

Minor cleanup of RP2040 code post addition of Pico-PIO-USB #1467

Merged
merged 1 commit into from
May 26, 2022

Conversation

kilograham
Copy link
Collaborator

@kilograham kilograham commented May 20, 2022

  • Removed some compiler warnings, and cleaned out no-longer-necessary warning suppression from CMake suppress_tinyusb_warnings()
  • Made explicit family_configure_dual_usb_example() for DUAL mode examples as family_configure_target() may not generally be called multiple times for the same target
  • Renamed library pico_pio_usb to tinyusb_pico_pio_usb to be clearer and avoid conflict if someone already has a pico_pio_usb in their project
  • Added family_add_pico_pio_usb() method for adding Pico-PIO-USB support to an existing example
  • Added some explicit guards to check the Pico-PIO-USB submodule is initialized
  • Removed explicit setting of a system clock for Pico-PIO-USB in the rp2040 board support unless using Pico-PIO-USB
  • Allowed tinyusb_pico_pio_usb to be added as a dependency of regular apps using the Pico SDK

* Removed some compiler warnings, and cleaned out unnecessary warning suppression from CMake suppress_tinyusb_warnings()
* Made explicit family_configure_dual_usb_example() for DUAL mode examples as family_configure_target() may not generally be called multiple times for the same target

* Renamed library pico_pio_usb to tinyusb_picio_pio_usb to be clearer and avoid conflict if someone already has a pico_pio_usb in their project
* Added family_add_pico_pio_usb() method for adding Pico-PIO_SUB support to an existing example
* Allowed tinyusb_pico_pio_usb to be added to regular apps using the Pico SDK
@@ -49,7 +49,9 @@

#define TCP_MSS (1500 /*mtu*/ - 20 /*iphdr*/ - 20 /*tcphhr*/)
#define TCP_SND_BUF (2 * TCP_MSS)
#ifndef TCP_WND
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note I should probably comment on this... there are pre-existing overrides of this to 2*TCP_MSS in the CMakeLists.txt for the net_lwip_webserver example. This was causing a compiler warning, as this line just trashes it. So either my change is correct, or the override is unnecessary!

Copy link
Owner

Choose a reason for hiding this comment

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

The defined in cmakelist.txt is added in this commit
95f2478#diff-12cfd80973cd9c09e8493c08a1eb623365231a9e2b0db14d109e9b6836985830R71-R74

PBUF_POOL_SIZE=2
HTTPD_USE_CUSTOM_FSDATA=0

are also redefined with the same values, maybe we should drop it altogether in cmakelist and adjust/use value in the header file only for consistency

Copy link
Owner

Choose a reason for hiding this comment

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

updated by #1483

Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

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

everything looks great, except, maybe we should remove re-define of network example in cmakelist. If you agree, I could merge this first, and make an changes as separated PR afterwards.

@@ -49,7 +49,9 @@

#define TCP_MSS (1500 /*mtu*/ - 20 /*iphdr*/ - 20 /*tcphhr*/)
#define TCP_SND_BUF (2 * TCP_MSS)
#ifndef TCP_WND
Copy link
Owner

Choose a reason for hiding this comment

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

The defined in cmakelist.txt is added in this commit
95f2478#diff-12cfd80973cd9c09e8493c08a1eb623365231a9e2b0db14d109e9b6836985830R71-R74

PBUF_POOL_SIZE=2
HTTPD_USE_CUSTOM_FSDATA=0

are also redefined with the same values, maybe we should drop it altogether in cmakelist and adjust/use value in the header file only for consistency

src/portable/raspberrypi/rp2040/hcd_rp2040.c Show resolved Hide resolved
@kilograham
Copy link
Collaborator Author

everything looks great, except, maybe we should remove re-define of network example in cmakelist. If you agree, I could merge this first, and make an changes as separated PR afterwards.

Sure. i wasn't sure why why was overridden in the CMakeLists.txt to start with, so didn't want to change that to remove the error. I 100% defer to your better knowledge of what it does, and if it is safe for all boards to change (or if it is even needed)

@hathach
Copy link
Owner

hathach commented May 26, 2022

everything looks great, except, maybe we should remove re-define of network example in cmakelist. If you agree, I could merge this first, and make an changes as separated PR afterwards.

Sure. i wasn't sure why why was overridden in the CMakeLists.txt to start with, so didn't want to change that to remove the error. I 100% defer to your better knowledge of what it does, and if it is safe for all boards to change (or if it is even needed)

ok thanks, I will do that later on with a bit of testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants