Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hn70ap
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
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
f4grx
hn70ap
Commits
6de32fc9
Commit
6de32fc9
authored
6 years ago
by
f4grx
Browse files
Options
Downloads
Patches
Plain Diff
build fixes
parent
3b30975c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
apps/export/leds.h
+1
-1
1 addition, 1 deletion
apps/export/leds.h
apps/libhn70ap/leds.c
+31
-2
31 additions, 2 deletions
apps/libhn70ap/leds.c
apps/libhn70ap/timer.c
+2
-1
2 additions, 1 deletion
apps/libhn70ap/timer.c
apps/sysdaemon/sysdaemon_main.c
+6
-3
6 additions, 3 deletions
apps/sysdaemon/sysdaemon_main.c
with
40 additions
and
7 deletions
apps/export/leds.h
+
1
−
1
View file @
6de32fc9
...
...
@@ -36,7 +36,7 @@
#ifndef HN70AP_TIMER
#define HN70AP_TIMER
int
led_init
(
void
);
int
led
s
_init
(
void
);
int
leds_state
(
int
led
,
int
state
);
#endif //HN70AP_TIMER
This diff is collapsed.
Click to expand it.
apps/libhn70ap/leds.c
+
31
−
2
View file @
6de32fc9
...
...
@@ -36,16 +36,45 @@
#include
<nuttx/config.h>
#include
<stdint.h>
#include
"timer.h"
#include
<stdbool.h>
#include
<stdio.h>
#include
<fcntl.h>
#include
<sys/ioctl.h>
#include
<unistd.h>
#include
<nuttx/leds/userled.h>
#include
<hn70ap/timer.h>
int
leds_init
(
void
)
{
}
int
leds_state
(
int
led
,
int
state
)
int
leds_state
(
int
led
num
,
bool
state
)
{
struct
userled_s
led
;
int
fd
;
int
ret
;
fd
=
open
(
"/dev/userleds"
,
O_RDWR
);
if
(
fd
<
0
)
{
fprintf
(
stderr
,
"Failed to open LEDS device
\n
"
);
return
-
1
;
}
led
.
ul_led
=
lednum
;
led
.
ul_on
=
state
;
ret
=
ioctl
(
fd
,
ULEDIOC_SETLED
,
(
unsigned
long
)
&
led
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"Failed to change LED state
\n
"
);
return
-
1
;
}
close
(
fd
);
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
apps/libhn70ap/timer.c
+
2
−
1
View file @
6de32fc9
...
...
@@ -36,7 +36,8 @@
#include
<nuttx/config.h>
#include
<stdint.h>
#include
"timer.h"
#include
<hn70ap/timer.h>
int
timer_init
(
void
)
{
...
...
This diff is collapsed.
Click to expand it.
apps/sysdaemon/sysdaemon_main.c
+
6
−
3
View file @
6de32fc9
...
...
@@ -45,6 +45,8 @@
#include
<sys/mount.h>
#include
<hn70ap/eeprom.h>
#include
<hn70ap/timer.h>
#include
<hn70ap/leds.h>
#include
"sysdaemon_internal.h"
...
...
@@ -90,17 +92,17 @@ int sysdaemon_main(int argc, char *argv[])
ret
=
timer_init
();
if
(
ret
!=
0
)
{
printf
(
"Failed to initialize timers
\n
"
);
printf
(
"
FATAL:
Failed to initialize timers
\n
"
);
goto
lfail
;
}
/* Initialize the leds */
/* Requires timer for blinking */
ret
=
led_init
();
ret
=
led
s
_init
();
if
(
ret
!=
0
)
{
printf
(
"Failed to initialize
timer
s
\n
"
);
printf
(
"
FATAL:
Failed to initialize
Led
s
\n
"
);
goto
lfail
;
}
...
...
@@ -143,5 +145,6 @@ lfail:
/* Panic... something could not be initialized
* Try to switch on the red LED
*/
return
ERROR
;
}
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