manufacturing

This commit is contained in:
2021-02-18 19:54:08 +01:00
parent d36d67bd2c
commit f96d466f25
47 changed files with 14869 additions and 26 deletions

View File

@@ -3,9 +3,7 @@
#include "Arduino.h"
#include <vector>
#ifndef UNIT_TEST
#include "JC_Button.h"
#endif
#include "JC_Button.h"
#include "board.h"
#include "led.h"

View File

@@ -60,7 +60,7 @@ void HandleChainGame(void)
else if (anybutton())
{
// if any other button is pressed, clear cheat button
cheatbutton = 0;
//cheatbutton = 0;
}
}

View File

@@ -30,7 +30,8 @@ void handleDetectLed(void)
void initDetectLed(void)
{
ledlist_ptr = getledlist();
#ifndef UNIT_TEST
analogReadResolution(10);
#endif
}

18
src/game.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef GAMEH
#define GAMEH
class c_game
{
protected:
bool _status;
public:
c_game(void): _status(false) {};
void runGame(void);
void initGame(void);
bool getStatus(void) { return _status;}
};
#endif //GAMEH

View File

@@ -175,8 +175,10 @@ bool c_leds::verifyLed(uint16_t index)
void c_ledport::begin(void)
{
#ifndef UNIT_TEST
pinMode(_pin, OUTPUT);
pinMode(_analogPin, INPUT_ANALOG);
#endif
turnOff();
}

View File

@@ -36,6 +36,8 @@ public:
void writeLed(bool state);
bool getLedState( void ) {return _state; }
uint16_t ledRead(void);
uint16_t getIndex(void) { return _index; }

View File

@@ -1,7 +1,6 @@
#ifndef UNIT_TEST
#include "Arduino.h"
#include "board.h"
#include "chainGame.h"
#include "detectled.h"
@@ -192,3 +191,5 @@ void loop()
break;
}
}
#endif

View File

@@ -1,6 +1,18 @@
#include "simpleled.h"
void c_simpleLed::runGame(void)
{
handleSimpleLed();
}
void c_simpleLed::initGame(void)
{
initSimpleLed();
_status = true;
}
extern std::vector<c_button *> buttonlist;
bool status = false;
@@ -23,4 +35,9 @@ void handleSimpleLed(void)
turnOffLed(button->getIndex());
}
}
}
bool getStatusSimpleLed( void )
{
return status;
}

View File

@@ -4,9 +4,18 @@
#include "led.h"
#include "buttons.h"
#include "vector"
#include "game.h"
class c_simpleLed : public c_game
{
void runGame(void);
void initGame(void);
};
void initSimpleLed( void );
void handleSimpleLed( void );
bool getStatusSimpleLed( void );
#endif //SIMPLELEDH