most functionality to splashdwon, find neutral and start mission. short timeouts still in code for testing, will adjust to go directly to sit_idle after splashdown
Dependencies: mbed MODSERIAL FATFileSystem
Diff: MbedLogger/MbedLogger.hpp
- Revision:
- 49:47ffa4feb6db
- Parent:
- 46:030be9f5c793
--- a/MbedLogger/MbedLogger.hpp Thu Feb 15 04:01:57 2018 +0000 +++ b/MbedLogger/MbedLogger.hpp Thu Feb 15 23:07:25 2018 +0000 @@ -5,8 +5,6 @@ #include <string> using namespace std; -#include "SDFileSystem.h" - #include <vector> enum { @@ -30,12 +28,7 @@ void createTestLog(); //test log function void appendLogFile(int current_state, int option); //check if you have orphaned file pointers before this (file should not be open already) - - //one log file type for now - void openSDFile(); - - void copySDFile(); //copy SD card files - + //save float array to file (append each time) void saveDataToFile(int input_state, float *input); @@ -136,7 +129,6 @@ void receiveMissionDataWithTicker(); void closeLogFile(); //this sets pointer to null and checks if it is closed otherwise - void closeSDLogFile(); //this is using the file name from the timer to create sd card file names void specifyFileForTransmit(string input_string); void transmitFileFromDirectory(int file_number); @@ -150,17 +142,17 @@ void readTransmitPacketOneChar(); bool isTransmissionComplete(); - int currentPacketNumber(); + void eraseFile(); private: int _f; //file name number - char _file_name[256]; //file name placeholder int _file_number; - FILE *_fp; //the file is a class member variable + char _file_name[256]; //file name placeholder + char _line_buffer[256]; //line buffer used to read file line by line - char _line_buffer[256]; + FILE *_fp; //the file is a class member variable vector <int> _data_packet; @@ -199,7 +191,6 @@ volatile bool _mbed_receive_loop; string _file_system_string; - string _SD_file_name_string; string _full_file_path_string; volatile bool _file_transmission_complete;