Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

Commit 856d9d3

Browse files
committed
Fix mbed-os-to-arduino for Linux compatibility and inline help
1 parent c8c3519 commit 856d9d3

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

mbed-os-to-arduino

+10-5
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ MAIN_C
8181
"macros": [
8282
"MBED_HEAP_STATS_ENABLED=1",
8383
"MBED_STACK_STATS_ENABLED=1",
84-
"MBED_MEM_TRACING_ENABLED=1",
84+
"MBED_MEM_TRACING_ENABLED=1"
8585
],
8686
"target_overrides": {
8787
"*": {
8888
"platform.stdio-buffered-serial": true,
8989
"platform.stdio-baud-rate": 115200,
90-
"platform.default-serial-baud-rate": 115200,
90+
"platform.default-serial-baud-rate": 115200
9191
}
9292
}
9393
}
@@ -187,13 +187,18 @@ copy_core_files () {
187187

188188
patch_mbed_h () {
189189
echo -n "Patching 'mbed.h'..."
190-
ed "$ARDUINOCOREMBED"/mbed.h >/dev/null <<EOF
190+
if [ x`uname` == xLinux ]; then
191+
sed -i 's?#include "platform/mbed_version.h"?#include "platform/mbed_version.h"\n#include "mbed_config.h"?g' \
192+
"$ARDUINOCOREMBED"/mbed.h
193+
else
194+
ed "$ARDUINOCOREMBED"/mbed.h >/dev/null <<EOF
191195
/#include "platform\/mbed_version.h"/
192196
a
193197
#include "mbed_config.h"
194198
.
195199
wq
196200
EOF
201+
fi
197202
echo " done."
198203
}
199204

@@ -237,8 +242,8 @@ if [ $# -eq 0 ] ; then
237242
echo " -c clean Mbed application BUILD directory"
238243
echo " -u update to latest mbed-os release"
239244
echo " -a apply patches"
240-
echo " -r specify remote mbed-os branch to checkout"
241-
echo " -b specify local mbed-os directory to link"
245+
echo " -b specify remote mbed-os branch to checkout"
246+
echo " -r specify local mbed-os directory to link"
242247
echo " -p specify local mbed core directory (defaults to PWD)"
243248
echo
244249
echo "Example:"

0 commit comments

Comments
 (0)