diff --git a/src/gtests.cpp b/src/gtests.cpp index c90db4341..936af4471 100644 --- a/src/gtests.cpp +++ b/src/gtests.cpp @@ -257,8 +257,17 @@ TEST(getSwitch, nullSW) { EXPECT_EQ(getSwitch(0, 0), false); } +TEST(phases, nullFadeOut_posFadeIn) { + memset(&g_model, 0, sizeof(g_model)); + g_model.phaseData[1].swtch = DSW_ID1; + g_model.phaseData[1].fadeIn = 15; + perMain(); + setSwitch(DSW_ID1); + perMain(); +} + int main(int argc, char **argv) { - InitEepromThread(); + StartEepromThread(NULL); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/src/simpgmspace.cpp b/src/simpgmspace.cpp index 6241e8a86..f4c2f1800 100644 --- a/src/simpgmspace.cpp +++ b/src/simpgmspace.cpp @@ -27,8 +27,8 @@ #include "gruvin9x.h" #include "menus.h" -volatile uint8_t pinb=0, pinc=0xff, pind, pine=0xff, ping=0xff, pinj=0xff, pinl=0; -uint8_t portb, dummyport; +volatile uint8_t pinb=0, pinc=0xff, pind, pine=0xff, ping=0xff, pinh=0xff, pinj=0xff, pinl=0; +uint8_t portb, portc, dummyport; uint16_t dummyport16; const char *eepromFile; @@ -37,6 +37,22 @@ extern const char* eeprom_buffer_data; uint8_t eeprom[EESIZE]; sem_t eeprom_write_sem; +void setSwitch(int8_t swtch) +{ + switch (swtch) { + case DSW_ID0: + ping |= (1<