Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
StreamPuller.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <AH/Arduino-Wrapper.h> // Stream
4#include <Settings/NamespaceSettings.hpp>
5
7
14 public:
16
21 bool pull(uint8_t &c) {
22 int read = stream.read();
23 if (read >= 0)
24 c = read;
25 return read >= 0;
26 }
27
28 Stream &stream;
29};
30
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Helper that pulls bytes out of an Arduino stream.
bool pull(uint8_t &c)
Pull a byte out of the stream.
Stream & stream
StreamPuller(Stream &stream)