Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
a7300fe1
Commit
a7300fe1
authored
Apr 07, 2022
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sensors: minor refactoring
parent
1ea37179
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
16 deletions
+13
-16
sensors.c
dev/sensors.c
+9
-12
sensors.h
include/sensors.h
+3
-3
ppsi
ppsi
+1
-1
No files found.
dev/sensors.c
View file @
a7300fe1
...
...
@@ -144,19 +144,16 @@ static int cmd_sensors(const char *args[])
{
pp_printf
(
"Sensors readout:
\n
"
);
struct
wrc_sensor
*
s
=
sensors
;
while
(
s
->
flags
)
{
if
(
s
->
flags
&
WRC_SENSOR_VALID
)
{
pp_printf
(
" - %-20s %-20s : %05d %s
\n
"
,
sensor_type_string
(
s
->
flags
),
s
->
name
,
s
->
value
,
sensor_unit_string
(
s
->
flags
)
struct
wrc_sensor
*
s
;
for
(
s
=
sensors
;
s
->
flags
;
s
++
)
{
if
(
!
(
s
->
flags
&
WRC_SENSOR_VALID
))
continue
;
pp_printf
(
" - %-20s %-20s : %05d %s
\n
"
,
sensor_type_string
(
s
->
flags
),
s
->
name
,
s
->
value
,
sensor_unit_string
(
s
->
flags
)
);
}
s
++
;
}
return
0
;
...
...
include/sensors.h
View file @
a7300fe1
...
...
@@ -6,8 +6,8 @@
*
* Released according to the GNU GPL, version 2 or any later version.
*/
#ifndef __
TEMPERATURE
_H__
#define __
TEMPERATURE
_H__
#ifndef __
SENSORS
_H__
#define __
SENSORS
_H__
#include <stdint.h>
...
...
@@ -59,4 +59,4 @@ struct wrc_sensor* wrc_sensor_find_by_name(char *name);
struct
wrc_sensor
*
wrc_sensor_find_by_id
(
uint8_t
id
);
struct
wrc_sensor
*
wrc_sensor_find_by_type
(
uint8_t
type
);
#endif
/* __
TEMPERATURE
_H__ */
#endif
/* __
SENSORS
_H__ */
ppsi
@
b9eb3b04
Subproject commit
1ce9244c5c2b3bc8371333abc65e1be04c3fc2ea
Subproject commit
b9eb3b049d4eb4400426879bc4d225ed0ca7d5dc
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment