-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFlightComputer.h
More file actions
111 lines (86 loc) · 3.86 KB
/
FlightComputer.h
File metadata and controls
111 lines (86 loc) · 3.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA *
* *
***************************************************************************
* *
* (c) Copyright, 2001-2012, ANSR *
* *
***************************************************************************
* *
* Filename: FlightComputer.h *
* *
***************************************************************************/
#ifndef APRSBEACON_H
#define APRSBEACON_H
//FIXME: remove once this is rolled into the armlib
#include "GPSNmea.h"
#include "ToneGenerator.h"
/**
* @defgroup application Flight Computer Application
*
* @{
*/
/**
* Flight Computer main application class.
*/
class FlightComputer
{
public:
FlightComputer();
void Run();
static FlightComputer *GetInstance();
/// variables used to count the elapsed time
volatile uint16_t msElapsed;
volatile uint16_t ms100Elapsed;
volatile uint16_t sElapsed;
/// flag indicating 100ms is up
volatile bool_t timer100msFlag;
/// flag indicating 1s is up
volatile bool_t timer1sFlag;
/// flag indicating 10s is up
volatile bool_t timer10sFlag;
/// flag indicating launch has been detected
bool_t launchDetect;
/// flag indicating GPS passthru mode is enabled
bool_t passThruMode;
/// GPDData object indicating the predicted landing position
GPSData landingPrediction;
void LandingPrediction();
int32_t AscentRate();
private:
void ScheduleMessage();
void SystemTimerTick();
void StatusPacket(const GPSData *gps, char *text);
//FAT16 * flash;
//FAT16::fat16_file_struct * handle;
/// Pointer to GPS engine control object.
GPSNmea *gps;
/// Pointer to the engineering control object.
Engineering *eng;
/// Pointer to AX.25 message generation object.
AFSK *afsk;
/// Peak payload altitude in feet.
int32_t peakAltitude;
/// Time since Epoch the GPS first reported a 3D fix.
uint32_t gpsFixTime;
/// System timer value to turn off GPS status tick LED.
uint32_t statusLEDOffTick;
uint32_t millisecondTimer;
// counts the number of ascent rate readings that have been above a certain threshold
uint8_t posAscentCount;
};
/** @} */
#endif // #ifndef APRSBEACON_H