Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
e7020e_2021
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
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
Deux Babiri Futari
e7020e_2021
Commits
c22a2174
Commit
c22a2174
authored
4 years ago
by
Per Lindgren
Browse files
Options
Downloads
Patches
Plain Diff
usb workning
parent
c1d0041f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/usb-mouse.rs
+2
-24
2 additions, 24 deletions
examples/usb-mouse.rs
with
2 additions
and
24 deletions
examples/usb-mouse.rs
+
2
−
24
View file @
c22a2174
...
...
@@ -111,7 +111,7 @@ pub mod hid {
&
[
0x01
,
// bcdHID
0x01
,
// bcdHID
0x00
,
// bContryCode
0x00
,
// bCo
u
ntryCode
0x01
,
// bNumDescriptors
0x22
,
// bDescriptorType
descr_len
as
u8
,
// wDescriptorLength
...
...
@@ -253,8 +253,6 @@ const APP: () = {
*
USB_BUS
=
Some
(
UsbBus
::
new
(
usb
,
EP_MEMORY
));
// let usb_bus = UsbBus::new(usb, unsafe { &mut EP_MEMORY });
let
hid
=
HIDClass
::
new
(
USB_BUS
.as_ref
()
.unwrap
());
let
usb_dev
=
UsbDeviceBuilder
::
new
(
USB_BUS
.as_ref
()
.unwrap
(),
UsbVidPid
(
0xc410
,
0x0000
))
...
...
@@ -296,28 +294,8 @@ const APP: () = {
}
}
// #[task(binds=USB_HP_CAN_TX, resources = [counter, led, usb_dev, hid])]
// fn usb_tx(mut cx: usb_tx::Context) {
// usb_poll(
// &mut cx.resources.counter,
// &mut cx.resources.led,
// &mut cx.resources.usb_dev,
// &mut cx.resources.hid,
// );
// }
// #[task(binds=USB_LP_CAN_RX0, resources = [counter, led, usb_dev, hid])]
// fn usb_rx(mut cx: usb_rx::Context) {
// usb_poll(
// &mut cx.resources.counter,
// &mut cx.resources.led,
// &mut cx.resources.usb_dev,
// &mut cx.resources.hid,
// );
// }
#[task(binds=OTG_FS,
resources
=
[
counter,
led,
usb_dev,
hid]
)]
fn
usb_
rx
(
mut
cx
:
usb_
rx
::
Context
)
{
fn
usb_
fs
(
mut
cx
:
usb_
fs
::
Context
)
{
usb_poll
(
&
mut
cx
.resources.counter
,
&
mut
cx
.resources.led
,
...
...
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