Skip to content

Commit 883c1e9

Browse files
committed
Add core version defines split as major.minor.patch
1 parent 18967ca commit 883c1e9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mbed-os-to-arduino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ generate_defines () {
141141
echo -n "Generating defines..."
142142
cut -f2 -d":" < "$BOARDNAME".macros.txt | tr ' ' '\n' | sed 's#\"#\\"#g' | sort > "$ARDUINOVARIANT"/defines.txt
143143
echo "-DMBED_NO_GLOBAL_USING_DIRECTIVE=1" >> "$ARDUINOVARIANT"/defines.txt
144+
MAJOR=$(echo $VERSION| cut -d'.' -f 1)
145+
MINOR=$(echo $VERSION| cut -d'.' -f 2)
146+
PATCH=$(echo $VERSION| cut -d'.' -f 3)
147+
echo "-DCORE_MAJOR=$MAJOR" >> "$ARDUINOVARIANT"/defines.txt
148+
echo "-DCORE_MINOR=$MINOR" >> "$ARDUINOVARIANT"/defines.txt
149+
echo "-DCORE_PATCH=$PATCH" >> "$ARDUINOVARIANT"/defines.txt
144150
if [ -f "$ARDUINOVARIANT"/variant.cpp ]; then
145151
echo '-DUSE_ARDUINO_PINOUT' >> "$ARDUINOVARIANT"/defines.txt
146152
fi

0 commit comments

Comments
 (0)