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
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
zenox
firmware
Commits
d189f48e
Commit
d189f48e
authored
5 years ago
by
fuchsi*
Committed by
Ben Huber
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(bhi, leds): fixed faulty error handling due to always-false unsigned comparisons
parent
87bccda8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
epicardium/modules/bhi.c
+2
-2
2 additions, 2 deletions
epicardium/modules/bhi.c
pycardium/modules/sys_leds.c
+2
-2
2 additions, 2 deletions
pycardium/modules/sys_leds.c
pycardium/mphalport.c
+1
-1
1 addition, 1 deletion
pycardium/mphalport.c
with
5 additions
and
5 deletions
epicardium/modules/bhi.c
+
2
−
2
View file @
d189f48e
...
...
@@ -131,7 +131,7 @@ int epic_bhi160_enable_sensor(
int
result
=
0
;
bhy_virtual_sensor_t
vs_id
=
bhi160_lookup_vs_id
(
sensor_type
);
if
(
vs_id
<
0
)
{
if
(
vs_id
==
(
bhy_virtual_sensor_t
)
-
1
)
{
return
-
ENODEV
;
}
...
...
@@ -188,7 +188,7 @@ int epic_bhi160_disable_sensor(enum bhi160_sensor_type sensor_type)
int
result
=
0
;
bhy_virtual_sensor_t
vs_id
=
bhi160_lookup_vs_id
(
sensor_type
);
if
(
vs_id
<
0
)
{
if
(
vs_id
==
(
bhy_virtual_sensor_t
)
-
1
)
{
return
-
ENODEV
;
}
...
...
This diff is collapsed.
Click to expand it.
pycardium/modules/sys_leds.c
+
2
−
2
View file @
d189f48e
...
...
@@ -202,8 +202,8 @@ static MP_DEFINE_CONST_FUN_OBJ_2(leds_set_rocket_obj, mp_leds_set_rocket);
static
mp_obj_t
mp_leds_get_rocket
(
mp_obj_t
led_in
)
{
int
led
=
mp_obj_get_int
(
led_in
);
u
int
8_t
ret
=
epic_leds_get_rocket
(
led
);
int
led
=
mp_obj_get_int
(
led_in
);
int
ret
=
epic_leds_get_rocket
(
led
);
if
(
ret
==
-
EINVAL
)
{
mp_raise_ValueError
(
"invalid value: maybe the led does not exists"
...
...
This diff is collapsed.
Click to expand it.
pycardium/mphalport.c
+
1
−
1
View file @
d189f48e
...
...
@@ -112,7 +112,7 @@ void epic_isr_ctrl_c(void)
void
mp_hal_set_interrupt_char
(
char
c
)
{
if
(
c
!=
-
1
)
{
if
(
c
!=
'\xFF'
)
{
mp_obj_exception_clear_traceback
(
MP_OBJ_FROM_PTR
(
&
MP_STATE_VM
(
mp_kbd_exception
))
);
...
...
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