Skip to content

Commit ea04b03

Browse files
Merge pull request #10 from ajamtli/MatButtonFix
2 parents e6a6341 + 848603d commit ea04b03

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/internal/Buttons.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ namespace DcsBios {
114114
}
115115
}
116116

117+
void resetState() {
118+
lastState_ = (lastState_==0)?-1:0;
119+
}
120+
117121
public:
118122
//init now expects a message (the identifier you are trying to control), an argument ("TOGGLE") and an address to a storage variable
119123
MatActionButtonT(const char* msg, const char* arg, volatile unsigned char* argAddress) :
@@ -148,6 +152,10 @@ namespace DcsBios {
148152
}
149153
}
150154

155+
void resetState() {
156+
lastState_ = (lastState_==0)?-1:0;
157+
}
158+
151159
public:
152160
//init now expects a message (the identifier you are trying to control), an argument ("TOGGLE") and an address to a storage variable
153161
MatActionButtonToggleT(const char* msg, const char* arg, volatile unsigned char* argAddress) :
@@ -186,6 +194,10 @@ namespace DcsBios {
186194
}
187195
}
188196

197+
void resetState() {
198+
lastState_ = (lastState_==0)?-1:0;
199+
}
200+
189201
public:
190202
//init now expects row and column, as well as an array pointer, instead of a pin
191203
MatActionButtonSetT(const char* msg, volatile unsigned char* argAddress, char onLvlArg) :
@@ -197,7 +209,7 @@ namespace DcsBios {
197209
lastState_ = *address;
198210
}
199211
};
200-
typedef MatActionButtonToggleT<> MatActionButtonToggle;
212+
typedef MatActionButtonSetT<> MatActionButtonSet;
201213
}
202214

203215
#endif

0 commit comments

Comments
 (0)