Skyward boardcore
Loading...
Searching...
No Matches
StackData.h
Go to the documentation of this file.
1
/* Copyright (c) 2019 Skyward Experimental Rocketry
2
* Author: Luca Erbetta
3
*
4
* Permission is hereby granted, free of charge, to any person obtaining a copy
5
* of this software and associated documentation files (the "Software"), to deal
6
* in the Software without restriction, including without limitation the rights
7
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
* copies of the Software, and to permit persons to whom the Software is
9
* furnished to do so, subject to the following conditions:
10
*
11
* The above copyright notice and this permission notice shall be included in
12
* all copies or substantial portions of the Software.
13
*
14
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
* THE SOFTWARE.
21
*/
22
23
#pragma once
24
25
#include <cstdint>
26
#include <ostream>
27
#include <string>
28
29
namespace
Boardcore
30
{
31
32
// Add here unique identifiers for threads in skyward-boardcore
33
enum
ThreadId
: uint8_t
34
{
35
THID_MAV_RECEIVER
,
36
THID_MAV_SENDER
,
37
THID_XBEE
,
38
THID_GPS
,
39
THID_EVT_BROKER
,
40
THID_LOGGER_PACK
,
41
THID_LOGGER_WRITE
,
42
THID_CPU_METER
,
43
THID_CPU_WD
,
44
THID_PIN_OBS
,
45
46
// First available id to be used by repos that include boardcore as a
47
// library
48
THID_FIRST_AVAILABLE_ID
49
};
50
51
struct
StackData
52
{
53
long
long
timestamp
= 0;
54
uint8_t
threadId
= 0;
55
unsigned
int
minimumStack
= 0;
56
57
static
std::string
header
() {
return
"timestamp,threadId,minimumStack\n"
; }
58
59
void
print
(std::ostream& os)
60
{
61
os <<
timestamp
<<
","
<< (int)
threadId
<<
","
<<
minimumStack
<<
"\n"
;
62
}
63
};
64
65
}
// namespace Boardcore
Boardcore
This file includes all the types the logdecoder script will decode.
Definition
ActiveObject.h:31
Boardcore::ThreadId
ThreadId
Definition
StackData.h:34
Boardcore::THID_CPU_WD
@ THID_CPU_WD
Definition
StackData.h:43
Boardcore::THID_LOGGER_WRITE
@ THID_LOGGER_WRITE
Definition
StackData.h:41
Boardcore::THID_LOGGER_PACK
@ THID_LOGGER_PACK
Definition
StackData.h:40
Boardcore::THID_CPU_METER
@ THID_CPU_METER
Definition
StackData.h:42
Boardcore::THID_GPS
@ THID_GPS
Definition
StackData.h:38
Boardcore::THID_PIN_OBS
@ THID_PIN_OBS
Definition
StackData.h:44
Boardcore::THID_XBEE
@ THID_XBEE
Definition
StackData.h:37
Boardcore::THID_EVT_BROKER
@ THID_EVT_BROKER
Definition
StackData.h:39
Boardcore::THID_FIRST_AVAILABLE_ID
@ THID_FIRST_AVAILABLE_ID
Definition
StackData.h:48
Boardcore::THID_MAV_SENDER
@ THID_MAV_SENDER
Definition
StackData.h:36
Boardcore::THID_MAV_RECEIVER
@ THID_MAV_RECEIVER
Definition
StackData.h:35
Boardcore::StackData
Definition
StackData.h:52
Boardcore::StackData::threadId
uint8_t threadId
Definition
StackData.h:54
Boardcore::StackData::timestamp
long long timestamp
Definition
StackData.h:53
Boardcore::StackData::print
void print(std::ostream &os)
Definition
StackData.h:59
Boardcore::StackData::minimumStack
unsigned int minimumStack
Definition
StackData.h:55
Boardcore::StackData::header
static std::string header()
Definition
StackData.h:57
src
shared
diagnostic
StackData.h
Generated by
1.10.0