Skip to content

Commit

Permalink
DM: remove startup delay in neotrellis
Browse files Browse the repository at this point in the history
  • Loading branch information
deanm1278 committed Sep 19, 2018
1 parent 438c86e commit 0754c44
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 4 additions & 2 deletions Adafruit_NeoTrellis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ Adafruit_NeoTrellis::Adafruit_NeoTrellis(uint8_t addr) : pixels(NEO_TRELLIS_NUM_
bool Adafruit_NeoTrellis::begin(uint8_t addr, int8_t flow)
{
_addr = addr;
bool ret = Adafruit_seesaw::begin(addr, flow);

bool ret = pixels.begin(addr, flow);

ret = Adafruit_seesaw::begin(addr, flow, false);
if(!ret) return ret;

ret = pixels.begin(addr, flow);
enableKeypadInterrupt();

return ret;
Expand Down
10 changes: 6 additions & 4 deletions Adafruit_seesaw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,19 @@ Adafruit_seesaw::Adafruit_seesaw(TwoWire *i2c_bus)
*
* @return true if we could connect to the seesaw, false otherwise
****************************************************************************************/
bool Adafruit_seesaw::begin(uint8_t addr, int8_t flow)
bool Adafruit_seesaw::begin(uint8_t addr, int8_t flow, bool reset)
{
_i2caddr = addr;
_flow = flow;

if(_flow != -1) ::pinMode(_flow, INPUT);

_i2c_init();

SWReset();
delay(500);
if(reset){
SWReset();
delay(500);
}

uint8_t c = this->read8(SEESAW_STATUS_BASE, SEESAW_STATUS_HW_ID);
if (c != SEESAW_HW_ID_CODE) {
Expand Down
2 changes: 1 addition & 1 deletion Adafruit_seesaw.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class Adafruit_seesaw : public Print {
Adafruit_seesaw(TwoWire *Wi=NULL);
~Adafruit_seesaw(void) {};

bool begin(uint8_t addr = SEESAW_ADDRESS, int8_t flow=-1);
bool begin(uint8_t addr = SEESAW_ADDRESS, int8_t flow=-1, bool reset=false);
uint32_t getOptions();
uint32_t getVersion();
void SWReset();
Expand Down

0 comments on commit 0754c44

Please sign in to comment.