From 89b22f27de9460d310bfe3e1a5d48846167d2baa Mon Sep 17 00:00:00 2001 From: jake-g00dwin Date: Sat, 20 Dec 2025 18:43:52 -0800 Subject: [PATCH] Added new features to ottto script. + Updated date. + Added new function to generate ctags for code navigation. + Updated code formatting function with Cpp formatting. --- otto.sh | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/otto.sh b/otto.sh index 8970e9f..36580cd 100755 --- a/otto.sh +++ b/otto.sh @@ -1,6 +1,6 @@ #!/bin/sh # Author: Jake Goodwin -# Date: 2024 +# Date: 2025 # Filename: otto.sh WCH_TC="$(pwd)/riscv32-toolchain.cmake" @@ -10,20 +10,37 @@ TEMPLATE_FILES=".template_files" MODULE_DIR="${TEMPLATE_FILES}/modules" CHIP="ch32v003" +generate_tags_file () { + uctags --recurse=yes \ + --languages=C,C++,Asm \ + --extras=+q \ + --fields=+iaS \ + --exclude=extern \ + --exclude=build \ + --exclude=.git \ + --exclude=.template_files \ + . +} format_source_code () { #Get a list of all C files - source_c_files=$(find ./src -name '*.c') + source_c_files=$(find ./src ./tests -name '*.c') for f in $source_c_files; do clang-format -i -style=file $f done #Get a list of all H files - source_h_files=$(find ./src -name '*.h') + source_h_files=$(find ./src ./tests -name '*.h') for f in $source_h_files; do clang-format -i -style=file $f done + #Get a list of all Cpp files. + source_cpp_files=$(find ./src ./tests -name '*.cpp') + for f in $source_cpp_files; do + clang-format -i -style=file $f + done + echo "Applying Formating standard!" } @@ -270,6 +287,7 @@ flash_microcontroller () { } run_c_tests () { + generate_tags_file() format_source_code clear_cmake_cache cmake -DUNIT_TESTING=ON -DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE} ../