Skip to content

Commit

Permalink
Merge pull request #13 from maidnl/removing_warnings
Browse files Browse the repository at this point in the history
Modulino:removed compilation warnings
  • Loading branch information
maidnl authored Oct 3, 2024
2 parents a61a491 + 47828b2 commit 485e3d2
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/Modulino.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ extern ModulinoClass Modulino;

class Module : public Printable {
public:
Module(uint8_t address = 0xFF, char* name = "")
: address(address), name(name) {}
Module(uint8_t address = 0xFF, const char* name = "")
: address(address), name((char *)name) {}
virtual ~Module() {}
bool begin() {
if (address == 0xFF) {
address = discover() / 2; // divide by 2 to match address in fw main.c
Expand Down Expand Up @@ -141,7 +142,7 @@ class ModulinoButtons : public Module {
return;
}
virtual uint8_t discover() {
for (int i = 0; i < sizeof(match)/sizeof(match[0]); i++) {
for (unsigned int i = 0; i < sizeof(match)/sizeof(match[0]); i++) {
if (scan(match[i])) {
return match[i];
}
Expand Down Expand Up @@ -170,7 +171,7 @@ class ModulinoBuzzer : public Module {
write(buf, 8);
}
virtual uint8_t discover() {
for (int i = 0; i < sizeof(match)/sizeof(match[0]); i++) {
for (unsigned int i = 0; i < sizeof(match)/sizeof(match[0]); i++) {
if (scan(match[i])) {
return match[i];
}
Expand Down Expand Up @@ -217,7 +218,7 @@ class ModulinoPixels : public Module {
write((uint8_t*)data, NUMLEDS * 4);
}
virtual uint8_t discover() {
for (int i = 0; i < sizeof(match)/sizeof(match[0]); i++) {
for (unsigned int i = 0; i < sizeof(match)/sizeof(match[0]); i++) {
if (scan(match[i])) {
return match[i];
}
Expand Down Expand Up @@ -274,7 +275,7 @@ class ModulinoKnob : public Module {
return _pressed;
}
virtual uint8_t discover() {
for (int i = 0; i < sizeof(match)/sizeof(match[0]); i++) {
for (unsigned int i = 0; i < sizeof(match)/sizeof(match[0]); i++) {
if (scan(match[i])) {
return match[i];
}
Expand Down Expand Up @@ -480,7 +481,7 @@ class ModulinoDistance : public Module {
if (api == nullptr) {
return false;
}
float ret = internal;

uint8_t NewDataReady = 0;
api->checkForDataReady(&NewDataReady);
if (NewDataReady) {
Expand All @@ -504,4 +505,4 @@ class ModulinoDistance : public Module {
//VL53L4ED_ResultsData_t results;
float internal = NAN;
_distance_api* api = nullptr;
};
};

0 comments on commit 485e3d2

Please sign in to comment.