Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #159 from arntsonl/hotfix_issue#157
Browse files Browse the repository at this point in the history
Fixing the storage issue for Add-on save.
  • Loading branch information
arntsonl authored Nov 22, 2022
2 parents 1cdc453 + f161d98 commit 89b8c67
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions include/storagemanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ struct BoardOptions
ButtonLayoutRight buttonLayoutRight;
SplashMode splashMode;
SplashChoice splashChoice;
int i2cSDAPin;
int i2cSCLPin;
uint8_t i2cSDAPin;
uint8_t i2cSCLPin;
int i2cBlock;
uint32_t i2cSpeed;
bool hasI2CDisplay;
Expand All @@ -66,8 +66,8 @@ struct BoardOptions
uint8_t reverseActionDown;
uint8_t reverseActionLeft;
uint8_t reverseActionRight;
int i2cAnalog1219SDAPin;
int i2cAnalog1219SCLPin;
uint8_t i2cAnalog1219SDAPin;
uint8_t i2cAnalog1219SCLPin;
int i2cAnalog1219Block;
uint32_t i2cAnalog1219Speed;
uint8_t i2cAnalog1219Address;
Expand Down
4 changes: 2 additions & 2 deletions src/addons/i2canalog1219.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

bool I2CAnalog1219Input::available() {
BoardOptions boardOptions = Storage::getInstance().getBoardOptions();
return (boardOptions.i2cAnalog1219SDAPin != -1 &&
boardOptions.i2cAnalog1219SCLPin != -1);
return (boardOptions.i2cAnalog1219SDAPin != (uint8_t)-1 &&
boardOptions.i2cAnalog1219SCLPin != (uint8_t)-1);
}

void I2CAnalog1219Input::setup() {
Expand Down
4 changes: 3 additions & 1 deletion src/addons/i2cdisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

bool I2CDisplayAddon::available() {
BoardOptions boardOptions = Storage::getInstance().getBoardOptions();
return boardOptions.hasI2CDisplay && boardOptions.i2cSDAPin != -1 && boardOptions.i2cSCLPin != -1;
return boardOptions.hasI2CDisplay &&
boardOptions.i2cSDAPin != (uint8_t)-1 &&
boardOptions.i2cSCLPin != (uint8_t)-1;
}

void I2CDisplayAddon::setup() {
Expand Down

0 comments on commit 89b8c67

Please sign in to comment.