led-watch icon indicating copy to clipboard operation
led-watch copied to clipboard

Update usb.c

Open cctsao1008 opened this issue 3 years ago • 1 comments

Hello Kevin :

If we try to optimize the code the USB will not be recognized, except -O0.

I find that we need to keep the usb_handle_endp0 function in usb.c to O0 to avoid it being optimized and then we can optimize the others.

BR CCTSAO

cctsao1008 avatar Dec 25 '22 19:12 cctsao1008

This should have compiled just fine and did work for me when I last compiled it several years ago. It's possible that you have exposed a bug in arm-none-eabi-gcc when using -Os. This isn't unheard of, especially given that -Os is pretty aggressive. Which version of arm-none-eabi-gcc are you using?

Also, I'm curious: Did you actually construct the watch hardware? I wasn't aware of any interest in this project. I should let you know that after a while, the USB port actually ended up de-laminating off the board I had. If you're forking the project, I'd strongly suggesting rethinking the USB port, either changing it to be a version with through-hole mounting, changing the board to use VIPPO and putting some vias in the anchoring pads to provide structural support, or eliminating USB entirely and designing in some kind of wireless charging.

kcuzner avatar Dec 29 '22 23:12 kcuzner