tinyusb icon indicating copy to clipboard operation
tinyusb copied to clipboard

tusb_fifo: split constant address functions

Open mndza opened this issue 2 years ago • 4 comments

Describe the PR Due to a missed optimization in the compiler, code for constant address handling is being included in all builds. This change splits the code in different functions to avoid that.

Additional context In some samd11 builds there's a difference of ~480 bytes in the final binary size.

mndza avatar Jun 30 '23 09:06 mndza

Hi, sorry for the delay. It's hard to say, I believe you got reduced size as constant address functions are not used in your case, however on stm32 it increases code size of ~250 bytes.

HiFiPhile avatar Apr 28 '24 15:04 HiFiPhile

@mndza Please allow maintainer write access to branch. I've splitted const addr functions with macro so no more size increase when they are actually used.

HiFiPhile avatar Apr 29 '24 20:04 HiFiPhile

I can't do that, but I can recreate the PR within a personal repository. Is that OK?

mndza avatar May 02 '24 08:05 mndza

I can't do that, but I can recreate the PR within a personal repository. Is that OK?

I'll do a PR then since the approach is different. You can test it first:

https://github.com/HiFiPhile/tinyusb/tree/fifo_const_split

HiFiPhile avatar May 02 '24 08:05 HiFiPhile