renamed project

This commit is contained in:
2020-10-06 13:33:17 +02:00
parent ec90e3a2dc
commit f5831e083f
81 changed files with 86194 additions and 75934 deletions

15
tools/insertMyCode.pl Normal file
View File

@ -0,0 +1,15 @@
#!/usr/bin/perl -w
while (<>) {
print $_;
print "#include \"main2.h\";\n" if m/USER CODE BEGIN Includes/;
print " my_setup_1();\n" if m/USER CODE BEGIN 1/;
print " my_setup_2();\n" if m/USER CODE BEGIN 2/;
print " my_loop();\n" if m/USER CODE BEGIN 3/;
print " my_errorHandler();\n" if m/USER CODE BEGIN Error_Handler/;
print " while(1) { };\n" if m/USER CODE END Error_Handler/;
}

18
tools/insertMyCode.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
MAIN_C=./Core/Src/main.c
MAIN_C_BAK=./Core/Src/main.c-bak
if [ ! -f $MAIN_C ]; then
echo "no $MAIN_C available"
exit 1
fi
if [ -f $MAIN_C_BAK ]; then
echo "$MAIN_C_BAK already available, delete manually"
exit 1
fi
mv $MAIN_C $MAIN_C_BAK
cat $MAIN_C_BAK | ../tools/insertMyCode.pl > $MAIN_C