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
1bf74119
Commit
1bf74119
authored
Apr 12, 2022
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kconfig: add GENERIC_SENSORS
Adjust dev/sensors.c and shell/shell.c
parent
dfacc6d0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
1 deletion
+20
-1
Kconfig
Kconfig
+8
-0
ertm14_defconfig
configs/ertm14_defconfig
+1
-0
sensors.c
dev/sensors.c
+3
-0
shell.c
shell/shell.c
+8
-1
No files found.
Kconfig
View file @
1bf74119
...
...
@@ -107,6 +107,7 @@ config TEMP_HIGH_THRESHOLD
config TEMP_HIGH_RAPPEL
int
default 60
config PLL_VERBOSE
boolean
default y if TARGET_WR_SWITCH
...
...
@@ -473,6 +474,13 @@ config TEMP_SENSORS
Please note that temperature sensor type has to be selected as well
(like w1)
config GENERIC_SENSORS
depends on WR_NODE
boolean "Add support for generic sensors"
default n
help
Include generic (temperature, current, voltage) sensors.
config W1
depends on EMBEDDED_NODE
boolean "Add support for W1 bus"
...
...
configs/ertm14_defconfig
View file @
1bf74119
...
...
@@ -91,6 +91,7 @@ CONFIG_PRINTF_IS_FULL=y
# CONFIG_SNMP_VERBOSE is not set
# CONFIG_FAKE_TEMPERATURES is not set
# CONFIG_LATENCY_PROBE is not set
CONFIG_GENERIC_SENSORS=y
CONFIG_DEFAULT_PRINT_TASK_TIME_THRESHOLD=0
CONFIG_VLAN_ARRAY_SIZE=1
# CONFIG_PRINTF_XINT is not set
...
...
dev/sensors.c
View file @
1bf74119
...
...
@@ -13,6 +13,8 @@
#include <shell.h>
#ifdef CONFIG_GENERIC_SENSORS
static
struct
wrc_sensor
*
sensors
=
NULL
;
const
char
*
sensor_type_string
(
uint8_t
flags
)
...
...
@@ -116,3 +118,4 @@ DEFINE_WRC_COMMAND(sensors) = {
.
exec
=
cmd_sensors
,
};
#endif
/* CONFIG_GENERIC_SENSORS */
shell/shell.c
View file @
1bf74119
...
...
@@ -88,6 +88,12 @@
#define HAS_LATENCY_PROBE 0
#endif
#ifdef CONFIG_GENERIC_SENSORS
#define HAS_GENERIC_SENSORS 1
#else
#define HAS_GENERIC_SENSORS 0
#endif
static
char
cmd_buf
[
SH_MAX_LINE_LEN
+
1
];
static
int
cmd_pos
=
0
,
cmd_len
=
0
;
static
int
state
=
SH_PROMPT
;
...
...
@@ -453,7 +459,8 @@ void shell_register_commands(void)
REGISTER_WRC_COMMAND
(
syslog
);
if
(
HAS_TEMP_SENSORS
)
REGISTER_WRC_COMMAND
(
temp
);
REGISTER_WRC_COMMAND
(
sensors
);
if
(
HAS_GENERIC_SENSORS
)
REGISTER_WRC_COMMAND
(
sensors
);
REGISTER_WRC_COMMAND
(
time
);
REGISTER_WRC_COMMAND
(
uptime
);
REGISTER_WRC_COMMAND
(
ver
);
...
...
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