Skip to content

Commit

Permalink
- Fix symbols not getting updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushsharma82 committed Sep 14, 2023
1 parent 4b56797 commit 79cb805
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"maintainer": true
}
],
"version": "4.0.1",
"version": "4.0.2",
"frameworks": "arduino",
"platforms": "espressif",
"dependencies":
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ESP-DASH
version=4.0.1
version=4.0.2
author=Ayush Sharma
category=Communication
maintainer=Ayush Sharma <[email protected]>
Expand Down
16 changes: 9 additions & 7 deletions src/Card.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ void Card::update(int value, const char* symbol){
}
/* Store new value */
_value_type = Card::INTEGER;
_symbol = symbol;
if(_value_i != value)
if(strcmp(_symbol.c_str(), symbol) != 0 || _value_i != value)
_changed = true;
_value_i = value;
_symbol = symbol;
}

void Card::update(int value){
Expand All @@ -61,10 +61,10 @@ void Card::update(float value, const char* symbol){
}
/* Store new value */
_value_type = Card::FLOAT;
_symbol = symbol;
if(_value_f != value)
if(strcmp(_symbol.c_str(), symbol) != 0 || _value_f != value)
_changed = true;
_value_f = value;
_symbol = symbol;
}

void Card::update(float value){
Expand Down Expand Up @@ -92,7 +92,9 @@ void Card::update(const char* value, const char* symbol){
if(strcmp(_value_s.c_str(), value) != 0)
_changed = true;
}

if (strcmp(_symbol.c_str(), symbol) != 0) {
_changed = true;
}
_value_type = Card::STRING;
_symbol = symbol;
_value_s = value;
Expand All @@ -115,10 +117,10 @@ void Card::update(bool value, const char* symbol){
}
/* Store new value */
_value_type = Card::INTEGER;
_symbol = symbol;
if(_value_i != value)
if(strcmp(_symbol.c_str(), symbol) != 0 || _value_i != value)
_changed = true;
_value_i = value;
_symbol = symbol;
}

void Card::update(bool value){
Expand Down

0 comments on commit 79cb805

Please sign in to comment.