@@ -46,8 +46,9 @@ extern ModulinoClass Modulino;
46
46
47
47
class Module : public Printable {
48
48
public:
49
- Module (uint8_t address = 0xFF , char * name = " " )
50
- : address(address), name(name) {}
49
+ Module (uint8_t address = 0xFF , const char * name = " " )
50
+ : address(address), name((char *)name) {}
51
+ virtual ~Module () {}
51
52
bool begin () {
52
53
if (address == 0xFF ) {
53
54
address = discover () / 2 ; // divide by 2 to match address in fw main.c
@@ -141,7 +142,7 @@ class ModulinoButtons : public Module {
141
142
return ;
142
143
}
143
144
virtual uint8_t discover () {
144
- for (int i = 0 ; i < sizeof (match)/sizeof (match[0 ]); i++) {
145
+ for (unsigned int i = 0 ; i < sizeof (match)/sizeof (match[0 ]); i++) {
145
146
if (scan (match[i])) {
146
147
return match[i];
147
148
}
@@ -170,7 +171,7 @@ class ModulinoBuzzer : public Module {
170
171
write (buf, 8 );
171
172
}
172
173
virtual uint8_t discover () {
173
- for (int i = 0 ; i < sizeof (match)/sizeof (match[0 ]); i++) {
174
+ for (unsigned int i = 0 ; i < sizeof (match)/sizeof (match[0 ]); i++) {
174
175
if (scan (match[i])) {
175
176
return match[i];
176
177
}
@@ -217,7 +218,7 @@ class ModulinoPixels : public Module {
217
218
write ((uint8_t *)data, NUMLEDS * 4 );
218
219
}
219
220
virtual uint8_t discover () {
220
- for (int i = 0 ; i < sizeof (match)/sizeof (match[0 ]); i++) {
221
+ for (unsigned int i = 0 ; i < sizeof (match)/sizeof (match[0 ]); i++) {
221
222
if (scan (match[i])) {
222
223
return match[i];
223
224
}
@@ -274,7 +275,7 @@ class ModulinoKnob : public Module {
274
275
return _pressed;
275
276
}
276
277
virtual uint8_t discover () {
277
- for (int i = 0 ; i < sizeof (match)/sizeof (match[0 ]); i++) {
278
+ for (unsigned int i = 0 ; i < sizeof (match)/sizeof (match[0 ]); i++) {
278
279
if (scan (match[i])) {
279
280
return match[i];
280
281
}
@@ -480,7 +481,7 @@ class ModulinoDistance : public Module {
480
481
if (api == nullptr ) {
481
482
return false ;
482
483
}
483
- float ret = internal;
484
+
484
485
uint8_t NewDataReady = 0 ;
485
486
api->checkForDataReady (&NewDataReady);
486
487
if (NewDataReady) {
@@ -504,4 +505,4 @@ class ModulinoDistance : public Module {
504
505
// VL53L4ED_ResultsData_t results;
505
506
float internal = NAN;
506
507
_distance_api* api = nullptr ;
507
- };
508
+ };
0 commit comments