You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
automax(const T &a, const L &b) -> decltype((b < a) ? b : a) {
12
+
return (a < b) ? b : a;
13
+
}
14
+
#else
15
+
#definemax(a, b) \
16
+
({ \
17
+
__typeof__(a) _a = (a); \
18
+
__typeof__(b) _b = (b); \
19
+
_a > _b ? _a : _b; \
20
+
})
21
+
#endif
22
+
#endif
23
+
24
+
// map is already defined in AvrMath.h. Need to use C++'s map.
25
+
#ifdef map
26
+
#undef map
27
+
#endif
28
+
29
+
5
30
#include<vector>
31
+
#include<map>
6
32
#include<cassert>
7
33
#include"Stream.h"
8
34
9
35
using std::vector;
36
+
using std::map;
10
37
11
38
// Some inspiration taken from https://github.com/arduino/ArduinoCore-megaavr/blob/d2a81093ba66d22dbda14c30d146c231c5910734/libraries/Wire/src/Wire.cpp
12
39
classTwoWire : publicObservableDataStream
@@ -45,7 +72,6 @@ class TwoWire : public ObservableDataStream
45
72
// Begin a transmission to the I2C slave device with the given address. Subsequently, queue bytes for
46
73
// transmission with the write() function and transmit them by calling endTransmission().
47
74
voidbeginTransmission(int address) {
48
-
// TODO: implement
49
75
assert(isMaster);
50
76
txAddress = address;
51
77
txBuffer.clear();
@@ -59,9 +85,12 @@ class TwoWire : public ObservableDataStream
0 commit comments