Control Surface
pin-t-adl
MIDI Control Surface library for Arduino
src
MIDI_Parsers
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
6
BEGIN_CS_NAMESPACE
7
13
class
StreamPuller
{
14
public
:
15
StreamPuller
(Stream &
stream
) :
stream
(
stream
) {}
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
31
END_CS_NAMESPACE
Arduino-Wrapper.h
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition:
Settings/NamespaceSettings.hpp:10
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition:
Settings/NamespaceSettings.hpp:9
StreamPuller
Helper that pulls bytes out of an Arduino stream.
Definition:
StreamPuller.hpp:13
StreamPuller::pull
bool pull(uint8_t &c)
Pull a byte out of the stream.
Definition:
StreamPuller.hpp:21
StreamPuller::stream
Stream & stream
Definition:
StreamPuller.hpp:28
StreamPuller::StreamPuller
StreamPuller(Stream &stream)
Definition:
StreamPuller.hpp:15
Generated by
1.9.4