Add logging functionality

master
jacob.eva 2 weeks ago
parent f175582181
commit b1ef85a726
No known key found for this signature in database
GPG Key ID: B92E083BBCCAA1E
  1. 8
      Framing.h
  2. 20
      Utilities.h

@ -106,6 +106,14 @@
#define ERROR_MEMORY_LOW 0x05 #define ERROR_MEMORY_LOW 0x05
#define ERROR_MODEM_TIMEOUT 0x06 #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 // Serial framing variables
size_t frame_len; size_t frame_len;
bool IN_FRAME = false; bool IN_FRAME = false;

@ -1712,4 +1712,24 @@ void unlock_rom() {
eeprom_erase(); 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" #include "src/misc/FIFOBuffer.h"

Loading…
Cancel
Save