Perturb USB de-config to better match vendor behavior

This was one of many changes along the path of discovering that `wfi`
seems to just break USBD.

This change is probably not necessary, but it feels more elegant.
This commit is contained in:
R
2026-07-07 00:06:50 +01:00
parent 03496cb28e
commit 81b5955a5c
+3 -1
View File
@@ -995,8 +995,10 @@ __attribute__((naked)) int main(void) {
while (!(STK_SR & 1)) {} while (!(STK_SR & 1)) {}
STK_CTLR = 0; STK_CTLR = 0;
STK_SR = 0; STK_SR = 0;
R16_USBD_CNTR = 0b11;
R32_EXTEN_CTR &= ~(1 << 1); R32_EXTEN_CTR &= ~(1 << 1);
R16_USBD_CNTR = 1;
R16_USBD_ISTR = 0;
R16_USBD_CNTR = 0b11;
if (ADDRESS_HI >> 8 == 0x20) { if (ADDRESS_HI >> 8 == 0x20) {
// ram boot, go back to original clock settings // ram boot, go back to original clock settings
R32_RCC_CFGR0 = (R32_RCC_CFGR0 & ~0b11) | 0b00; R32_RCC_CFGR0 = (R32_RCC_CFGR0 & ~0b11) | 0b00;