File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed
Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 33
44// ReSharper disable CppInconsistentNaming
55
6- unsigned long gMicros = 0 ;
6+ namespace mock
7+ {
8+ unsigned long gMicros = 0 ;
79std::vector<int > gAnalogPins (256 , 0 );
10+ }
11+
812MockSerial Serial;
9- MockWire Wire;
13+ MockWire Wire;
Original file line number Diff line number Diff line change @@ -8,15 +8,19 @@ constexpr const char* F(const char* x) { return x; }
88
99// Mock globals
1010
11- extern unsigned long gMicros ;
12- inline unsigned long micros () { return gMicros ; }
13- inline void setMockMicros (const unsigned long value) { gMicros = value;}
11+ namespace mock {
1412
13+ extern unsigned long gMicros ;
1514extern std::vector<int > gAnalogPins ;
16- inline int analogRead (const int pin) { return gAnalogPins .at (pin);}
15+
16+ }
17+ inline unsigned long micros () { return mock::gMicros ; }
18+ inline void setMockMicros (const unsigned long value) { mock::gMicros = value;}
19+
20+ inline int analogRead (const int pin) { return mock::gAnalogPins .at (pin);}
1721inline void setMockAnalogRead (const int pin, const int value)
1822{
19- gAnalogPins .at (pin) = value;
23+ mock:: gAnalogPins .at (pin) = value;
2024}
2125
2226template <typename T>
You can’t perform that action at this time.
0 commit comments