diff options
author | clyne <clyne@bitgloo.com> | 2021-03-21 16:34:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-21 16:34:21 -0400 |
commit | 9b926b81ef1e8a4c7266494ae2a1369380e01b35 (patch) | |
tree | 746095fa69eccccdc1c2830fdd0c06bac01848f5 /ChibiOS_20.3.2/tools | |
parent | e080a26651f90c88176140d63a74c93c2f4041a2 (diff) | |
parent | a4f1482a8b23d5f761f60d6f3821c84190d89e2f (diff) |
Merge pull request #3 from tcsullivan/stm32h7
Stm32h7
Diffstat (limited to 'ChibiOS_20.3.2/tools')
30 files changed, 1059 insertions, 0 deletions
diff --git a/ChibiOS_20.3.2/tools/mk/autobuild.mk b/ChibiOS_20.3.2/tools/mk/autobuild.mk new file mode 100644 index 0000000..1e2410d --- /dev/null +++ b/ChibiOS_20.3.2/tools/mk/autobuild.mk @@ -0,0 +1,18 @@ +# Source files located under $(AUTOBUILD_ROOT) are automatically added.
+ifeq ($(AUTOBUILD_ROOT),)
+ AUTOBUILD_ROOT := ./source/
+endif
+
+rwildcard = $(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
+AUTOCSRC := $(call rwildcard,$(AUTOBUILD_ROOT),*.c)
+AUTOCPPSRC := $(call rwildcard,$(AUTOBUILD_ROOT),*.cpp)
+AUTOASMSRC := $(call rwildcard,$(AUTOBUILD_ROOT),*.s)
+AUTOXASMSRC := $(call rwildcard,$(AUTOBUILD_ROOT),*.S)
+AUTOINC := $(sort $(dir $(call rwildcard,$(AUTOBUILD_ROOT),*)))
+
+# Shared variables.
+ALLCSRC += $(AUTOCSRC)
+ALLCPPSRC += $(AUTOCPPSRC)
+ALLASMSRC += $(AUTOASMSRC)
+ALLXASMSRC += $(AUTOXASMSRC)
+ALLINC += $(AUTOINC)
diff --git a/ChibiOS_20.3.2/tools/style/style_ex.sh b/ChibiOS_20.3.2/tools/style/style_ex.sh new file mode 100644 index 0000000..ace92ee --- /dev/null +++ b/ChibiOS_20.3.2/tools/style/style_ex.sh @@ -0,0 +1,3 @@ +#!/bin/bash +find ../../os/ex -name "*.[ch]" -exec perl stylecheck.pl "{}" \; + diff --git a/ChibiOS_20.3.2/tools/style/style_hal.sh b/ChibiOS_20.3.2/tools/style/style_hal.sh new file mode 100644 index 0000000..eef4b28 --- /dev/null +++ b/ChibiOS_20.3.2/tools/style/style_hal.sh @@ -0,0 +1,7 @@ +#!/bin/bash +find ../../os/hal/include -name "*.[ch]" -exec perl stylecheck.pl "{}" \; +find ../../os/hal/src -name "*.[ch]" -exec perl stylecheck.pl "{}" \; +find ../../os/hal/templates -name "*.[ch]" -exec perl stylecheck.pl "{}" \; +find ../../os/hal/osal -name "*.[ch]" -exec perl stylecheck.pl "{}" \; +find ../../os/hal/ports/STM32 -name "*.[ch]" -exec perl stylecheck.pl "{}" \; + diff --git a/ChibiOS_20.3.2/tools/style/style_nil.sh b/ChibiOS_20.3.2/tools/style/style_nil.sh new file mode 100644 index 0000000..12375bf --- /dev/null +++ b/ChibiOS_20.3.2/tools/style/style_nil.sh @@ -0,0 +1,5 @@ +#!/bin/bash +find ../../os/nil -name "*.[ch]" -exec perl stylecheck.pl "{}" \; +find ../../os/oslib -name "*.[ch]" -exec perl stylecheck.pl "{}" \; +find ../../os/license -name "*.[ch]" -exec perl stylecheck.pl "{}" \; + diff --git a/ChibiOS_20.3.2/tools/style/style_rt.sh b/ChibiOS_20.3.2/tools/style/style_rt.sh new file mode 100644 index 0000000..d829d03 --- /dev/null +++ b/ChibiOS_20.3.2/tools/style/style_rt.sh @@ -0,0 +1,5 @@ +#!/bin/bash +find ../../os/rt -name "*.[ch]" -exec perl stylecheck.pl "{}" \; +find ../../os/oslib -name "*.[ch]" -exec perl stylecheck.pl "{}" \; +find ../../os/license -name "*.[ch]" -exec perl stylecheck.pl "{}" \; + diff --git a/ChibiOS_20.3.2/tools/style/stylecheck.pl b/ChibiOS_20.3.2/tools/style/stylecheck.pl new file mode 100644 index 0000000..9a44cbd --- /dev/null +++ b/ChibiOS_20.3.2/tools/style/stylecheck.pl @@ -0,0 +1,291 @@ +#!/usr/bin/perl
+use strict;
+use warnings;
+use File::Basename;
+
+# Desired indentation.
+my $indentation = 2;
+
+if ($#ARGV != 0) {
+ print "\nUsage: stylecheck.pl source\n";
+ exit;
+}
+
+my $source = $ARGV[0];
+
+open(my $in, "<", $source) or die "Can't open source: $!";
+
+my $lineno = 0;
+my @c_source = <$in>;
+my $filename = $source;
+$filename =~ y/\\/\//;
+$filename = basename($filename);
+
+my $cr = "\r";
+my $lf = "\n";
+my $tab = "\t";
+
+sub style {
+ my $desc = shift;
+
+ print("style: $desc at line $lineno in \"$source\"\n");
+}
+
+sub error {
+ my $desc = shift;
+
+ print("error: $desc at line $lineno in \"$source\"\n");
+}
+
+my $emptycnt = 0;
+my $c_comment_complete = 0;
+my $c_comment = "";
+my $state = "start";
+foreach my $line (@c_source) {
+
+ $lineno += 1;
+
+ #****************************************************************************
+ # Processing comments after decoding.
+ if ($c_comment_complete != 0) {
+# print($c_comment . "\n");
+
+ #******************************************************************************
+ # Special case of lint comment.
+ if ("$c_comment" =~ /^\s*\/\*lint/) {
+ }
+ else {
+ #******************************************************************************
+ # Check on glued doxygen back-comment start.
+ if ("$c_comment" =~ /^\s*\/\*\*<[^\s]/) {
+ style "detected glued doxygen back-comment start";
+ }
+
+ #******************************************************************************
+ # Check on glued doxygen comment start.
+ if ("$c_comment" =~ /^\s*\/\*\*[^\s<]/) {
+ style "detected glued doxygen comment start";
+ }
+
+ #******************************************************************************
+ # Check on glued comment start.
+ if ("$c_comment" =~ /^\s*\/\*[^\s\*=]/) {
+ style "detected glued comment start";
+ }
+
+ #******************************************************************************
+ # Check on lower case letter at comment beginning.
+ if ("$c_comment" =~ /^\s*\/\*\s*[a-z]/) {
+ style "detected lower case comment start";
+ }
+
+ #******************************************************************************
+ # Check on loose comment stop.
+# if ("$line" =~ /\s\*\//) {
+# style "detected loose comment stop";
+# }
+ }
+
+ $c_comment_complete = 0;
+ }
+
+ #****************************************************************************
+ # Check on EOL.
+ if (not ($line =~ /$cr$lf$/)) {
+ error "detected malformed EOL";
+ }
+ $line =~ s/$cr//;
+ $line =~ s/$lf//;
+
+ #****************************************************************************
+ # Check on trailing spaces.
+ if ($line =~ /\s$/) {
+ style "detected trailing spaces";
+ }
+
+ #****************************************************************************
+ # Check on TABs.
+ if ($line =~ /$tab/) {
+ style "detected TAB";
+ $line =~ s/$tab/ /;
+ }
+
+ #****************************************************************************
+ # Check on empty lines.
+ my $tmp = $line;
+ $tmp =~ s/\s//;
+ if (length($tmp) == 0) {
+ $emptycnt = $emptycnt + 1;
+ if ($emptycnt == 2) {
+ style "detected multiple empty lines"
+ }
+ next;
+ }
+ else {
+ $emptycnt = 0;
+ }
+
+ #****************************************************************************
+ # Stripping strings content for ease of parsing, all strings become _string_.
+ $line =~ s/\\\"//;
+ if ($line =~ s/(\"[^"]*\")/_string_/) {
+# print "string: $1 replaced by _string_\n";
+ }
+
+ #******************************************************************************
+ # State machine handling.
+ if ($state eq "start") {
+
+ #******************************************************************************
+ # Standard separator.
+
+ #******************************************************************************
+ # Comment start matching.
+ if ("$line" =~ /\/\*/) {
+
+ #******************************************************************************
+ # Single or multi line comments.
+ if ("$line" =~ /\*\//) {
+ # Special case of single line comments.
+ $line =~ /(\/\*.*\*\/)/;
+ $c_comment = $1;
+ $c_comment_complete = 1;
+ }
+ else {
+ # Start of multi-line comment.
+ $line =~ /(\/\*.*)/;
+ $c_comment = $1;
+ $state = "incomment";
+ }
+ }
+ else {
+
+ #****************************************************************************
+ # Check on C++ comments.
+ if ($line =~ /\/\//) {
+ style "detected // comment";
+ }
+
+ #****************************************************************************
+ # Check on commas.
+ if ($line =~ /,\S/) {
+ style "detected comma not followed by space";
+ }
+
+ #****************************************************************************
+ # Check on loose semicolons.
+ if ($line =~ /\S\s;/) {
+ style "detected loose semicolon";
+ }
+
+ #****************************************************************************
+ # Check on glued keywords.
+ if ($line =~ /\sif\(/) {
+ style "detected glued \"if\"";
+ }
+ if ($line =~ /\sfor\(/) {
+ style "detected glued \"for\"";
+ }
+ if ($line =~ /\swhile\(/) {
+ style "detected glued \"while\"";
+ }
+ if ($line =~ /\)while/) {
+ style "detected glued \"while\"";
+ }
+ if ($line =~ /\sswitch\(/) {
+ style "detected glued \"switch\"";
+ }
+ if ($line =~ /\sdo\{/) {
+ style "detected glued \"do\"";
+ }
+
+ #****************************************************************************
+ # Check on loose parenthesis.
+ if ($line =~ /\(\s+/) {
+ style "detected loose \"(\"";
+ }
+ if ($line =~ /\S\s+\)/) {
+ style "detected loose \")\"";
+ }
+
+ #****************************************************************************
+ # Check on glued braces.
+ if ($line =~ /\)\{/) {
+ style "detected glued left brace";
+ }
+ if ($line =~ /\w\{/) {
+ style "detected glued left brace";
+ }
+ if ($line =~ /\}\w/) {
+ style "detected glued right brace";
+ }
+
+ #****************************************************************************
+ # Check on (some) operators.
+ # Before: <<= << >>= >> <= >= == != += -= *= /= %= &= |= ^=
+ if ($line =~ /(\(\S<<=?|\S>>=?|[^\s<]<=|[^\s>]>=|\S[=!+\-*\/%&|^]=)/) {
+ style "detected glued operator (1)";
+ }
+ # After: =
+ elsif ($line =~ /=[^\s=]/) {
+ style "detected glued assignment/comparison operator (2)";
+ }
+ # Before: =
+ elsif ($line =~ /[^\s\=\!\+\-\*\/\%\&\|\^\<\>]=/) {
+ style "detected glued assignment/comparison operator (3)";
+ }
+ # After: << >>
+ elsif ($line =~ /(<<|>>)[^\s=]/) {
+ style "detected glued assignment/comparison operator (4)";
+ }
+ # Before: && || ^^
+ elsif ($line =~ /\S(&&|\|\||\^\^)/) {
+ style "detected glued logical operator (1)";
+ }
+ # After: && || ^^
+ elsif ($line =~ /(&&|\|\||\^\^)\S/) {
+ style "detected glued logical operator (2)";
+ }
+
+ #****************************************************************************
+ # Check function-call-like returns (not perfect so disabled).
+ if ($line =~ /return\s*\(/) {
+ if ($line =~ /return\s*\([\w\d\s\*]*\)\s*[^;]/) {
+ }
+ else {
+# style "detected function-call-like return";
+ }
+ }
+ }
+ }
+
+ #******************************************************************************
+ # Scanning for comment end.
+ elsif ($state eq "incomment") {
+ # Left trimming.
+ $line =~ s/^\s+//;
+ if ("$line" =~ /^\s*\*\/\s*$/) {
+ # Just end of comment line.
+ $c_comment .= "*/";
+ $c_comment_complete = 1;
+# print("$c_comment");
+ $state = "start";
+ }
+ elsif ("$line" =~ /\*\/\s*$/) {
+ # Text followed by end of comment.
+ $line =~ /(.*\*\/)/;
+ $c_comment .= " " . $1;
+ $c_comment_complete = 1;
+# print("$c_comment");
+ $state = "start";
+ }
+ else {
+ # Add the whole line, remove first * and following spaces if any.
+ $line =~ s/^\*?\s*//;
+ $c_comment .= " " . $line;
+# print("$c_comment");
+ }
+ }
+}
+
+close $in or die "$in: $!";
diff --git a/ChibiOS_20.3.2/tools/style/test.c b/ChibiOS_20.3.2/tools/style/test.c new file mode 100644 index 0000000..2135056 --- /dev/null +++ b/ChibiOS_20.3.2/tools/style/test.c @@ -0,0 +1,21 @@ +static struct pippo **pluto (void) {
+
+}
+
+static struct pp qq (void) {
+
+}
+
+static cc ss (void) {
+
+}
+
+static aa bb (int a,
+ char *p) {
+
+}
+
+dd *ee (void) {
+
+ bb(0, "pip\"po", "pluto");
+}
diff --git a/ChibiOS_20.3.2/tools/style/test_negatives.txt b/ChibiOS_20.3.2/tools/style/test_negatives.txt new file mode 100644 index 0000000..fee96e5 --- /dev/null +++ b/ChibiOS_20.3.2/tools/style/test_negatives.txt @@ -0,0 +1,54 @@ +a = b
+a == b
+a != b
+a += b
+a -= b
+a *= b
+a /= b
+a %= b
+a &= b
+a |= b
+a ^= b
+a <= b
+a >= b
+a >> b
+a << b
+a <<= b
+a >>= b
+a && b
+a || b
+a ^^ b
+
+foo(); /* Function call.*/
+
+foo(); /* Multiple lines
+ right comment.*/
+
+/** @} */
+
+/*lint .*/
+
+/* Good comment.*/
+
+/** @Good comment.*/
+
+/**< @Good comment.*/
+
+/*
+ This is a good comment.
+*/
+
+/*
+ * Good comment.
+ */
+
+/* Multiple lines
+ comment 1.*/
+
+/*
+ * Multiple lines
+ * comment 2.
+ */
+
+/*===========================================================================*/
+
diff --git a/ChibiOS_20.3.2/tools/style/test_positives.txt b/ChibiOS_20.3.2/tools/style/test_positives.txt new file mode 100644 index 0000000..ae7e2c7 --- /dev/null +++ b/ChibiOS_20.3.2/tools/style/test_positives.txt @@ -0,0 +1,65 @@ +a=b
+a= b
+a =b
+a==b
+a== b
+a ==b
+a!=b
+a!= b
+a !=b
+a+=b
+a+= b
+a +=b
+a-=b
+a-= b
+a -=b
+a*=b
+a*= b
+a *=b
+a/=b
+a/= b
+a /=b
+a%=b
+a%= b
+a %=b
+a&=b
+a&= b
+a &=b
+a|=b
+a|= b
+a |=b
+a^=b
+a^= b
+a ^=b
+a<=b
+a<= b
+a <=b
+a>=b
+a>= b
+a >=b
+a>>b
+a>> b
+a >>b
+a<<b
+a<< b
+a <<b
+a<<=b
+a<<= b
+a <<=b
+a>>=b
+a>>= b
+a >>=b
+a&&b
+a&& b
+a &&b
+a||b
+a|| b
+a ||b
+a^^b
+a^^ b
+a ^^b
+/** Comment.*/
+/**Comment.*/
+/*Comment*/
+/* comment*/
+/* Comment. */
diff --git a/ChibiOS_20.3.2/tools/updater/conf.fmpp b/ChibiOS_20.3.2/tools/updater/conf.fmpp new file mode 100644 index 0000000..38ec6d2 --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/conf.fmpp @@ -0,0 +1,10 @@ +outputRoot: . +dataRoot: . + +freemarkerLinks: { + lib: ../ftl/libs +} + +data : { + doc:properties (./values.txt) +} diff --git a/ChibiOS_20.3.2/tools/updater/update_chconf_nil.sh b/ChibiOS_20.3.2/tools/updater/update_chconf_nil.sh new file mode 100644 index 0000000..ec29728 --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_chconf_nil.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "chconf.h" -exec bash update_chconf_nil.sh "{}" \; + else + echo "Usage: update_chconf_nil.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "_CHIBIOS_NIL_CONF_" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_]*\s+[a-zA-Z0-9_]" <<< "$conffile" | sed 's/\#define //g; s/ */=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/chconf_nil + then + echo + echo "aborted" + exit 1 + fi + cp ./chconf.h $1 + rm ./chconf.h ./values.txt + fi +else + echo "Usage: update_chconf_nil.sh [rootpath <root path>]" + echo " update_chconf_nil.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_chconf_rt.sh b/ChibiOS_20.3.2/tools/updater/update_chconf_rt.sh new file mode 100644 index 0000000..d29f530 --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_chconf_rt.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "chconf.h" -exec bash update_chconf_rt.sh "{}" \; + else + echo "Usage: update_chconf_rt.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "_CHIBIOS_RT_CONF_" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_]*\s+[a-zA-Z0-9_]" <<< "$conffile" | sed 's/\#define //g; s/ */=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/chconf_rt + then + echo + echo "aborted" + exit 1 + fi + cp ./chconf.h $1 + rm ./chconf.h ./values.txt + fi +else + echo "Usage: update_chconf_rt.sh [rootpath <root path>]" + echo " update_chconf_rt.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_halconf.sh b/ChibiOS_20.3.2/tools/updater/update_halconf.sh new file mode 100644 index 0000000..130ca5b --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_halconf.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "halconf.h" -exec bash update_halconf.sh "{}" \; + else + echo "Usage: update_halconf.sh [rootpath <path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) +# if egrep -q "" <<< "$conffile" +# then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_]*\s+[a-zA-Z0-9_]" <<< "$conffile" | sed 's/\#define //g; s/ */=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/halconf + then + echo + echo "aborted" + exit 1 + fi + cp ./halconf.h $1 + rm ./halconf.h ./values.txt +# fi +else + echo "Usage: update_halconf.sh [rootpath <root path>]" + echo " update_halconf.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f303xx.sh b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f303xx.sh new file mode 100644 index 0000000..3e5f24f --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f303xx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32f303xx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32f303xx.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32F303_MCUCONF" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[^\s]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32f303xx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32f303xx.sh [rootpath <root path>]" + echo " update_mcuconf_stm32f303xx.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f407xx.sh b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f407xx.sh new file mode 100644 index 0000000..96997ee --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f407xx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32f407xx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32f407xx.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32F407_MCUCONF" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[^\s]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32f407xx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32f407xx.sh [rootpath <root path>]" + echo " update_mcuconf_stm32f407xx.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f413xx.sh b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f413xx.sh new file mode 100644 index 0000000..2e000a7 --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f413xx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32f413xx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32f413xx.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32F413_MCUCONF" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[^\s]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32f413xx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32f413xx.sh [rootpath <root path>]" + echo " update_mcuconf_stm32f413xx.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f72xxx.sh b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f72xxx.sh new file mode 100644 index 0000000..97639e6 --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f72xxx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32f72xxx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32f72xxx.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32F722_MCUCONF" <<< "$conffile" || egrep -q "STM32F723_MCUCONF" <<< "$conffile" || egrep -q "STM32F732_MCUCONF" <<< "$conffile" || egrep -q "STM32F733_MCUCONF" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[^\s]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32f72xxx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32f72xxx.sh [rootpath <root path>]" + echo " update_mcuconf_stm32f72xxx.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f746xx.sh b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f746xx.sh new file mode 100644 index 0000000..997510c --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f746xx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32f746xx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32f746xx.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32F746_MCUCONF" <<< "$conffile" || egrep -q "STM32F756_MCUCONF" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[^\s]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32f746xx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32f746xx.sh [rootpath <root path>]" + echo " update_mcuconf_stm32f746xx.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f76xxx.sh b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f76xxx.sh new file mode 100644 index 0000000..b442dcc --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32f76xxx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32f76xxx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32f76xxx.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32F765_MCUCONF" <<< "$conffile" || egrep -q "STM32F767_MCUCONF" <<< "$conffile" || egrep -q "STM32F777_MCUCONF" <<< "$conffile" || egrep -q "STM32F769_MCUCONF" <<< "$conffile" || egrep -q "STM32F779_MCUCONF" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[^\s]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32f76xxx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32f76xxx.sh [rootpath <root path>]" + echo " update_mcuconf_stm32f76xxx.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32g071xx.sh b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32g071xx.sh new file mode 100644 index 0000000..c9fff12 --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32g071xx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32g071xx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32g071xx.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32G071_MCUCONF" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[^\s]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32g071xx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32g071xx.sh [rootpath <root path>]" + echo " update_mcuconf_stm32g071xx.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32g4x1xx.sh b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32g4x1xx.sh new file mode 100644 index 0000000..ab71dad --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32g4x1xx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32g4x1xx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32g4x1xx.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32G431_MCUCONF" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[^\s]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32g4x1xx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32g4x1xx.sh [rootpath <root path>]" + echo " update_mcuconf_stm32g4x1xx.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32g4x4xx.sh b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32g4x4xx.sh new file mode 100644 index 0000000..76424aa --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32g4x4xx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32g4x4xx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32g4x4xx.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32G474_MCUCONF" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[^\s]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32g4x4xx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32g4x4xx.sh [rootpath <root path>]" + echo " update_mcuconf_stm32g4x4xx.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32h743xx.sh b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32h743xx.sh new file mode 100644 index 0000000..14a6126 --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32h743xx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32h743xx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32h743xx.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32H743_MCUCONF" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[^\s]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32h743xx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32h743xx.sh [rootpath <root path>]" + echo " update_mcuconf_stm32h743xx.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l05xxx.sh b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l05xxx.sh new file mode 100644 index 0000000..7e5b7bd --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l05xxx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32l05xxx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32l05xxx.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32L052_MCUCONF" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[^\s]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32l05xxx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32l05xxx.sh [rootpath <root path>]" + echo " update_mcuconf_stm32l05xxx.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l07xxx.sh b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l07xxx.sh new file mode 100644 index 0000000..32a1bd8 --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l07xxx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32l07xxx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32l07xxx.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32L072_MCUCONF" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[^\s]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32l07xxx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32l07xxx.sh [rootpath <root path>]" + echo " update_mcuconf_stm32l07xxx.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l432xx.sh b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l432xx.sh new file mode 100644 index 0000000..a28773a --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l432xx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32l432xx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32l432xx.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32L432_MCUCONF" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[^\s]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32l432xx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32l432xx.sh [rootpath <root path>]" + echo " update_mcuconf_stm32l432xx.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l452xx.sh b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l452xx.sh new file mode 100644 index 0000000..3c4ad99 --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l452xx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32l452xx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32l452xx.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32L452_MCUCONF" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[^\s]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32l452xx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32l452xx.sh [rootpath <root path>]" + echo " update_mcuconf_stm32l452xx.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l476xx.sh b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l476xx.sh new file mode 100644 index 0000000..9ec8048 --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l476xx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32l476xx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32l476xx.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32L476_MCUCONF" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[^\s]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32l476xx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32l476xx.sh [rootpath <root path>]" + echo " update_mcuconf_stm32l476xx.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l496xx.sh b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l496xx.sh new file mode 100644 index 0000000..37c4bf8 --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l496xx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32l496xx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32l496xx.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32L496_MCUCONF" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[^\s]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32l496xx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32l496xx.sh [rootpath <root path>]" + echo " update_mcuconf_stm32l496xx.sh <configuration file>]" +fi diff --git a/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l4rxxx.sh b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l4rxxx.sh new file mode 100644 index 0000000..c62d20e --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_mcuconf_stm32l4rxxx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32l4rxxx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32l4rxxx.sh [rootpath <root path>]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32L4R5_MCUCONF" <<< "$conffile" || egrep -q "STM32L4S5_MCUCONF" <<< "$conffile" || egrep -q "STM32L4R7_MCUCONF" <<< "$conffile" || egrep -q "STM32L4S7_MCUCONF" <<< "$conffile" || egrep -q "STM32L4R9_MCUCONF" <<< "$conffile" || egrep -q "STM32L4S9_MCUCONF" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[^\s]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32l4rxxx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32l4rxxx.sh [rootpath <root path>]" + echo " update_mcuconf_stm32l4rxxx.sh <configuration file>]" +fi |