Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
varun-un committed Jun 27, 2024
2 parents cdcddef + 284d724 commit b5212c1
Show file tree
Hide file tree
Showing 42 changed files with 1,649 additions and 2,392 deletions.
2 changes: 1 addition & 1 deletion Side_Projects/Live Video/radio-interface/APRSMsg.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ APRS Telemetry Data
- t0
- dao
*/
struct APRSData
struct APRSTelemData
{
char lat[16];
char lng[16];
Expand Down
6 changes: 3 additions & 3 deletions Side_Projects/Live Video/radio-interface/RFM69HCW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ bool RFM69HCW::encode(char *message, EncodingType type, int len)
return false;

// holds the data to be assembled into the aprs body
APRSData data;
APRSTelemData data;

// find each value separated in order by a comma and put in the APRSData array
// find each value separated in order by a comma and put in the APRSTelemData array
{
char *currentVal = new char[this->msgLen];
int currentValIndex = 0;
Expand Down Expand Up @@ -426,7 +426,7 @@ bool RFM69HCW::decode(char *message, EncodingType type, int len)
char *bodyptr = body;
strcpy(body, aprs.getBody()->getData());
// decode body
APRSData data;
APRSTelemData data;
int i = 0;
int len = strlen(body);

Expand Down
Binary file added Spaceport/23-24/Code/Rpi-Middleman/data7.log
Binary file not shown.
45 changes: 0 additions & 45 deletions Spaceport/23-24/Code/Teensy-Based Avionics/include/Radio.h

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "LinearKalmanFilter.h"
#include "Matrix.h"
LinearKalmanFilter::LinearKalmanFilter(Matrix X, Matrix U, Matrix P, Matrix F, Matrix G, Matrix R, Matrix Q)
{
state.X = X;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ static const char *logTypeStrings[] = {"LOG", "ERROR", "WARNING", "INFO"};
static Mode mode = GROUND;
void recordFlightData(char *data)
{
if(!isSDReady())
if (!isSDReady())
return;
if (mode == GROUND)
if (mode == GROUND || !ram->isReady())
{
flightDataFile = sd.open(flightDataFileName, FILE_WRITE); // during preflight, print to SD card constantly. ignore PSRAM for this stage.
if (flightDataFile)
Expand All @@ -15,7 +15,7 @@ void recordFlightData(char *data)
flightDataFile.close();
}
}
else if(ram->isReady())
else
ram->println(data); // while in flight, print to PSRAM for later dumping to SD card.
}

Expand All @@ -32,15 +32,12 @@ void recordLogData(double timeStamp, LogType type, const char *data, Dest dest)

if (dest == BOTH || dest == TO_USB)
{
// if (!Serial){
// Serial.begin(9600);
// }
Serial.print(logPrefix);
Serial.println(data);
}
if ((dest == BOTH || dest == TO_FILE) && isSDReady())
{
if (mode == GROUND)
if (mode == GROUND || !ram->isReady())
{
logFile = sd.open(logFileName, FILE_WRITE); // during preflight, print to SD card constantly. ignore PSRAM for this stage. With both files printing, may be bad...
if (logFile)
Expand All @@ -50,7 +47,7 @@ void recordLogData(double timeStamp, LogType type, const char *data, Dest dest)
logFile.close();
}
}
else if (ram->isReady()) // while in flight, print to PSRAM for later dumping to SD card.
else // while in flight, print to PSRAM for later dumping to SD card.
{
ram->print(logPrefix, false);
ram->println(data, false);
Expand All @@ -60,10 +57,11 @@ void recordLogData(double timeStamp, LogType type, const char *data, Dest dest)

void setRecordMode(Mode m)
{
if(mode == FLIGHT && m == GROUND){
if (mode == FLIGHT && m == GROUND && ram->isReady())
{
ram->dumpFlightData();
ram->dumpLogData();
bb.aonoff(LED_BUILTIN, 2000);//turn on LED for 2 seconds to indicate that the PSRAM is being dumped to the SD card.
bb.aonoff(LED_BUILTIN, 2000); // turn on LED for 2 seconds to indicate that the PSRAM is being dumped to the SD card.
}
mode = m;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bool PSRAM::init()
{
uint8_t size = external_psram_size;
memBegin = cursorStart = reinterpret_cast<char *>(0x70000000);
memEnd = cursorEnd = memBegin + (size * 1048576);
memEnd = cursorEnd = memBegin + (size * 1048576) - 1;

if (size > 0)
{
Expand Down Expand Up @@ -73,7 +73,7 @@ bool PSRAM::dumpFlightData()
bool PSRAM::dumpLogData()
{ // more complicated because data is stored in reverse order
if (!isSDReady() || !ready){
bb.aonoff(33, 200);
bb.aonoff(BUZZER, 200);
return false;
}

Expand All @@ -83,11 +83,11 @@ bool PSRAM::dumpLogData()
logFile = sd.open(logFileName, FILE_WRITE);

if (!logFile){
bb.aonoff(33, 200, 3);
bb.aonoff(BUZZER, 200, 3);
return false;
}

while (writeCursor >= cursorEnd)
while (writeCursor > cursorEnd)
{

for (i = 0; i < 2048; i++)
Expand All @@ -106,7 +106,7 @@ bool PSRAM::dumpLogData()
logFile.close();
cursorEnd = memEnd;
dumped = true;
bb.aonoff(33, 200, 5);
bb.aonoff(BUZZER, 200, 5);
return true;
}

Expand Down
31 changes: 0 additions & 31 deletions Spaceport/23-24/Code/Teensy-Based Avionics/lib/imumaths/imumaths.h

This file was deleted.

Loading

0 comments on commit b5212c1

Please sign in to comment.