Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
François Revol
firmware
Commits
b57d3b92
Verified
Commit
b57d3b92
authored
Jun 15, 2019
by
Rahix
Browse files
refactor(upy): Enhance build system wrapper
QSTR generation is a pain ... Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
c30d297a
Changes
5
Hide whitespace changes
Inline
Side-by-side
bootstrap.sh
View file @
b57d3b92
#!/bin/sh
set
-xe
cd
"
$(
dirname
"
$0
"
)
"
||
exit
1
cd
"
$(
dirname
"
$0
"
)
"
test
-d
build/
&&
rm
-r
build/
git submodule update
--init
--recursive
git submodule update
--init
./lib/micropython
meson
--cross-file
card10-cross.ini build/
set
+x
...
...
hw-tests/upy-minimal/meson.build
View file @
b57d3b92
...
...
@@ -31,7 +31,8 @@ modules_h = custom_target(
qstr_h
=
custom_target
(
'qstrdefs.generated.h'
,
output
:
'qstrdefs.generated.h'
,
input
:
[
modules_h
,
version_h
,
micropython_sources
,
'modules/qstr.h'
],
input
:
[
'modules/qstrdefs.h'
,
micropython_sources
],
depends
:
[
modules_h
,
version_h
],
command
:
[
micropython_gen_qstr
,
meson
.
current_source_dir
(),
'@OUTPUT@'
,
'@INPUT@'
],
)
...
...
hw-tests/upy-minimal/modules/qstr.h
deleted
100644 → 0
View file @
c30d297a
MP_QSTR_leds
MP_QSTR_set_dim
MP_QSTR_utime
MP_QSTR_sleep
MP_QSTR_sleep_ms
MP_QSTR_sleep_us
MP_QSTR_ticks_ms
MP_QSTR_ticks_us
MP_QSTR_ticks_cpu
MP_QSTR_ticks_add
MP_QSTR_ticks_diff
MP_QSTR_buzzer
hw-tests/upy-minimal/modules/qstrdefs.h
0 → 100644
View file @
b57d3b92
#include
"py/mpconfig.h"
/* buzzer */
Q
(
buzzer
)
/* leds */
Q
(
leds
)
Q
(
set_dim
)
/* utime */
Q
(
utime
)
Q
(
sleep
)
Q
(
sleep_ms
)
Q
(
sleep_us
)
Q
(
ticks_ms
)
Q
(
ticks_us
)
Q
(
ticks_cpu
)
Q
(
ticks_add
)
Q
(
ticks_diff
)
lib/micropython/gen-qstr.sh
View file @
b57d3b92
...
...
@@ -5,7 +5,7 @@ PYTHON="$1"
SOURCE_DIR
=
"
$2
"
PROJECT_SRC
=
"
$3
"
OUTPUT
=
"
$4
"
# IGNORE
="$5"
CUSTOM_QSTR
=
"
$5
"
shift
5
...
...
@@ -27,7 +27,7 @@ gcc -E -DNO_QSTR -I"$SOURCE_DIR/micropython" -I"$PROJECT_SRC" -I"$OUTPUT_DIR" "$
# Preprocess Header ... I did not come up with this, this is code copied from
# the official make file. Seriously.
cat
"
$SOURCE_DIR
/micropython/py/qstrdefs.h"
"
$OUTPUT_DIR
/qstrdefs.collected.h"
\
cat
"
$SOURCE_DIR
/micropython/py/qstrdefs.h"
"
$CUSTOM_QSTR
"
"
$OUTPUT_DIR
/qstrdefs.collected.h"
\
|
sed
's/^Q(.*)/"&"/'
\
| gcc
-E
-I
"
$SOURCE_DIR
/micropython"
-I
"
$PROJECT_SRC
"
-I
"
$OUTPUT_DIR
"
-
\
|
sed
's/^\"\(Q(.*)\)\"/\1/'
\
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment