ASCEND Flight Software
Loading...
Searching...
No Matches
Logger.h
Go to the documentation of this file.
1#ifndef LOGGER_H
2#define LOGGER_H
3
4#include <Arduino.h>
5
6static inline void log_core(String str) {
7 Serial.print("[Core " + String(get_core_num()) + "] " + str + "\n");
8}
9
10static inline void log_data_raw(const uint8_t* packet, const uint8_t len) {
11 Serial.write((const char*)packet, len);
12}
13
14static inline void log_data_bytes(const uint8_t* packet, const uint8_t len) {
15 String packet_as_hex = "";
16 for (size_t i = 0; i < len; i++) {
17 packet_as_hex += String(packet[i], HEX) + " ";
18 }
19 packet_as_hex += "\n";
20 Serial.print(packet_as_hex);
21}
22
23static inline void log_data(String data) {
24 Serial.print("[Data] " + data + "\n");
25}
26
27// Log flash-related data
28static inline void log_flash(String data) {
29 Serial.print("[Flash] " + data + '\n');
30}
31
32#endif // LOGGER_H