
P a g e
10 | 13
Modifying IoT Software for ULINK
pro
Source Code Changes
The code changes required to use the ULINK
pro
are minimal and involve redirecting all
printf
and
puts
output to
the ITM SWV output. This is accomplished in the project by modifying the following files:
config_me.h
:
By adding the
_ULINK_PRINT
print define in the “C/C++” tab, you enable the automatic inclusion of
itm_output.h
file. This file contains the ITM addresses and functions needed to output to the Debug (printf) viewer.
If
_ULINK_PRINT
is not selected, it defaults to the standard
printf
and
puts
functions in the C runtime library.
#ifdef _ULINK_PRINT
#include "itm_output.h"
#else
#define PRINTF
#define PUTS
#endif
main.cpp, Wnc_control.cpp, sensor.cpp
:
All the changes in these files involve changing the
printf
,
pc.printf,
and
puts
statements to their corresponding pound defines. Lastly, add
config_me.h
to
sensors.cpp
.