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
29namespace Boardcore
30{
31
32// Add here unique identifiers for threads in skyward-boardcore
33enum ThreadId : uint8_t
34{
45
46 // First available id to be used by repos that include boardcore as a
47 // library
49};
50
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
This file includes all the types the logdecoder script will decode.
@ THID_CPU_WD
Definition StackData.h:43
@ THID_LOGGER_WRITE
Definition StackData.h:41
@ THID_LOGGER_PACK
Definition StackData.h:40
@ THID_CPU_METER
Definition StackData.h:42
@ THID_PIN_OBS
Definition StackData.h:44
@ THID_EVT_BROKER
Definition StackData.h:39
@ THID_FIRST_AVAILABLE_ID
Definition StackData.h:48
@ THID_MAV_SENDER
Definition StackData.h:36
@ THID_MAV_RECEIVER
Definition StackData.h:35
long long timestamp
Definition StackData.h:53
void print(std::ostream &os)
Definition StackData.h:59
unsigned int minimumStack
Definition StackData.h:55
static std::string header()
Definition StackData.h:57