2
2
// SPDX-License-Identifier: MPL-2.0
3
3
4
4
#include " Wire.h"
5
- #include < vector>
6
5
#include < vl53l4cd_class.h> // from stm32duino
7
6
#include " Arduino_LSM6DSOX.h"
8
7
#include < Arduino_LPS22HB.h>
@@ -141,7 +140,7 @@ class ModulinoButtons : public Module {
141
140
return ;
142
141
}
143
142
virtual uint8_t discover () {
144
- for (int i = 0 ; i < match. size ( ); i++) {
143
+ for (int i = 0 ; i < sizeof ( match)/ sizeof (match[ 0 ] ); i++) {
145
144
if (scan (match[i])) {
146
145
return match[i];
147
146
}
@@ -151,7 +150,7 @@ class ModulinoButtons : public Module {
151
150
private:
152
151
bool last_status[3 ];
153
152
protected:
154
- std::vector< uint8_t > match = { 0x7C }; // same as fw main.c
153
+ uint8_t match[ 1 ] = { 0x7C }; // same as fw main.c
155
154
};
156
155
157
156
class ModulinoBuzzer : public Module {
@@ -170,15 +169,15 @@ class ModulinoBuzzer : public Module {
170
169
write (buf, 8 );
171
170
}
172
171
virtual uint8_t discover () {
173
- for (int i = 0 ; i < match. size ( ); i++) {
172
+ for (int i = 0 ; i < sizeof ( match)/ sizeof (match[ 0 ] ); i++) {
174
173
if (scan (match[i])) {
175
174
return match[i];
176
175
}
177
176
}
178
177
return 0xFF ;
179
178
}
180
179
protected:
181
- std::vector< uint8_t > match = { 0x3C }; // same as fw main.c
180
+ uint8_t match[ 1 ] = { 0x3C }; // same as fw main.c
182
181
};
183
182
184
183
class ModulinoColor {
@@ -217,7 +216,7 @@ class ModulinoPixels : public Module {
217
216
write ((uint8_t *)data, NUMLEDS * 4 );
218
217
}
219
218
virtual uint8_t discover () {
220
- for (int i = 0 ; i < match. size ( ); i++) {
219
+ for (int i = 0 ; i < sizeof ( match)/ sizeof (match[ 0 ] ); i++) {
221
220
if (scan (match[i])) {
222
221
return match[i];
223
222
}
@@ -228,7 +227,7 @@ class ModulinoPixels : public Module {
228
227
static const int NUMLEDS = 8 ;
229
228
uint32_t data[NUMLEDS];
230
229
protected:
231
- std::vector< uint8_t > match = { 0x6C };
230
+ uint8_t match[ 1 ] = { 0x6C };
232
231
};
233
232
234
233
@@ -274,7 +273,7 @@ class ModulinoKnob : public Module {
274
273
return _pressed;
275
274
}
276
275
virtual uint8_t discover () {
277
- for (int i = 0 ; i < match. size ( ); i++) {
276
+ for (int i = 0 ; i < sizeof ( match)/ sizeof (match[ 0 ] ); i++) {
278
277
if (scan (match[i])) {
279
278
return match[i];
280
279
}
@@ -285,7 +284,7 @@ class ModulinoKnob : public Module {
285
284
bool _pressed = false ;
286
285
bool _bug_on_set = false ;
287
286
protected:
288
- std::vector< uint8_t > match = { 0x74 , 0x76 };
287
+ uint8_t match[ 2 ] = { 0x74 , 0x76 };
289
288
};
290
289
291
290
extern ModulinoColor RED;
0 commit comments