Преглед на файлове

Update Stream.cpp

teensy4-core
Frank преди 6 години
родител
ревизия
07df732e2b
No account linked to committer's email address
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. +2
    -2
      teensy3/Stream.cpp

+ 2
- 2
teensy3/Stream.cpp Целия файл

bool Stream::findUntil(const char *target, const char *terminator) bool Stream::findUntil(const char *target, const char *terminator)
{ {
if(target == NULL) return true; if(target == NULL) return true;
if(terminator == NULL) return true;
size_t tlen = (terminator==NULL)?0:strlen(terminator);
return findUntil(target, strlen(target), terminator, strlen(terminator)); return findUntil(target, strlen(target), terminator, strlen(terminator));
} }


int c; int c;
if( target == NULL) return true; if( target == NULL) return true;
if( *target == 0) return true; // return true if target is a null string if( *target == 0) return true; // return true if target is a null string
if(terminator == NULL) return true;
if (terminator == NULL) termLen = 0;


while( (c = timedRead()) > 0){ while( (c = timedRead()) > 0){
if( c == target[index]){ if( c == target[index]){

Loading…
Отказ
Запис