Updated feedback

This commit is contained in:
dario 2024-06-26 23:35:06 +02:00 committed by dario
parent ebb14896b8
commit 9eddbaa30f
2 changed files with 10 additions and 4 deletions

View File

@ -17,7 +17,9 @@ namespace sta
STA_ASSERT(length > 0);
printf("%.*s", length, str);
printf("\r\n");
if (newline)
printf("\r\n");
}
void PrintablePrintf::read(uint8_t * str, size_t length)

View File

@ -19,11 +19,15 @@ namespace sta
void PrintableUART::print(const char * str, size_t length, bool newline /* = false */)
{
const char * linebreak = "\r\n";
intf_->acquire();
intf_->transfer(reinterpret_cast<const uint8_t *>(str), length);
intf_->transfer(reinterpret_cast<const uint8_t *>(linebreak), 2);
if (newline)
{
const char * linebreak = "\r\n";
intf_->transfer(reinterpret_cast<const uint8_t *>(linebreak), 2);
}
intf_->release();
}