cnlohr / rv003usb

CH32V003 RISC-V Pure Software USB Controller
MIT License
436 stars 43 forks source link

make bootloader PORT configurable #37

Closed xsrf closed 8 months ago

xsrf commented 8 months ago

While the Pins already were configurable, the bootloader was still hardcoded to PORTD. This will fix it. Also commented the commonly used Pinout.

xsrf commented 8 months ago

@cnlohr I removed the (GPIO_CNF_IN_PUPD)<<(4*1) | // Keep SWIO enabled. as its only for PORTD and instead only reset and set the pins used for USB. Could have also used

#if USB_PORT == D
    (GPIO_CNF_IN_PUPD)<<(4*1) |  // Keep SWIO on PD1 enabled.
#endif

but I guess it's better to just not touch the other pin configurations?

cnlohr commented 8 months ago

If I struggle with getting things fitting again, I will consider adding that change to set only instead of configure for pin IO