From 4203a185dabf787feebaf470e7cbdb4b4609d420 Mon Sep 17 00:00:00 2001
From: Alberto Nidasio <alberto.nidasio@skywarder.eu>
Date: Fri, 23 Jul 2021 12:53:38 +0200
Subject: [PATCH] Updated README

---
 README.md                                   |  50 +++---
 sbs.conf                                    |  26 +--
 src/entrypoints/death-stack-entry.cpp       |  79 ---------
 src/entrypoints/death-stack-testsuite.cpp   | 185 --------------------
 src/entrypoints/death-stack-x-testsuite.cpp |   8 -
 src/tests/test-death-stack-x.cpp            | 114 ------------
 6 files changed, 24 insertions(+), 438 deletions(-)
 delete mode 100644 src/entrypoints/death-stack-entry.cpp
 delete mode 100644 src/entrypoints/death-stack-testsuite.cpp
 delete mode 100644 src/tests/test-death-stack-x.cpp

diff --git a/README.md b/README.md
index 6ef934769..feb2371af 100644
--- a/README.md
+++ b/README.md
@@ -1,43 +1,39 @@
-# R2A-HERMES OBSW [![pipeline status](https://git.skywarder.eu/r2a/skyward-boardcore/badges/master/pipeline.svg)](https://git.skywarder.eu/r2a/skyward-boardcore/commits/master)
+# Lynx On-Board Software [![pipeline status](https://git.skywarder.eu/r2a/skyward-boardcore/badges/master/pipeline.svg)](https://git.skywarder.eu/r2a/skyward-boardcore/commits/master)
 
-*On Board software for R2A-Hermes*
+*On Board software for Lynx*
 
-To clone, use the `git clone --recurse-submodules` option.
+To clone, use `git clone --recurse-submodules git@git.skywarder.eu:scs/hermes/r2a-obsw.git`.
 
 To build, use `sbs` (for more info, type `./sbs --help` on Linux or `sbs --help` on Windows).
 
+## Folder structure
 
-
-## Folder Structure
-
-|   Folder               |   Content                                           |
-| ---------------------- | --------------------------------------------------- |
-| **src/**               | **sources!**                                        |
-| boards/                | Classes and components, divided by board.            |
-| entrypoints/           | Each file here is a "*main*" to be built with SBS.  |
-| tests/                 | Tests that can be built with SBS.                   |
-| **skyward-boardcore/** | Provides the build system (SBS) and common drivers. |
-| **bin/**               | Compiled binaries, to be flashed on boards.         |
-| **build/**             | MIOSIX Makefiles generated by SBS (*not important*) |
-| **obj/**               | Building stuff (*not important*)                    |
+|   Folder               |   Content                                                    |
+| ---------------------- | ------------------------------------------------------------ |
+| src/boards/            | Classes and components, divided by board.                    |
+| src/entrypoints/       | Each file here is a "*main*" to be built with SBS.           |
+| src/tests/             | Tests that can be built with SBS.                            |
+| skyward-boardcore/     | Provides the build system (SBS) and common drivers.          |
+| bin/                   | Compiled binaries generated by SBS, to be flashed on boards. |
+| build/                 | MIOSIX Makefiles generated by SBS (*not important*)          |
+| obj/                   | Building stuff (*not important*)                             |
 
 
 ## Useful entrypoints
 
-### Death Stack Test Suite
-`src/entrypoints/death-stack-testsuite.cpp`  
+### Death Stack X Test Suite `src/entrypoints/death-stack-x-testsuite.cpp`
+
 Interactive entrypoint to test various aspects of the Death Stack hardware / software:  
 
-| Test | Description |
-| ----- | ----- |
-| Test All Sensors | Reads and displays values from all the sensors |
-| Thermal Cutter Test | Test the cutters with user-configurable parameters | 
-| Nosecone motor | Test nosecone motor opening / closing (Hermes V0) |
-| Sensors + TMTC | Sample all the sensor with flight parameters and sends high rate telemetry, while also listening for telecommands |
-| XBee send/receive | Sends and receives data trough the XBee module |
-| Logger | Tests the SDCARD / logger |
+| Test              | Description                                              |
+| ----------------- | -------------------------------------------------------- |
+| Test power board  | Allows to test battery voltage, cutters and servo motors |
+| Test stm board    | Allows to test leds and external oscillator              | 
+| Test rf board     | Allows to test the IMUs, GPS and SD Card                 |
+| Test analog board | Allows to test the pressure sensors and detachment pins  |
+
+### Death Stack X Entry `src/entrypoints/death-stack-x-entry.cpp`
 
-### Death Stack Entry
 Main entrypoint to be used for flight
 
 ## Contributing
diff --git a/sbs.conf b/sbs.conf
index b11e4a420..9543d505e 100644
--- a/sbs.conf
+++ b/sbs.conf
@@ -227,22 +227,6 @@ Include:    %shared %printlogger %internal-adc %pwm %hbridge %test-utils %servo
 Defines:    -DDEBUG
 Main:       death-stack-x-testsuite
 
-# [death-stack-entry]
-# Type:       board
-# BoardId:    stm32f429zi_skyward_death_stack_x
-# BinName:    death-stack-entry
-# Include:    %shared %deathstack %logger %pwm %hbridge %spi %xbee %piksi %servo
-# Defines:    -DDEATH_STACK_1
-# Main:       death-stack-entry
-
-# [death-stack-testsuite]
-# Type:       board
-# BoardId:    stm32f429zi_skyward_death_stack_x
-# BinName:    death-stack-testsuite
-# Include:    %shared %deathstack %logger %pwm %xbee %piksi %servo
-# Defines:    -DDEATH_STACK_1
-# Main:       death-stack-testsuite
-
 # [windtunnel-entry]
 # Type:       board
 # BoardId:    stm32f429zi_skyward_death_stack_x
@@ -669,12 +653,4 @@ BoardId:    stm32f429zi_skyward_death_stack_x
 BinName:    test-analog-board
 Include:    %shared %spi %ads1118 %pinhandler %logger %logservice
 Defines:    -DDEBUG
-Main:       deathstack-boards/test-analog-board
-
-[test-death-stack-x]
-Type:       test
-BoardId:    stm32f429zi_skyward_death_stack_x
-BinName:    test-death-stack-x
-Include:    %shared %internal-adc %pwm %hbridge %test-utils %servo %spi %ubloxgps %ads1118 %pinhandler %logger %logservice
-Defines:    -DDEBUG
-Main:       test-death-stack-x
+Main:       deathstack-boards/test-analog-board
\ No newline at end of file
diff --git a/src/entrypoints/death-stack-entry.cpp b/src/entrypoints/death-stack-entry.cpp
deleted file mode 100644
index b8401b27f..000000000
--- a/src/entrypoints/death-stack-entry.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Copyright (c) 2019 Skyward Experimental Rocketry
- * Author: 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.
- */
-#include <Common.h>
-#include <DeathStack.h>
-#include <TMTCManager/TMBuilder.h>
-#include <TMTCManager/XbeeInterrupt.h>
-#include <diagnostic/CpuMeter.h>
-#include <math/Stats.h>
-
-#include "System/StackLogger.h"
-#include "System/SystemData.h"
-#include "events/EventInjector.h"
-
-using namespace DeathStackBoard;
-using namespace miosix;
-
-DeathStack* board;
-
-StatsResult cpu_stat_res;
-
-D(EventInjector debug_console)
-
-int main()
-{
-    D(debug_console.start());
-
-    Stats cpu_stat;
-    board = DeathStack::getInstance();
-
-    // Log CPU Usage
-    SystemData system_data;
-    while (1)
-    {
-        StackLogger::getInstance()->updateStack(THID_ENTRYPOINT);
-
-        system_data.timestamp = miosix::getTick();
-        system_data.cpu_usage = averageCpuUtilization();
-        cpu_stat.add(system_data.cpu_usage);
-
-        cpu_stat_res               = cpu_stat.getStats();
-        system_data.cpu_usage_min  = cpu_stat_res.minValue;
-        system_data.cpu_usage_max  = cpu_stat_res.maxValue;
-        system_data.cpu_usage_mean = cpu_stat_res.mean;
-
-        system_data.min_free_heap = MemoryProfiling::getAbsoluteFreeHeap();
-        system_data.free_heap     = MemoryProfiling::getCurrentFreeHeap();
-
-        board->logger->log(system_data);
-
-        // Log logger stats
-        LogStats stats  = Logger::instance().getLogStats();
-        stats.timestamp = miosix::getTick();
-        board->logger->log(stats);
-
-        // Log threads stack data
-        StackLogger::getInstance()->log();
-        // printf("CPU: %.2f\n", system_data.cpu_usage);
-        Thread::sleep(1000);
-    }
-}
\ No newline at end of file
diff --git a/src/entrypoints/death-stack-testsuite.cpp b/src/entrypoints/death-stack-testsuite.cpp
deleted file mode 100644
index 8fd5da5c8..000000000
--- a/src/entrypoints/death-stack-testsuite.cpp
+++ /dev/null
@@ -1,185 +0,0 @@
-/* Copyright (c) 2019-2020 Skyward Experimental Rocketry
- * Author: 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.
- */
-
-#include <TMTCManager/TMTCManager.h>
-#include <diagnostic/CpuMeter.h>
-#include <drivers/BusTemplate.h>
-#include <drivers/piksi/piksi.h>
-#include <interfaces-impl/hwmapping.h>
-#include <logger/Logger.h>
-#include <miosix.h>
-#include <sensors/ADIS16405/ADIS16405.h>
-#include <sensors/LM75B.h>
-#include <sensors/MPU9250/MPU9250.h>
-#include <sensors/SensorSampling.h>
-
-#include <cstdio>
-#include <iostream>
-#include <sstream>
-#include <string>
-
-#include "ADA/ADA.h"
-#include "Common.h"
-#include "DeploymentController/Motor/MotorDriver.h"
-#include "DeploymentController/ThermalCutter/Cutter.h"
-#include "LoggerService/LoggerService.h"
-#include "SensorManager/SensorManager.h"
-#include "SensorManager/Sensors/AD7994Wrapper.h"
-#include "SensorManager/Sensors/ADCWrapper.h"
-#include "configs/SensorManagerConfig.h"
-#include "diagnostic/CpuMeter.h"
-#include "drivers/HardwareTimer.h"
-#include "drivers/Xbee/Xbee.h"
-#include "events/EventBroker.h"
-#include "math/Stats.h"
-#include "skyward-boardcore/src/tests/logger/test-logger.h"
-
-using namespace std;
-using namespace miosix;
-
-using namespace DeathStackBoard;
-
-using namespace std;
-using namespace miosix;
-
-namespace sensortest
-{
-#include "../tests/drivers/test-all-sensors.cpp"
-}
-
-namespace thermotest
-{
-#include "../tests/drivers/test-cutter.cpp"
-}
-
-namespace motortest
-{
-#include "../tests/drivers/test-motor.cpp"
-}
-
-namespace loggertest
-{
-#include "skyward-boardcore/src/tests/logger/test-logger.cpp"
-}
-
-namespace xbeetest
-{
-#include "skyward-boardcore/src/tests/misc/xbee-send-rcv.cpp"
-}
-
-namespace sm_tmtc
-{
-#include "../tests/test-sm+tmtc.cpp"
-}
-
-void banner()
-{
-    printf(" _____             _   _        _____ _             _    \n");
-    printf("|  __ \\           | | | |      / ____| |           | |   \n");
-    printf("| |  | | ___  __ _| |_| |__   | (___ | |_ __ _  ___| | __\n");
-    printf("| |  | |/ _ \\/ _` | __| '_ \\   \\___ \\| __/ _` |/ __| |/ /\n");
-    printf("| |__| |  __/ (_| | |_| | | |  ____) | || (_| | (__|   < \n");
-    printf(
-        "|_____/ \\___|\\__,_|\\__|_| |_| |_____/ "
-        "\\__\\__,_|\\___|_|\\_\\\n\n");
-}
-
-int main()
-{
-    banner();
-
-    while (true)
-    {
-        printf("Choose a test:\n");
-        printf(" s - Test All Sensors\n");
-        printf(" t - Thermal Cutter test\n");
-        printf(" m - Nosecone Motor\n");
-        printf(" g - Sensors + TMTC (telemetry/telecommands)\n");
-        printf(" x - XBee send/rcv\n");
-        printf(" l - Logger\n");
-        printf("\nOther:\n");
-        printf(" r - Reboot\n");
-        printf(" f - Pay Respect\n");
-
-        // Do not directly use cin -- use getline
-        char c;
-        string temp;
-        getline(cin, temp);
-        stringstream(temp) >> c;
-
-        switch (c)
-        {
-            case 's':
-            {
-                sensortest::main();
-                break;
-            }
-            case 't':
-            {
-                thermotest::main();
-                break;
-            }
-            case 'm':
-            {
-                motortest::main();
-                break;
-            }
-            case 'x':
-            {
-                xbeetest::main();
-                break;
-            }
-            case 'l':
-            {
-                loggertest::main();
-                break;
-            }
-            case 'g':
-            {
-                sm_tmtc::main();
-                break;
-            }
-            case 'r':
-            {
-                printf("Rebooting\n");
-                miosix::reboot();
-                break;
-            }
-            case 'f':
-            {
-                printf("....................../´¯/) \n");
-                printf("....................,/¯../ \n");
-                printf(".................../..../ \n");
-                printf("............./´¯/'...'/´¯¯`·¸ \n");
-                printf("........../'/.../..../......./¨¯\\ \n");
-                printf("........('(...´...´.... ¯~/'...') \n");
-                printf(".........\\.................'...../ \n");
-                printf("..........''...\\.......... _.·´ \n");
-                printf("............\\..............( \n");
-                printf("..............\\.............\\...\n\n");
-                break;
-            }
-            default:
-                break;
-        }
-    }
-}
\ No newline at end of file
diff --git a/src/entrypoints/death-stack-x-testsuite.cpp b/src/entrypoints/death-stack-x-testsuite.cpp
index d0146b091..0d000d394 100644
--- a/src/entrypoints/death-stack-x-testsuite.cpp
+++ b/src/entrypoints/death-stack-x-testsuite.cpp
@@ -20,14 +20,6 @@
  * THE SOFTWARE.
  */
 
-/**
- * Components on the stm board:
- *
- * STM32F429:
- *     Led wave
- *     External oscillator
- */
-
 #include <Common.h>
 #include <drivers/adc/ADS1118/ADS1118.h>
 #include <drivers/adc/InternalADC/InternalADC.h>
diff --git a/src/tests/test-death-stack-x.cpp b/src/tests/test-death-stack-x.cpp
deleted file mode 100644
index 83532b745..000000000
--- a/src/tests/test-death-stack-x.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- * 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.
- */
-
-#include <Common.h>
-#include <drivers/adc/ADS1118/ADS1118.h>
-#include <drivers/adc/InternalADC/InternalADC.h>
-#include <drivers/gps/ublox/UbloxGPS.h>
-#include <drivers/hbridge/HBridge.h>
-#include <drivers/spi/SPIDriver.h>
-#include <interfaces-impl/hwmapping.h>
-#include <miosix.h>
-#include <sensors/BMX160/BMX160.h>
-#include <sensors/LIS3MDL/LIS3MDL.h>
-#include <sensors/MS580301BA07/MS580301BA07.h>
-#include <sensors/analog/battery/BatteryVoltageSensor.h>
-#include <sensors/analog/pressure/MPXHZ6130A/MPXHZ6130A.h>
-#include <sensors/analog/pressure/honeywell/SSCDANN030PAA.h>
-#include <sensors/analog/pressure/honeywell/SSCDRRN015PDA.h>
-
-#include <ctime>
-#include <iostream>
-#include <sstream>
-#include <vector>
-
-#include "../boards/DeathStack/AeroBrakesController/AeroBrakesServo.h"
-#include "../boards/DeathStack/DeploymentController/DeploymentServo.h"
-#include "PinHandler/PinHandler.h"
-#include "drivers/servo/servo.h"
-#include "math/Stats.h"
-
-using namespace std;
-
-namespace PowerBoardTest
-{
-#include "deathstack-boards/test-power-board.cpp"
-}
-
-namespace STMBoardTest
-{
-#include "deathstack-boards/test-stm-board.cpp"
-}
-
-namespace RFBoardTest
-{
-#include "deathstack-boards/test-rf-board.cpp"
-}
-
-namespace AnalogBoardTest
-{
-#include "deathstack-boards/test-analog-board.cpp"
-}
-
-int menu();
-
-int main()
-{
-    TimestampTimer::enableTimestampTimer();
-
-    switch (menu())
-    {
-        case 1:
-            PowerBoardTest::main();
-            break;
-        case 2:
-            STMBoardTest::main();
-            break;
-        case 3:
-            RFBoardTest::main();
-            break;
-        case 4:
-            AnalogBoardTest::main();
-            break;
-
-        default:
-            break;
-    }
-}
-
-int menu()
-{
-    string temp;
-    int choice;
-
-    printf("\n\nWhat do you want to do?\n");
-    printf("1. Test power board\n");
-    printf("2. Test stm board\n");
-    printf("3. Test rf board\n");
-    printf("4. Test analog board\n");
-    printf("\n>> ");
-    getline(cin, temp);
-    stringstream(temp) >> choice;
-
-    return choice;
-}
-- 
GitLab