Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Commits
44951ee7
Commit
44951ee7
authored
4 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
change(hid): Keep trying to type if queue is full
parent
65ecd937
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!382
HID over BLE
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pycardium/modules/py/ble_hid.py
+7
-1
7 additions, 1 deletion
pycardium/modules/py/ble_hid.py
pycardium/modules/sys_ble_hid.c
+9
-0
9 additions, 0 deletions
pycardium/modules/sys_ble_hid.c
with
16 additions
and
1 deletion
pycardium/modules/py/ble_hid.py
+
7
−
1
View file @
44951ee7
import
sys_ble_hid
import
time
class
Report
:
...
...
@@ -8,7 +9,12 @@ class Report:
self
.
usage
=
usage
def
send_report
(
self
,
data
):
sys_ble_hid
.
send_report
(
self
.
report_id
,
data
)
while
True
:
try
:
sys_ble_hid
.
send_report
(
self
.
report_id
,
data
)
break
except
MemoryError
:
time
.
sleep
(
0.1
)
# Reports as defined in the HID report map in epicardium/ble/hid.c
...
...
This diff is collapsed.
Click to expand it.
pycardium/modules/sys_ble_hid.c
+
9
−
0
View file @
44951ee7
...
...
@@ -12,6 +12,15 @@ static mp_obj_t mp_sys_ble_hid_send_report(mp_obj_t report_id, mp_obj_t data)
int
ret
=
epic_ble_hid_send_report
(
mp_obj_get_int
(
report_id
),
bufinfo
.
buf
,
bufinfo
.
len
);
if
(
ret
==
-
EAGAIN
)
{
mp_raise_msg
(
&
mp_type_MemoryError
,
NULL
);
}
if
(
ret
<
0
)
{
mp_raise_OSError
(
-
ret
);
}
return
mp_obj_new_int
(
ret
);
}
static
MP_DEFINE_CONST_FUN_OBJ_2
(
...
...
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