Skip to content

Commit

Permalink
Update to version 3
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev committed May 23, 2021
1 parent 43e4848 commit 4777a56
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 6 deletions.
18 changes: 16 additions & 2 deletions HyperSerialEsp8266.ino
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ uint16_t stat_good = 0;
uint16_t stat_frames = 0;
uint16_t stat_final_good = 0;
uint16_t stat_final_frames = 0;
bool wantShow = false;

void ShowMe()
{
if (wantShow = true && strip->CanShow())
{
stat_good++;;
wantShow = false;
strip->Show();
}
}

void readSerialData()
{
Expand Down Expand Up @@ -110,6 +121,9 @@ void readSerialData()
Serial.write("\r\n-------------------------\r\n");
}

if (state == AwaProtocol::HEADER_A)
ShowMe();

while (bufferPointer < internalIndex)
{
byte input = buffer[bufferPointer++];
Expand Down Expand Up @@ -209,8 +223,8 @@ void readSerialData()
case AwaProtocol::FLETCHER2:
if (input == fletcher2)
{
stat_good++;;
strip->Show();
wantShow = true;
ShowMe();
}
state = AwaProtocol::HEADER_A;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ uint16_t stat_good = 0;
uint16_t stat_frames = 0;
uint16_t stat_final_good = 0;
uint16_t stat_final_frames = 0;
bool wantShow = false;

void ShowMe()
{
if (wantShow = true && strip->CanShow())
{
stat_good++;;
wantShow = false;
strip->Show();
}
}

void readSerialData()
{
Expand Down Expand Up @@ -110,6 +121,9 @@ void readSerialData()
Serial.write("\r\n-------------------------\r\n");
}

if (state == AwaProtocol::HEADER_A)
ShowMe();

while (bufferPointer < internalIndex)
{
byte input = buffer[bufferPointer++];
Expand Down Expand Up @@ -209,8 +223,8 @@ void readSerialData()
case AwaProtocol::FLETCHER2:
if (input == fletcher2)
{
stat_good++;;
strip->Show();
wantShow = true;
ShowMe();
}
state = AwaProtocol::HEADER_A;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ uint16_t stat_good = 0;
uint16_t stat_frames = 0;
uint16_t stat_final_good = 0;
uint16_t stat_final_frames = 0;
bool wantShow = false;

void ShowMe()
{
if (wantShow = true && strip->CanShow())
{
stat_good++;;
wantShow = false;
strip->Show();
}
}

void readSerialData()
{
Expand Down Expand Up @@ -109,6 +120,9 @@ void readSerialData()
Serial.write("\r\n-------------------------\r\n");
}

if (state == AwaProtocol::HEADER_A)
ShowMe();

while (bufferPointer < internalIndex)
{
byte input = buffer[bufferPointer++];
Expand Down Expand Up @@ -208,8 +222,8 @@ void readSerialData()
case AwaProtocol::FLETCHER2:
if (input == fletcher2)
{
stat_good++;;
strip->Show();
wantShow = true;
ShowMe();
}
state = AwaProtocol::HEADER_A;
break;
Expand Down

0 comments on commit 4777a56

Please sign in to comment.