Skip to content
GitLab
Explore
Sign in
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
fa1b7388
Commit
fa1b7388
authored
11 years ago
by
Lorenz Meier
Browse files
Options
Downloads
Patches
Plain Diff
Implemented new led status proposal
parent
3ec536a8
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
src/modules/commander/commander.c
+24
-6
24 additions, 6 deletions
src/modules/commander/commander.c
with
24 additions
and
6 deletions
src/modules/commander/commander.c
+
24
−
6
View file @
fa1b7388
...
...
@@ -1503,22 +1503,40 @@ int commander_thread_main(int argc, char *argv[])
if
((
current_status
.
state_machine
==
SYSTEM_STATE_GROUND_READY
||
current_status
.
state_machine
==
SYSTEM_STATE_AUTO
||
current_status
.
state_machine
==
SYSTEM_STATE_MANUAL
))
{
/* armed */
led_
toggle
(
LED_BLUE
);
/* armed
, solid
*/
led_
on
(
LED_AMBER
);
}
else
if
(
counter
%
(
1000000
/
COMMANDER_MONITORING_INTERVAL
)
==
0
)
{
/* not armed */
led_toggle
(
LED_BLUE
);
led_toggle
(
LED_AMBER
);
}
if
(
hrt_absolute_time
()
-
gps_position
.
timestamp_position
<
2000000
)
{
/* toggle GPS (blue) led at 1 Hz if GPS present but no lock, make is solid once locked */
if
((
hrt_absolute_time
()
-
gps_position
.
timestamp_position
<
2000000
)
&&
(
gps_position
.
fix_type
==
GPS_FIX_TYPE_3D
))
{
/* GPS lock */
led_on
(
LED_BLUE
);
}
else
if
(
counter
%
(
1000000
/
COMMANDER_MONITORING_INTERVAL
)
==
0
)
{
/* no GPS lock, but GPS module is aquiring lock */
led_toggle
(
LED_BLUE
);
}
}
else
{
/* no GPS info, don't light the blue led */
led_off
(
LED_BLUE
);
}
/* toggle
error
led at 5 Hz in HIL mode */
/* toggle
GPS
led at 5 Hz in HIL mode */
if
(
current_status
.
flag_hil_enabled
)
{
/* hil enabled */
led_toggle
(
LED_
AMBER
);
led_toggle
(
LED_
BLUE
);
}
else
if
(
bat_remain
<
0
.
3
f
&&
(
low_voltage_counter
>
LOW_VOLTAGE_BATTERY_COUNTER_LIMIT
))
{
/* toggle error (red) at 5 Hz on low battery or error */
led_toggle
(
LED_
AMBER
);
led_toggle
(
LED_
BLUE
);
}
else
{
// /* Constant error indication in standby mode without GPS */
...
...
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