http://os.mbed.com/users/wim/code/SWO/#53de8ef789f3