code from Book of TDD for embedded C