Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ch32v003fun
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Horn
ch32v003fun
Commits
9732a815
Commit
9732a815
authored
10 months ago
by
cnlohr
Browse files
Options
Downloads
Patches
Plain Diff
Tweak setupp ins
parent
5f0474c8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples_x035/usbdevice.incomplete/fsusb.c
+3
-4
3 additions, 4 deletions
examples_x035/usbdevice.incomplete/fsusb.c
with
3 additions
and
4 deletions
examples_x035/usbdevice.incomplete/fsusb.c
+
3
−
4
View file @
9732a815
...
...
@@ -6,6 +6,7 @@ uint8_t EP0_DATA[64] __attribute__((aligned(32)));
void
USBFS_IRQHandler
()
__attribute__
((
section
(
".text.vector_handler"
)))
__attribute__
((
interrupt
));
// Mask for the combined USBFSD->INT_FG + USBFSD->INT_ST
#define CRB_U_IS_NAK (1<<7)
#define CTOG_MATCH_SYNC (1<<6)
#define CRB_U_SIE_FREE (1<<5)
...
...
@@ -113,10 +114,8 @@ int FSUSBSetup()
// Enable PC16/17 Alternate Function (USB)
// According to EVT, GPIO16 = GPIO_Mode_IN_FLOATING, GPIO17 = GPIO_Mode_IPU
GPIOC
->
CFGXR
&=
~
(
0xf
<<
(
4
*
0
));
GPIOC
->
CFGXR
|=
(
GPIO_CFGLR_IN_FLOAT
)
<<
(
4
*
0
);
// MSBs are CNF, LSBs are MODE
GPIOC
->
CFGXR
&=
~
(
0xf
<<
(
4
*
1
));
GPIOC
->
CFGXR
|=
(
GPIO_CFGLR_IN_PUPD
)
<<
(
4
*
1
);
GPIOC
->
CFGXR
=
(
GPIOC
->
CFGXR
&
~
(
(
0xf
<<
(
4
*
0
))
|
(
0xf
<<
(
4
*
1
))
)
)
|
(((
GPIO_CFGLR_IN_FLOAT
)
<<
(
4
*
0
))
|
((
GPIO_CFGLR_IN_PUPD
)
<<
(
4
*
1
));
// MSBs are CNF, LSBs are MODE
GPIOC
->
BSXR
=
1
<<
1
;
// PC17 on.
USBFS
->
UDEV_CTRL
=
RB_UD_PORT_EN
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment