mirror of
https://github.com/liberatedsystems/RNode_Firmware_CE.git
synced 2025-02-23 08:20:13 -05:00
Add logging functionality
This commit is contained in:
parent
f175582181
commit
b1ef85a726
@ -106,6 +106,14 @@
|
||||
#define ERROR_MEMORY_LOW 0x05
|
||||
#define ERROR_MODEM_TIMEOUT 0x06
|
||||
|
||||
// Serial logging
|
||||
#define LOG_MSG 0x2F
|
||||
|
||||
#define MSG_INFO 0x01
|
||||
#define MSG_ERR 0x02
|
||||
#define MSG_DBG 0x03
|
||||
#define MSG_TRACE 0x04
|
||||
|
||||
// Serial framing variables
|
||||
size_t frame_len;
|
||||
bool IN_FRAME = false;
|
||||
|
20
Utilities.h
20
Utilities.h
@ -1712,4 +1712,24 @@ void unlock_rom() {
|
||||
eeprom_erase();
|
||||
}
|
||||
|
||||
void log_debug(const char* msg) {
|
||||
serial_write(FEND);
|
||||
serial_write(LOG_MSG);
|
||||
serial_write(MSG_DBG);
|
||||
for (int i = 0; i < strlen(msg); i++) {
|
||||
escaped_serial_write(msg[i]);
|
||||
}
|
||||
serial_write(FEND);
|
||||
}
|
||||
|
||||
void log_debug(char* msg) {
|
||||
serial_write(FEND);
|
||||
serial_write(LOG_MSG);
|
||||
serial_write(MSG_DBG);
|
||||
for (int i = 0; i < strlen(msg); i++) {
|
||||
escaped_serial_write(msg[i]);
|
||||
}
|
||||
serial_write(FEND);
|
||||
}
|
||||
|
||||
#include "src/misc/FIFOBuffer.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user