Skip to content

Commit 07d1380

Browse files
committed
temp
Signed-off-by: sakumisu <1203593632@qq.com>
1 parent ef4a616 commit 07d1380

2 files changed

Lines changed: 40 additions & 19 deletions

File tree

‎.github/workflows/build_tests.yml‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ jobs:
135135
run: |
136136
cd ~
137137
git clone https://github.com/CherryUSB/wch-support-cherryusb.git --recursive
138+
138139
- name: Download RISC-V toolchain
139140
run: |
140141
cd ~
@@ -177,3 +178,33 @@ jobs:
177178
scons --board=sf32lb52-lcd_n16r8 -j8
178179
cd ~/SiFli-SDK/example/cherryusb/host/msc_host/project
179180
scons --board=sf32lb52-lcd_n16r8 -j8
181+
182+
build_phytium:
183+
runs-on: ubuntu-latest
184+
steps:
185+
- name: Checkout repository
186+
uses: actions/checkout@v3
187+
188+
- name: Install dependencies
189+
run: sudo apt-get update && sudo apt-get install -y make
190+
191+
- name: Download toolchain
192+
run: |
193+
cd ~
194+
git clone https://github.com/CherryUSB/phytium_env_ubuntu_x64
195+
196+
- name: Build phytium demo
197+
run: |
198+
cd ~/phytium_env_ubuntu_x64
199+
./setup_dev.py
200+
source /etc/profile.d/phytium_dev.sh
201+
cd ~
202+
git clone https://gitee.com/phytium_embedded/phytium-free-rtos-sdk.git
203+
cd ~/phytium-free-rtos-sdk
204+
git checkout 1e6f4ca501d9cd92a99204193939e45df6b8502d
205+
./install.py
206+
sudo mkdir -p output
207+
cd ~/phytium-free-rtos-sdk/example/peripheral/usb/usb_device
208+
make all_images USR_BOOT_DIR=output
209+
cd ~/phytium-free-rtos-sdk/example/peripheral/usb/usb_host
210+
make all_images USR_BOOT_DIR=output

‎port/dwc2/usb_dc_dwc2.c‎

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -625,10 +625,13 @@ int usb_dc_deinit(uint8_t busid)
625625
USB_OTG_GLB->GAHBCFG &= ~USB_OTG_GAHBCFG_GINT;
626626
USB_OTG_DEV->DCTL |= USB_OTG_DCTL_SDIS;
627627

628-
/* Clear Pending interrupt */
629628
for (uint8_t i = 0U; i < 15U; i++) {
629+
USB_OTG_INEP(i)->DIEPCTL = 0;
630+
USB_OTG_OUTEP(i)->DOEPCTL = USB_OTG_DOEPCTL_SNAK;
630631
USB_OTG_INEP(i)->DIEPINT = 0xFB7FU;
631632
USB_OTG_OUTEP(i)->DOEPINT = 0xFB7FU;
633+
USB_OTG_INEP(i)->DIEPTSIZ = 0U;
634+
USB_OTG_OUTEP(i)->DOEPTSIZ = 0U;
632635
}
633636

634637
/* Clear interrupt masks */
@@ -782,7 +785,7 @@ int usbd_ep_close(uint8_t busid, const uint8_t ep)
782785
do {
783786
if (++count > 50000) {
784787
break;
785-
}
788+
}
786789
} while ((USB_OTG_GLB->GINTSTS & USB_OTG_GINTSTS_BOUTNAKEFF) != USB_OTG_GINTSTS_BOUTNAKEFF);
787790

788791
USB_OTG_OUTEP(ep_idx)->DOEPCTL |= USB_OTG_DOEPCTL_SNAK;
@@ -1173,25 +1176,12 @@ void USBD_IRQHandler(uint8_t busid)
11731176
dwc2_flush_rxfifo(busid);
11741177

11751178
for (uint8_t i = 0U; i < (g_dwc2_udc[busid].hw_params.num_dev_ep + 1); i++) {
1176-
if (i == 0U) {
1177-
USB_OTG_INEP(i)->DIEPCTL = USB_OTG_DIEPCTL_SNAK;
1178-
USB_OTG_OUTEP(i)->DOEPCTL = USB_OTG_DOEPCTL_SNAK;
1179-
} else {
1180-
if (USB_OTG_INEP(i)->DIEPCTL & USB_OTG_DIEPCTL_EPENA) {
1181-
USB_OTG_INEP(i)->DIEPCTL = (USB_OTG_DIEPCTL_EPDIS | USB_OTG_DIEPCTL_SNAK);
1182-
} else {
1183-
USB_OTG_INEP(i)->DIEPCTL = 0;
1184-
}
1185-
if (USB_OTG_OUTEP(i)->DOEPCTL & USB_OTG_DOEPCTL_EPENA) {
1186-
USB_OTG_OUTEP(i)->DOEPCTL = (USB_OTG_DOEPCTL_EPDIS | USB_OTG_DOEPCTL_SNAK);
1187-
} else {
1188-
USB_OTG_OUTEP(i)->DOEPCTL = 0;
1189-
}
1190-
}
1179+
USB_OTG_INEP(i)->DIEPCTL = 0;
1180+
USB_OTG_OUTEP(i)->DOEPCTL = USB_OTG_DOEPCTL_SNAK;
1181+
USB_OTG_INEP(i)->DIEPINT = 0xFB7FU;
1182+
USB_OTG_OUTEP(i)->DOEPINT = 0xFB7FU;
11911183
USB_OTG_INEP(i)->DIEPTSIZ = 0U;
1192-
USB_OTG_INEP(i)->DIEPINT = 0xFBFFU;
11931184
USB_OTG_OUTEP(i)->DOEPTSIZ = 0U;
1194-
USB_OTG_OUTEP(i)->DOEPINT = 0xFBFFU;
11951185
}
11961186

11971187
USB_OTG_DEV->DAINTMSK |= 0x10001U;

0 commit comments

Comments
 (0)