Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
1090f1a6
Commit
1090f1a6
authored
Aug 12, 2024
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shared/runtime/semihosting_arm: Add mp_semihosting_exit.
Signed-off-by:
Damien George
<
damien@micropython.org
>
parent
70a6791b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
shared/runtime/semihosting_arm.c
shared/runtime/semihosting_arm.c
+8
-0
shared/runtime/semihosting_arm.h
shared/runtime/semihosting_arm.h
+1
-0
No files found.
shared/runtime/semihosting_arm.c
View file @
1090f1a6
...
...
@@ -36,6 +36,7 @@
#define SYS_WRITE 0x05
#define SYS_READ 0x06
#define SYS_READC 0x07
#define SYS_EXIT 0x18
// Constants:
#define OPEN_MODE_READ (0) // mode "r"
...
...
@@ -88,6 +89,13 @@ void mp_semihosting_init() {
mp_semihosting_stdout
=
mp_semihosting_open_console
(
OPEN_MODE_WRITE
);
}
void
mp_semihosting_exit
(
int
status
)
{
if
(
status
==
0
)
{
status
=
0x20026
;
}
mp_semihosting_call
(
SYS_EXIT
,
(
void
*
)(
uintptr_t
)
status
);
}
int
mp_semihosting_rx_char
()
{
return
mp_semihosting_call
(
SYS_READC
,
NULL
);
}
...
...
shared/runtime/semihosting_arm.h
View file @
1090f1a6
...
...
@@ -46,6 +46,7 @@ If mp_semihosting_rx_char() doesn't work then try mp_semihosting_rx_chars(str, 1
#include <stdint.h>
void
mp_semihosting_init
();
void
mp_semihosting_exit
(
int
status
);
int
mp_semihosting_rx_char
();
int
mp_semihosting_rx_chars
(
char
*
str
,
size_t
len
);
uint32_t
mp_semihosting_tx_strn
(
const
char
*
str
,
size_t
len
);
...
...
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