Skip to content

Commit

Permalink
commit before merging
Browse files Browse the repository at this point in the history
still having compile errors with Button class
  • Loading branch information
mochoy committed Jun 25, 2017
1 parent 1b4fa17 commit b262014
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions SmartBlaster/SmartBlaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <Button.h>


SmartBlaster::SmartBlaster (bool modes[], uint8_t IOPins[], uint8_t magSizes[]) {
SmartBlaster::SmartBlaster (uint8_t modes[], uint8_t IOPins[], uint8_t magSizes[]) {
_lastVoltageCheckTime = 0;
_delayTime = 500;

Expand All @@ -24,7 +24,7 @@ SmartBlaster::SmartBlaster (bool modes[], uint8_t IOPins[], uint8_t magSizes[])
R1 = 100000.0;
R2 = 10000.0;

initModes(modes).initIOPins(IOPins).initButtons().initMagSizes();
initModes(modes).initIOPins(IOPins).initButtons().initMagSizes(magSizes);
}

SmartBlaster& SmartBlaster::initModes (uint8_t modes[]) {
Expand Down Expand Up @@ -58,26 +58,28 @@ SmartBlaster& SmartBlaster::initIOPins (uint8_t pins[]) {
SmartBlaster& SmartBlaster::initButtons (void) {
if (!_isIRGate) {
Button _ammoCountingButton(_AMMO_COUNTING_INPUT_PIN, false, false, 20);
} else {
_ammoCountingButton = null;
}
}
// else {
// _ammoCountingButton = NULL;
// }

Button _magInsertionDetectionButton(_MAG_INSERTION_DETECTION_PIN, false, false, 20);
Button _magSizeToggleButton(_MAG_SIZE_TOGGLE_INPUT_PIN, false, false, 20);


if (_isSelectFire) {
Button _selectFireToggleButton(_TOGGLE_SELECT_FIRE_INPUT_PIN, false, false, 20);
} else {
_selectFireToggleButton = null;
}
}
// else {
// _selectFireToggleButton = NULL;
// }


return *this;
}

SmartBlaster& SmartBlaster::initMagSizes(uint8_t magSizes[]) {
for (int i = 0; i < ((sizeof(magSizes)/sizeof(_magSizes[0])) - 1), i++) {
for (int i = 0; i < ((sizeof(magSizes)/sizeof(magSizes[0])) - 1); i++) {
_magSizeArr[i] = magSizes[i];
}
_currentMagSize = 0;
Expand Down
2 changes: 1 addition & 1 deletion SmartBlaster/SmartBlaster.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class SmartBlaster {
//methods
public:
//constructor
SmartBlaster(bool[], uint8_t[], uint8_t[]);
SmartBlaster(uint8_t[], uint8_t[], uint8_t[]);

//init stuff
SmartBlaster& initModes(uint8_t[]);
Expand Down

0 comments on commit b262014

Please sign in to comment.