Files
Upsilon/ion/src/device/log.cpp
Romain Goyet abf8fcd259 [ion] Use a C API for logging
Change-Id: I0aaa139b3434b62618f5e8d6ac88fe164bca4c2b
2017-02-20 13:33:14 +01:00

16 lines
356 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_string(const char * message) {
char character = 0;
while ((character = *message++) != 0) {
if (ITM.TER()->get(0)) {
ITM.STIM(0)->set(character);
}
}
}