Spaceshot Flight Software
The Illinois Space Society's Homemade Rocket Firmware
dataLog.cpp File Reference
#include "dataLog.h"
#include <ChRt.h>
#include <SD.h>
#include <stdio.h>
#include "pins.h"
#include "sensors.h"

Functions

 MUTEX_DECL (SD_Card_Mutex)
 
void dataLoggerTickFunction (pointers *pointer_struct)
 Construct a new thd function object to log data to the SD card. More...
 
char * sd_file_namer (char *fileName, char *fileExtensionParam)
 Creates the name for a file to be written to SD card. More...
 
void logData (File *dataFile, sensorDataStruct_t *data)
 

Variables

int32_t flush_iterator = 0
 Logs data to 1 line of a specified .csv file on SD card. More...
 

Detailed Description

Contains the code to handle FIFO buffers for sensors, work with the SD card library. The header file also contains important data structs.

Function Documentation

◆ dataLoggerTickFunction()

void dataLoggerTickFunction ( pointers pointer_struct)

Construct a new thd function object to log data to the SD card.

Parameters
argContains info on the ring buffers containing the data and mutexes protecting it. This allows data to be passed to the function from another file.

◆ sd_file_namer()

char* sd_file_namer ( char *  fileName,
char *  fileExtensionParam 
)

Creates the name for a file to be written to SD card.

Parameters
fileNamePointer to char[] containing intended name of file. Do not include number or file extension at end of name. Make sure this is longer than it needs to be.
fileExtensionPointer to char[] containing the file extension for the file.
Returns
char* Pointer to inputted char[]. It now contains number (if duplicate file existed) and .csv file extension.

Variable Documentation

◆ flush_iterator

int32_t flush_iterator = 0

Logs data to 1 line of a specified .csv file on SD card.

Parameters
dataFileFile on SD card. Object from SD library.
dataData structure to be logged.