Files
Upsilon/ion/src/device/log.cpp
Romain Goyet 724fdb18e7 [ion] Implement Log::print using SWO on the device
Change-Id: I17e024535cc0f0daf74953c7221e2b98959e6c47
2017-02-14 10:57:30 +01:00

16 lines
357 B
C++

#include <ion/log.h>
#include "regs/itm.h"
// We're printing using SWO.
// This is achieved by writing to the ITM register, which is sent through the
// Cortex Debug bus
void Ion::Log::print(const char * message) {
char character = 0;
while ((character = *message++) != 0) {
if (ITM.TER()->get(0)) {
ITM.STIM(0)->set(character);
}
}
}