Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Commit

Permalink
Update Packages_Patches
Browse files Browse the repository at this point in the history
  • Loading branch information
khoih-prog authored Nov 24, 2022
1 parent 10ac22b commit 87619ea
Show file tree
Hide file tree
Showing 6 changed files with 162 additions and 168 deletions.
38 changes: 18 additions & 20 deletions Packages_Patches/hardware/teensy/avr/cores/teensy/Stream.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*
Stream.cpp - adds parsing methods to Stream class
Copyright (c) 2008 David A. Mellis. All right reserved.
Stream.cpp - adds parsing methods to Stream class
Copyright (c) 2008 David A. Mellis. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Created July 2011
parsing functions based on TextFinder library by Michael Margolis
*/
Created July 2011
parsing functions based on TextFinder library by Michael Margolis
*/

#include <Arduino.h>

Expand Down Expand Up @@ -201,8 +201,7 @@ long Stream::parseInt(char skipChar)

read(); // consume the character we got with peek
c = timedPeek();
}
while ( (c >= '0' && c <= '9') || c == skipChar );
} while ( (c >= '0' && c <= '9') || c == skipChar );

if (isNegative)
value = -value;
Expand Down Expand Up @@ -252,8 +251,7 @@ float Stream::parseFloat(char skipChar)

read(); // consume the character we got with peek
c = timedPeek();
}
while ( (c >= '0' && c <= '9') || c == '.' || c == skipChar );
} while ( (c >= '0' && c <= '9') || c == '.' || c == skipChar );

if (isNegative)
value = -value;
Expand Down
72 changes: 36 additions & 36 deletions Packages_Patches/hardware/teensy/avr/cores/teensy/Stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,78 +33,78 @@ class Stream : public Print

void setTimeout(unsigned long timeout);
bool find(const char *target);
bool find(const uint8_t *target)

bool find(const uint8_t *target)
{
return find ((const char *)target);
}
bool find(const String &target)

bool find(const String &target)
{
return find(target.c_str());
}

bool find(const char *target, size_t length);
bool find(const uint8_t *target, size_t length)

bool find(const uint8_t *target, size_t length)
{
return find ((const char *)target, length);
}
bool find(const String &target, size_t length)

bool find(const String &target, size_t length)
{
return find(target.c_str(), length);
}

bool findUntil(const char *target, const char *terminator);
bool findUntil(const uint8_t *target, const char *terminator)

bool findUntil(const uint8_t *target, const char *terminator)
{
return findUntil((const char *)target, terminator);
}
bool findUntil(const String &target, const char *terminator)

bool findUntil(const String &target, const char *terminator)
{
return findUntil(target.c_str(), terminator);
}
bool findUntil(const char *target, const String &terminator)

bool findUntil(const char *target, const String &terminator)
{
return findUntil(target, terminator.c_str());
}
bool findUntil(const String &target, const String &terminator)

bool findUntil(const String &target, const String &terminator)
{
return findUntil(target.c_str(), terminator.c_str());
}

bool findUntil(const char *target, size_t targetLen, const char *terminate, size_t termLen);
bool findUntil(const uint8_t *target, size_t targetLen, const char *terminate, size_t termLen)

bool findUntil(const uint8_t *target, size_t targetLen, const char *terminate, size_t termLen)
{
return findUntil((const char *)target, targetLen, terminate, termLen);
}

bool findUntil(const String &target, size_t targetLen, const char *terminate, size_t termLen);
bool findUntil(const char *target, size_t targetLen, const String &terminate, size_t termLen);
bool findUntil(const String &target, size_t targetLen, const String &terminate, size_t termLen);

long parseInt();
long parseInt(char skipChar);

float parseFloat();
float parseFloat(char skipChar);

size_t readBytes(char *buffer, size_t length);
size_t readBytes(uint8_t *buffer, size_t length)

size_t readBytes(uint8_t *buffer, size_t length)
{
return readBytes((char *)buffer, length);
}

size_t readBytesUntil(char terminator, char *buffer, size_t length);
size_t readBytesUntil(char terminator, uint8_t *buffer, size_t length)

size_t readBytesUntil(char terminator, uint8_t *buffer, size_t length)
{
return readBytesUntil(terminator, (char *)buffer, length);
}
Expand All @@ -117,22 +117,22 @@ class Stream : public Print
char* readCharsUntil(char terminator, size_t max = 512);
////////////////////////////////////////////////////////////

int getReadError()
int getReadError()
{
return read_error;
}
void clearReadError()

void clearReadError()
{
setReadError(0);
}

protected:
void setReadError(int err = 1)
void setReadError(int err = 1)
{
read_error = err;
}

unsigned long _timeout;

// KH
Expand Down
38 changes: 18 additions & 20 deletions Packages_Patches/hardware/teensy/avr/cores/teensy3/Stream.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*
Stream.cpp - adds parsing methods to Stream class
Copyright (c) 2008 David A. Mellis. All right reserved.
Stream.cpp - adds parsing methods to Stream class
Copyright (c) 2008 David A. Mellis. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Created July 2011
parsing functions based on TextFinder library by Michael Margolis
*/
Created July 2011
parsing functions based on TextFinder library by Michael Margolis
*/

#include <Arduino.h>

Expand Down Expand Up @@ -201,8 +201,7 @@ long Stream::parseInt(char skipChar)

read(); // consume the character we got with peek
c = timedPeek();
}
while ( (c >= '0' && c <= '9') || c == skipChar );
} while ( (c >= '0' && c <= '9') || c == skipChar );

if (isNegative)
value = -value;
Expand Down Expand Up @@ -252,8 +251,7 @@ float Stream::parseFloat(char skipChar)

read(); // consume the character we got with peek
c = timedPeek();
}
while ( (c >= '0' && c <= '9') || c == '.' || c == skipChar );
} while ( (c >= '0' && c <= '9') || c == '.' || c == skipChar );

if (isNegative)
value = -value;
Expand Down
72 changes: 36 additions & 36 deletions Packages_Patches/hardware/teensy/avr/cores/teensy3/Stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,78 +33,78 @@ class Stream : public Print

void setTimeout(unsigned long timeout);
bool find(const char *target);
bool find(const uint8_t *target)

bool find(const uint8_t *target)
{
return find ((const char *)target);
}
bool find(const String &target)

bool find(const String &target)
{
return find(target.c_str());
}

bool find(const char *target, size_t length);
bool find(const uint8_t *target, size_t length)

bool find(const uint8_t *target, size_t length)
{
return find ((const char *)target, length);
}
bool find(const String &target, size_t length)

bool find(const String &target, size_t length)
{
return find(target.c_str(), length);
}

bool findUntil(const char *target, const char *terminator);
bool findUntil(const uint8_t *target, const char *terminator)

bool findUntil(const uint8_t *target, const char *terminator)
{
return findUntil((const char *)target, terminator);
}
bool findUntil(const String &target, const char *terminator)

bool findUntil(const String &target, const char *terminator)
{
return findUntil(target.c_str(), terminator);
}
bool findUntil(const char *target, const String &terminator)

bool findUntil(const char *target, const String &terminator)
{
return findUntil(target, terminator.c_str());
}
bool findUntil(const String &target, const String &terminator)

bool findUntil(const String &target, const String &terminator)
{
return findUntil(target.c_str(), terminator.c_str());
}

bool findUntil(const char *target, size_t targetLen, const char *terminate, size_t termLen);
bool findUntil(const uint8_t *target, size_t targetLen, const char *terminate, size_t termLen)

bool findUntil(const uint8_t *target, size_t targetLen, const char *terminate, size_t termLen)
{
return findUntil((const char *)target, targetLen, terminate, termLen);
}

bool findUntil(const String &target, size_t targetLen, const char *terminate, size_t termLen);
bool findUntil(const char *target, size_t targetLen, const String &terminate, size_t termLen);
bool findUntil(const String &target, size_t targetLen, const String &terminate, size_t termLen);

long parseInt();
long parseInt(char skipChar);

float parseFloat();
float parseFloat(char skipChar);

size_t readBytes(char *buffer, size_t length);
size_t readBytes(uint8_t *buffer, size_t length)

size_t readBytes(uint8_t *buffer, size_t length)
{
return readBytes((char *)buffer, length);
}

size_t readBytesUntil(char terminator, char *buffer, size_t length);
size_t readBytesUntil(char terminator, uint8_t *buffer, size_t length)

size_t readBytesUntil(char terminator, uint8_t *buffer, size_t length)
{
return readBytesUntil(terminator, (char *)buffer, length);
}
Expand All @@ -117,22 +117,22 @@ class Stream : public Print
char* readCharsUntil(char terminator, size_t max = 512);
////////////////////////////////////////////////////////////

int getReadError()
int getReadError()
{
return read_error;
}
void clearReadError()

void clearReadError()
{
setReadError(0);
}

protected:
void setReadError(int err = 1)
void setReadError(int err = 1)
{
read_error = err;
}

unsigned long _timeout;

// KH
Expand Down
Loading

0 comments on commit 87619ea

Please sign in to comment.