Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit core collection
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
30
Issues
30
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
White Rabbit core collection
Commits
24ebdb55
Commit
24ebdb55
authored
Jun 23, 2017
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print also built-in init script with _init show_ cmd
parent
fda53d29
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
1 deletion
+26
-1
sdb-storage.c
dev/sdb-storage.c
+2
-1
shell.h
include/shell.h
+1
-0
cmd_init.c
shell/cmd_init.c
+1
-0
shell.c
shell/shell.c
+22
-0
No files found.
dev/sdb-storage.c
View file @
24ebdb55
...
...
@@ -694,6 +694,7 @@ int storage_init_show(void)
if
(
sdbfs_open_id
(
&
wrc_sdb
,
SDB_VENDOR
,
SDB_DEV_INIT
)
<
0
)
return
-
1
;
pp_printf
(
"-- user-defined script --
\n
"
);
used
=
0
;
do
{
if
(
sdbfs_fread
(
&
wrc_sdb
,
sizeof
(
used
)
+
used
,
&
byte
,
1
)
!=
1
)
...
...
@@ -705,7 +706,7 @@ int storage_init_show(void)
}
while
(
byte
!=
0xff
);
if
(
used
==
0
)
pp_printf
(
"
Empty init script...
\n
"
);
pp_printf
(
"
(empty)
\n
"
);
ret
=
0
;
out:
sdbfs_close
(
&
wrc_sdb
);
...
...
include/shell.h
View file @
24ebdb55
...
...
@@ -39,5 +39,6 @@ int shell_interactive(void);
extern
int
shell_is_interacting
;
void
shell_boot_script
(
void
);
void
shell_show_build_init
(
void
);
#endif
shell/cmd_init.c
View file @
24ebdb55
...
...
@@ -25,6 +25,7 @@ static int cmd_init(const char *args[])
else
pp_printf
(
"OK.
\n
"
);
}
else
if
(
args
[
0
]
&&
!
strcasecmp
(
args
[
0
],
"show"
))
{
shell_show_build_init
();
storage_init_show
();
}
else
if
(
args
[
0
]
&&
!
strcasecmp
(
args
[
0
],
"boot"
))
{
shell_boot_script
();
...
...
shell/shell.c
View file @
24ebdb55
...
...
@@ -278,6 +278,11 @@ static int build_init_readcmd(uint8_t *cmd, int maxlen)
p
+=
i
;
if
(
*
p
==
';'
)
p
++
;
if
(
i
==
0
)
{
/* it's the last call, roll-back *p to be ready for the next
* call */
p
=
shell_init_cmd
;
}
return
i
;
}
...
...
@@ -314,3 +319,20 @@ void shell_boot_script(void)
return
;
}
void
shell_show_build_init
(
void
)
{
uint8_t
i
=
0
;
pp_printf
(
"-- built-in script --
\n
"
);
while
(
CONFIG_HAS_BUILD_INIT
)
{
cmd_len
=
build_init_readcmd
((
uint8_t
*
)
cmd_buf
,
SH_MAX_LINE_LEN
);
if
(
!
cmd_len
)
break
;
pp_printf
(
"%s
\n
"
,
cmd_buf
);
++
i
;
}
if
(
!
i
)
pp_printf
(
"(empty)
\n
"
);
}
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