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
dos
firmware
Commits
17dc574f
Verified
Commit
17dc574f
authored
5 years ago
by
genofire
Browse files
Options
Downloads
Patches
Plain Diff
review fix of get rgb leds state
parent
6dfda96c
Branches
genofire/leds_rgb_get_state
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
epicardium/epicardium.h
+4
-2
4 additions, 2 deletions
epicardium/epicardium.h
epicardium/modules/leds.c
+3
-3
3 additions, 3 deletions
epicardium/modules/leds.c
pycardium/modules/sys_leds.c
+1
-1
1 addition, 1 deletion
pycardium/modules/sys_leds.c
with
8 additions
and
6 deletions
epicardium/epicardium.h
+
4
−
2
View file @
17dc574f
...
@@ -586,12 +586,14 @@ API(API_LEDS_SET, void epic_leds_set(int led, uint8_t r, uint8_t g, uint8_t b));
...
@@ -586,12 +586,14 @@ API(API_LEDS_SET, void epic_leds_set(int led, uint8_t r, uint8_t g, uint8_t b));
/**
/**
* Get one of card10's RGB LEDs in format of RGB.
* Get one of card10's RGB LEDs in format of RGB.
*
*
* :c:func:`epic_leds_get_rgb` will get the value of a RGB LED described by ``led``.
*
* :param int led: Which LED to set. 0-10 are the LEDs on the top and 11-14
* :param int led: Which LED to set. 0-10 are the LEDs on the top and 11-14
* are the 4 "ambient" LEDs.
* are the 4 "ambient" LEDs.
* :param uint8_t * rgb: need tree byte array to get the value of red, green and blue.
* :param uint8_t * rgb: need tree byte array to get the value of red, green and blue.
* :return
bool: if true the reading of value was not
blocked by personal
state
* :return
s: ``0`` on success or ``-EPERM`` if the LED is
blocked by personal
-
state
.
*/
*/
API
(
API_LEDS_GET
,
bool
epic_leds_get_rgb
(
int
led
,
uint8_t
*
rgb
));
API
(
API_LEDS_GET
,
int
epic_leds_get_rgb
(
int
led
,
uint8_t
*
rgb
));
/**
/**
* Set one of card10's RGB LEDs to a certain color in HSV format.
* Set one of card10's RGB LEDs to a certain color in HSV format.
...
...
This diff is collapsed.
Click to expand it.
epicardium/modules/leds.c
+
3
−
3
View file @
17dc574f
...
@@ -49,13 +49,13 @@ void epic_leds_prep(int led, uint8_t r, uint8_t g, uint8_t b)
...
@@ -49,13 +49,13 @@ void epic_leds_prep(int led, uint8_t r, uint8_t g, uint8_t b)
leds_prep
(
led
,
r
,
g
,
b
);
leds_prep
(
led
,
r
,
g
,
b
);
}
}
bool
epic_leds_get_rgb
(
int
led
,
uint8_t
*
rgb
)
int
epic_leds_get_rgb
(
int
led
,
uint8_t
*
rgb
)
{
{
if
(
led
==
PERSONAL_STATE_LED
&&
personal_state_enabled
())
if
(
led
==
PERSONAL_STATE_LED
&&
personal_state_enabled
())
return
false
;
return
-
EPERM
;
leds_get_rgb
(
led
,
rgb
);
leds_get_rgb
(
led
,
rgb
);
return
true
;
return
0
;
}
}
void
epic_leds_prep_hsv
(
int
led
,
float
h
,
float
s
,
float
v
)
void
epic_leds_prep_hsv
(
int
led
,
float
h
,
float
s
,
float
v
)
...
...
This diff is collapsed.
Click to expand it.
pycardium/modules/sys_leds.c
+
1
−
1
View file @
17dc574f
...
@@ -78,7 +78,7 @@ static mp_obj_t mp_leds_prep(mp_obj_t led_in, mp_obj_t color_in)
...
@@ -78,7 +78,7 @@ static mp_obj_t mp_leds_prep(mp_obj_t led_in, mp_obj_t color_in)
}
}
static
MP_DEFINE_CONST_FUN_OBJ_2
(
leds_prep_obj
,
mp_leds_prep
);
static
MP_DEFINE_CONST_FUN_OBJ_2
(
leds_prep_obj
,
mp_leds_prep
);
static
mp_obj_t
mp_leds_get_rgb
(
mp_obj_t
led_in
,
mp_obj_t
color_out
)
static
mp_obj_t
mp_leds_get_rgb
(
mp_obj_t
led_in
)
{
{
int
led
=
mp_obj_get_int
(
led_in
);
int
led
=
mp_obj_get_int
(
led_in
);
uint8_t
rgb
[]
=
{
0
,
0
,
0
};
uint8_t
rgb
[]
=
{
0
,
0
,
0
};
...
...
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