diff --git a/.gitignore b/.gitignore index be91b21147e8842750043ac7982987bb86bfb2d4..0c1482597615bca1daaa4fe5261dc01c874d9a1c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,9 +11,9 @@ bin/* .*.sw? .*.pyc -.project -.cproject -.settings +.project +.cproject +.settings STM32F429zi_Discovery.xml ._* @@ -25,5 +25,5 @@ build .vscode/* store.json -scripts/homeone/event_header_generator/generated/ +*/generated/ core diff --git a/scripts/eventgen/generated/EventFunctions.cpp b/scripts/eventgen/generated/EventFunctions.cpp deleted file mode 100644 index 02d008a49c6ce8d7e107f62ec2b9604004dcf216..0000000000000000000000000000000000000000 --- a/scripts/eventgen/generated/EventFunctions.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* Copyright (c) 2018-2020 Skyward Experimental Rocketry - * Authors: Luca Erbetta, Alvise de' Faveri Tron - * - * 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. - */ - -/* - ****************************************************************************** - * THIS FILE IS AUTOGENERATED. DO NOT EDIT. * - ****************************************************************************** - */ - -// Autogen date: 2020-03-10 02:43:07.380770 - - -#include "Events.h" -#include "Topics.h" - -#include <map> - -string getEventString(uint8_t event) -{ - static const map<uint8_t, string> event_string_map { - { EV_ADA_APOGEE_DETECTED, "EV_ADA_APOGEE_DETECTED" }, - { EV_ADA_READY, "EV_ADA_READY" }, - { EV_APOGEE, "EV_APOGEE" }, - { EV_ARMED, "EV_ARMED" }, - { EV_CALIBRATE_ADA, "EV_CALIBRATE_ADA" }, - { EV_DISARMED, "EV_DISARMED" }, - { EV_IMU_READY, "EV_IMU_READY" }, - { EV_INIT_ERROR, "EV_INIT_ERROR" }, - { EV_INIT_OK, "EV_INIT_OK" }, - { EV_LIFTOFF, "EV_LIFTOFF" }, - { EV_NC_BACKUP, "EV_NC_BACKUP" }, - { EV_NC_DETACHED, "EV_NC_DETACHED" }, - { EV_NC_OPEN, "EV_NC_OPEN" }, - { EV_NC_TEST, "EV_NC_TEST" }, - { EV_RESET_SERVO, "EV_RESET_SERVO" }, - { EV_SEND_HR_TM, "EV_SEND_HR_TM" }, - { EV_SEND_LR_TM, "EV_SEND_LR_TM" }, - { EV_SEND_TEST_TM, "EV_SEND_TEST_TM" }, - { EV_STATS_TIMEOUT, "EV_STATS_TIMEOUT" }, - { EV_TC_ARM, "EV_TC_ARM" }, - { EV_TC_CALIBRATE_ADA, "EV_TC_CALIBRATE_ADA" }, - { EV_TC_CALIBRATE_IMU, "EV_TC_CALIBRATE_IMU" }, - { EV_TC_CLOSE_LOG, "EV_TC_CLOSE_LOG" }, - { EV_TC_DISARM, "EV_TC_DISARM" }, - { EV_TC_END_MISSION, "EV_TC_END_MISSION" }, - { EV_TC_FORCE_INIT, "EV_TC_FORCE_INIT" }, - { EV_TC_FORCE_LAUNCH, "EV_TC_FORCE_LAUNCH" }, - { EV_TC_NC_BACKUP, "EV_TC_NC_BACKUP" }, - { EV_TC_NC_OPEN, "EV_TC_NC_OPEN" }, - { EV_TC_RESET, "EV_TC_RESET" }, - { EV_TC_RESET_SERVO, "EV_TC_RESET_SERVO" }, - { EV_TC_TEST_MODE, "EV_TC_TEST_MODE" }, - { EV_TC_WIGGLE_SERVO, "EV_TC_WIGGLE_SERVO" }, - { EV_TIMEOUT_BACKUP, "EV_TIMEOUT_BACKUP" }, - { EV_TIMEOUT_END_MISSION, "EV_TIMEOUT_END_MISSION" }, - { EV_TIMEOUT_NC_OPEN, "EV_TIMEOUT_NC_OPEN" }, - { EV_TIMEOUT_SHADOW_MODE, "EV_TIMEOUT_SHADOW_MODE" }, - { EV_UMBILICAL_DETACHED, "EV_UMBILICAL_DETACHED" }, - { EV_WIGGLE_SERVO, "EV_WIGGLE_SERVO" } - }; - auto it = event_string_map.find(event); - return it == event_string_map.end() ? "EV_UNKNOWN" : it->second; -} - -string getTopicString(uint8_t topic) -{ - static const map<uint8_t, string> topic_string_map{ - { TOPIC_ADA, "TOPIC_ADA" }, - { TOPIC_DPL, "TOPIC_DPL" }, - { TOPIC_FLIGHT, "TOPIC_FLIGHT" }, - { TOPIC_FMM, "TOPIC_FMM" }, - { TOPIC_PINS, "TOPIC_PINS" }, - { TOPIC_STATS, "TOPIC_STATS" }, - { TOPIC_TMTC, "TOPIC_TMTC" } - }; - auto it = topic_string_map.find(topic); - return it == topic_string_map.end() ? "TOPIC_UNKNOWN" : it->second; -} \ No newline at end of file diff --git a/scripts/eventgen/generated/Events.h b/scripts/eventgen/generated/Events.h deleted file mode 100644 index 702a385b310b413438209e5f781eeb0e3fc78b5b..0000000000000000000000000000000000000000 --- a/scripts/eventgen/generated/Events.h +++ /dev/null @@ -1,97 +0,0 @@ -/* Copyright (c) 2018-2020 Skyward Experimental Rocketry - * Authors: Luca Erbetta, Alvise de' Faveri Tron - * - * 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. - */ - -/* - ****************************************************************************** - * THIS FILE IS AUTOGENERATED. DO NOT EDIT. * - ****************************************************************************** - */ - -// Autogen date: 2020-03-10 02:43:07.380770 - -#pragma once - -#include <cstdint> -#include <string> - -#include "events/Event.h" -#include "events/EventBroker.h" -#include "EventClasses.h" -#include "Topics.h" - -using std::string; -using std::map; - -/** - * Definition of all events in the Homeone Board software - * Refer to section 5.1.1 of the Software Design Document. - */ -enum Events : uint8_t -{ - EV_ADA_APOGEE_DETECTED = EV_FIRST_SIGNAL, - EV_ADA_READY, - EV_APOGEE, - EV_ARMED, - EV_CALIBRATE_ADA, - EV_DISARMED, - EV_IMU_READY, - EV_INIT_ERROR, - EV_INIT_OK, - EV_LIFTOFF, - EV_NC_BACKUP, - EV_NC_DETACHED, - EV_NC_OPEN, - EV_NC_TEST, - EV_RESET_SERVO, - EV_SEND_HR_TM, - EV_SEND_LR_TM, - EV_SEND_TEST_TM, - EV_STATS_TIMEOUT, - EV_TC_ARM, - EV_TC_CALIBRATE_ADA, - EV_TC_CALIBRATE_IMU, - EV_TC_CLOSE_LOG, - EV_TC_DISARM, - EV_TC_END_MISSION, - EV_TC_FORCE_INIT, - EV_TC_FORCE_LAUNCH, - EV_TC_NC_BACKUP, - EV_TC_NC_OPEN, - EV_TC_RESET, - EV_TC_RESET_SERVO, - EV_TC_TEST_MODE, - EV_TC_WIGGLE_SERVO, - EV_TIMEOUT_BACKUP, - EV_TIMEOUT_END_MISSION, - EV_TIMEOUT_NC_OPEN, - EV_TIMEOUT_SHADOW_MODE, - EV_UMBILICAL_DETACHED, - EV_WIGGLE_SERVO -}; - -/** - * @brief Returns the name of the provided event - * - * @param event - * @return string - */ -string getEventString(uint8_t event); \ No newline at end of file diff --git a/scripts/eventgen/generated/Topics.h b/scripts/eventgen/generated/Topics.h deleted file mode 100644 index 7d27de00dd459eb8315718d3a8cc5fc89c131bd9..0000000000000000000000000000000000000000 --- a/scripts/eventgen/generated/Topics.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (c) 2018-2020 Skyward Experimental Rocketry - * Authors: Luca Erbetta, Alvise de' Faveri Tron - * - * 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. - */ - -/* - ****************************************************************************** - * THIS FILE IS AUTOGENERATED. DO NOT EDIT. * - ****************************************************************************** - */ - -// Autogen date: 2020-03-10 02:43:07.380770 - -#pragma once - -#include <stdint.h> -#include <string> - -using std::map; -using std::string; - -/** - * Definition of various event topics to use in the EventBroker - */ -enum Topics : uint8_t -{ - TOPIC_ADA, - TOPIC_DPL, - TOPIC_FLIGHT, - TOPIC_FMM, - TOPIC_PINS, - TOPIC_STATS, - TOPIC_TMTC -}; - -/** - * @brief Returns the name of the provided event - * - * @param event - * @return string - */ -string getTopicString(uint8_t topic); -