PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

37 líneas
574B

  1. /**
  2. * A print class for testing the encoder
  3. */
  4. class TestPrint : public Print {
  5. private:
  6. //a small test buffer
  7. uint8_t buffer[64];
  8. //pointer to the current write spot
  9. int bufferPointer;
  10. public:
  11. TestPrint(){
  12. bufferPointer = 0;
  13. }
  14. size_t write(uint8_t character) {
  15. buffer[bufferPointer++] = character;
  16. return character;
  17. }
  18. int size(){
  19. return bufferPointer;
  20. }
  21. uint8_t at(int index){
  22. return buffer[index];
  23. }
  24. void clear(){
  25. bufferPointer = 0;
  26. }
  27. };