return value should be checked on pios_board.c or a while != 0 should be used here.