This commit is contained in:
J. Nick Koston
2026-02-04 05:50:41 +01:00
parent 068fc3476b
commit a5869c2a9c
8 changed files with 210 additions and 246 deletions
+4 -4
View File
@@ -63,18 +63,18 @@ void Logger::pre_setup() {
ESP_LOGI(TAG, "Log initialized");
}
void HOT Logger::write_msg_(const char *msg, size_t len) {
void HOT Logger::write_msg_(const LogBuffer &buf) {
// Single write with newline already in buffer (added by caller)
#ifdef CONFIG_PRINTK
// Requires the debug component and an active SWD connection.
// It is used for pyocd rtt -t nrf52840
k_str_out(const_cast<char *>(msg), len);
k_str_out(const_cast<char *>(buf.data), buf.pos);
#endif
if (this->uart_dev_ == nullptr) {
return;
}
for (size_t i = 0; i < len; ++i) {
uart_poll_out(this->uart_dev_, msg[i]);
for (uint16_t i = 0; i < buf.pos; ++i) {
uart_poll_out(this->uart_dev_, buf.data[i]);
}
}