renamed project
This commit is contained in:
15
tools/insertMyCode.pl
Normal file
15
tools/insertMyCode.pl
Normal 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
18
tools/insertMyCode.sh
Normal 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
|
||||
|
||||
|
Reference in New Issue
Block a user