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

Committer:
tnhnrl
Date:
Thu Dec 21 23:13:44 2017 +0000
Revision:
39:58375ca6b6ff
Parent:
36:966a86937e17
Pool-tested code with Mbed logging and OpenLog (SD card)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tnhnrl 32:f2f8ae34aadc 1 #ifndef MBEDLOGGER_HPP
tnhnrl 32:f2f8ae34aadc 2 #define MBEDLOGGER_HPP
tnhnrl 32:f2f8ae34aadc 3
tnhnrl 32:f2f8ae34aadc 4 #include "mbed.h"
tnhnrl 32:f2f8ae34aadc 5 #include <string>
tnhnrl 32:f2f8ae34aadc 6 using namespace std;
tnhnrl 32:f2f8ae34aadc 7
tnhnrl 32:f2f8ae34aadc 8 #include "DirectoryList.h"
tnhnrl 32:f2f8ae34aadc 9
tnhnrl 32:f2f8ae34aadc 10 class MbedLogger {
tnhnrl 32:f2f8ae34aadc 11 public:
tnhnrl 32:f2f8ae34aadc 12 MbedLogger(); //constructor
tnhnrl 32:f2f8ae34aadc 13 void createTestLog(); //test log function
tnhnrl 32:f2f8ae34aadc 14
tnhnrl 32:f2f8ae34aadc 15 //one log file type for now
tnhnrl 36:966a86937e17 16 void openFile();
tnhnrl 32:f2f8ae34aadc 17
tnhnrl 32:f2f8ae34aadc 18 //save float array to file (append each time)
tnhnrl 36:966a86937e17 19 void saveDataToFile(int input_state, float *input);
tnhnrl 32:f2f8ae34aadc 20
tnhnrl 32:f2f8ae34aadc 21 //print the directory to the screen
tnhnrl 32:f2f8ae34aadc 22 void printMbedDirectory();
tnhnrl 32:f2f8ae34aadc 23
tnhnrl 32:f2f8ae34aadc 24 //close the current file stream [before creating a new one]
tnhnrl 32:f2f8ae34aadc 25 void closeFile();
tnhnrl 35:2f66ea4863d5 26
tnhnrl 35:2f66ea4863d5 27 //print the current MBED log file
tnhnrl 35:2f66ea4863d5 28 void printCurrentLogFile();
tnhnrl 32:f2f8ae34aadc 29
tnhnrl 32:f2f8ae34aadc 30 private:
tnhnrl 32:f2f8ae34aadc 31 int _f; //file name number
tnhnrl 32:f2f8ae34aadc 32 char _file_name[128]; //file name placeholder
tnhnrl 32:f2f8ae34aadc 33 int _file_number;
tnhnrl 32:f2f8ae34aadc 34
tnhnrl 32:f2f8ae34aadc 35 FILE *_fp; //the file is a class member variable
tnhnrl 32:f2f8ae34aadc 36 };
tnhnrl 32:f2f8ae34aadc 37
tnhnrl 32:f2f8ae34aadc 38 #endif