implemented printf function

code borrowed from ChibiOS/RT. Note: This code is VERY SLOW (2ms for
each printf), so please only use for debugging