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

Consider adding preprocessor switch to disable automatic rp2040 binary declarations #2696

Open
1 task done
recursivenomad opened this issue Jul 2, 2024 · 0 comments
Open
1 task done

Comments

@recursivenomad
Copy link

recursivenomad commented Jul 2, 2024

Related area

hardcoded declaration

Hardware specification

rp2040

Is your feature request related to a problem?

I wish to reduce some noise in the rp2040's binary info, as reported by picotool. For example, I have a project where the LED on pin 25 of my Pico has a specific informational function, and I add the custom bi_decl describing that function. In this case, picotool reports LED, LED CUSTOM LABEL for pin 25, when it would be more helpful to only report LED CUSTOM LABEL.

Also, apparently the pico-sdk already has a bi_decl for UART_TX & UART_RX, so in my picotool output UART0 TX and UART0 RX are both printed twice when using tinyusb via the pico-sdk.

Describe the solution you'd like

It would be nice to have a preprocessor switch to be able to disable this binary info for those who don't want it:

#ifdef LED_PIN
#ifndef TINYUSB_SKIP_RP2040_BI_DECL_LED
  bi_decl(bi_1pin_with_name(LED_PIN, "LED"));
#endif
  gpio_init(LED_PIN);
  gpio_set_dir(LED_PIN, GPIO_OUT);
#endif
#ifdef UART_DEV
#ifndef TINYUSB_SKIP_RP2040_BI_DECL_UART
  bi_decl(bi_2pins_with_func(UART_TX_PIN, UART_RX_PIN, GPIO_FUNC_UART));
#endif
  uart_inst = uart_get_instance(UART_DEV);
  stdio_uart_init_full(uart_inst, CFG_BOARD_UART_BAUDRATE, UART_TX_PIN, UART_RX_PIN);
#endif

Both snippets from hw/bsp/rp2040/family.c

I have checked existing issues, dicussion and documentation

  • I confirm I have checked existing issues, dicussion and documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant