PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

37 rindas
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. };