Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions MIDAS/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ build_flags =
build_src_filter = +<*> +<silsim/**/*.cpp> -<hardware/> -<hilsim>
build_unflags =
-std=gnu++11
lib_ignore =
TCAL9539

[env:mcu_silsim_booster]
platform = native
Expand All @@ -96,7 +98,7 @@ build_flags =
build_src_filter = +<*> +<silsim/**/*.cpp> -<hardware/> -<hilsim>
build_unflags =
-std=gnu++11
lib_deps =
Eigen
;lib_deps =
; Eigen
Comment on lines +101 to +102
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why eigen is killed here

lib_ignore =
TCAL9539
32 changes: 13 additions & 19 deletions MIDAS/src/Mutex.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
#ifdef SILSIM
#include "silsim/emulation.h"
#else
#include <FreeRTOS.h>
#include <semphr.h>
#include <task.h>
#endif
#include "hal.h"

#define MUTEX_TIMEOUT pdMS_TO_TICKS(100)

Expand Down Expand Up @@ -50,10 +44,10 @@ struct Mutex {
* @return The value in the mutex.
*/
T read() {
if (!mutex_handle || mutex_handle != check) {
Serial.println("Aw shucks");
Serial.flush();
}
// if (!mutex_handle || mutex_handle != check) {
// Serial.println("Aw shucks");
// Serial.flush();
// }
xSemaphoreTake(mutex_handle, portMAX_DELAY);
// while (!xSemaphoreTake(mutex_handle, MUTEX_TIMEOUT)) { }
T ret = data;
Expand All @@ -76,10 +70,10 @@ struct Mutex {
* @param ptr buffer to store data in
*/
void read2(T* ptr) {
if (!mutex_handle || mutex_handle != check) {
Serial.println("Aw shucks");
Serial.flush();
}
// if (!mutex_handle || mutex_handle != check) {
// Serial.println("Aw shucks");
// Serial.flush();
// }
xSemaphoreTake(mutex_handle, portMAX_DELAY);
// while (!xSemaphoreTake(mutex_handle, MUTEX_TIMEOUT)) { }
*ptr = data;
Expand All @@ -92,10 +86,10 @@ struct Mutex {
* @param value What to update the mutex to.
*/
void write(T value) {
if (!mutex_handle || mutex_handle != check) {
Serial.println("Aw shucks");
Serial.flush();
}
// if (!mutex_handle || mutex_handle != check) {
// Serial.println("Aw shucks");
// Serial.flush();
// }

while (!xSemaphoreTake(mutex_handle, MUTEX_TIMEOUT)) { }
data = value;
Expand Down
4 changes: 2 additions & 2 deletions MIDAS/src/Queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class Queue {
*/
void send(T value) {
if(xQueueSendToBack(queue, &value, 0) == errQUEUE_FULL){
Serial.print("FULL QUEUE");
Serial.println(pcTaskGetName(nullptr));
// Serial.print("FULL QUEUE");
// Serial.println(pcTaskGetName(nullptr));
}
}

Expand Down
153 changes: 0 additions & 153 deletions MIDAS/src/b2b_interface.cpp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should undo this getting deleted

This file was deleted.

64 changes: 0 additions & 64 deletions MIDAS/src/b2b_interface.h

This file was deleted.

14 changes: 7 additions & 7 deletions MIDAS/src/data_logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ constexpr ReadingDiscriminant get_discriminant();
#define ASSOCIATE(ty, id) template<> constexpr ReadingDiscriminant get_discriminant<ty>() { return ReadingDiscriminant::id; }

ASSOCIATE(LowGData, ID_LOWG)
ASSOCIATE(LowGLSM, ID_LOWGLSM)
ASSOCIATE(LowGLSMData, ID_LOWGLSM)
ASSOCIATE(HighGData, ID_HIGHG)
ASSOCIATE(Barometer, ID_BAROMETER)
ASSOCIATE(Continuity, ID_CONTINUITY)
ASSOCIATE(Voltage, ID_VOLTAGE)
ASSOCIATE(GPS, ID_GPS)
ASSOCIATE(Magnetometer, ID_MAGNETOMETER)
ASSOCIATE(Orientation, ID_ORIENTATION)
ASSOCIATE(BarometerData, ID_BAROMETER)
ASSOCIATE(ContinuityData, ID_CONTINUITY)
ASSOCIATE(VoltageData, ID_VOLTAGE)
ASSOCIATE(GPSData, ID_GPS)
ASSOCIATE(MagnetometerData, ID_MAGNETOMETER)
ASSOCIATE(OrientationData, ID_ORIENTATION)
ASSOCIATE(FSMState, ID_FSM)
ASSOCIATE(KalmanData, ID_KALMAN)
ASSOCIATE(PyroState, ID_PYRO)
Expand Down
3 changes: 1 addition & 2 deletions MIDAS/src/errors.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "errors.h"
#include "TCAL9539.h"

/**
* If an error during initialization was detected, some combination of the blue, green, orange, and red LEDs will be on,
Expand Down Expand Up @@ -118,6 +117,6 @@ void update_error_LED(ErrorCode error) {

void update_error_LED(ErrorCode error) {

};
}

#endif
4 changes: 2 additions & 2 deletions MIDAS/src/finite-state-machines/fsm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ StateEstimate::StateEstimate(RocketData& state) {
acceleration = sensor_average<HighGData, 8>(state.high_g, [](HighGData& data) {
return (double) data.ax;
});
altitude = sensor_average<Barometer, 16>(state.barometer, [](Barometer& data) {
altitude = sensor_average<BarometerData, 16>(state.barometer, [](BarometerData& data) {
return (double) data.altitude;
});
jerk = sensor_derivative<HighGData, 8>(state.high_g, [](HighGData& data) {
return (double) data.ax;
});
vertical_speed = sensor_derivative<Barometer, 16>(state.barometer, [](Barometer& data) {
vertical_speed = sensor_derivative<BarometerData, 16>(state.barometer, [](BarometerData& data) {
return (double) data.altitude;
});
}
Expand Down
Loading