From 8a81a4303c6bc938b530c8b5b20c20841a56beb1 Mon Sep 17 00:00:00 2001
From: Alberto Nidasio <alberto.nidasio@skywarder.eu>
Date: Sun, 7 Mar 2021 12:10:01 +0100
Subject: [PATCH] Written eventgen and fsmgen script wrappers

---
 .gitignore          |  4 +++-
 scripts/eventgen.sh | 30 ++++++++++++++++++++++--------
 scripts/fsmgen.sh   | 25 +++++++++++++++++++++++++
 skyward-boardcore   |  2 +-
 4 files changed, 51 insertions(+), 10 deletions(-)
 create mode 100755 scripts/fsmgen.sh

diff --git a/.gitignore b/.gitignore
index d2d63ed98..9df3b454f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,7 +23,9 @@ build
 *.sublime-project
 
 .vscode/*
-
 store.json
 scripts/event_header_generator/generated/
 scripts/event_header_generator/venv/
+
+**/generated
+**/scxmls
diff --git a/scripts/eventgen.sh b/scripts/eventgen.sh
index 1ba5dcbee..6763addd5 100755
--- a/scripts/eventgen.sh
+++ b/scripts/eventgen.sh
@@ -1,11 +1,25 @@
 #!/bin/bash
 
-DIRNAME="$(dirname $0)"
-python3  $DIRNAME/../skyward-boardcore/scripts/eventgen/eventgen.py $(find $DIRNAME/../src/boards -name "*.scxml")
-
-rm -r $DIRNAME/generated
-mkdir $DIRNAME/generated
-mv generated/* $DIRNAME/generated
-rm -r generated
+# Copyright (c) 2021 Skyward Experimental Rocketry
+# Authors: Alberto Nidasio
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
 
-echo "The generated files are in the scripts/generated/ folder"
\ No newline at end of file
+DIRNAME="$(dirname $0)"
+$DIRNAME/../skyward-boardcore/scripts/generators/eventgen.py $@
diff --git a/scripts/fsmgen.sh b/scripts/fsmgen.sh
new file mode 100755
index 000000000..2bae83d7f
--- /dev/null
+++ b/scripts/fsmgen.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# Copyright (c) 2021 Skyward Experimental Rocketry
+# Authors: Alberto Nidasio
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+DIRNAME="$(dirname $0)"
+$DIRNAME/../skyward-boardcore/scripts/generators/fsmgen.py $@
diff --git a/skyward-boardcore b/skyward-boardcore
index bc67604ab..de97a15f6 160000
--- a/skyward-boardcore
+++ b/skyward-boardcore
@@ -1 +1 @@
-Subproject commit bc67604abf3ceaf08b8772803ddeb99c64696c15
+Subproject commit de97a15f6606ac76f9111b8dfc18e10f2b54cc50
-- 
GitLab