From 245b948a276c37906c9f844e3bff13b1c5a9a2f5 Mon Sep 17 00:00:00 2001 From: Chris--A Date: Mon, 22 Jun 2015 18:58:28 +1000 Subject: [PATCH] Add Stream::find(char); to SAM core. This is a feature added to the AVR core here: https://github.com/arduino/Arduino/commit/ed1b8eb486d39b4227af6f950b3ef4b7ab515adb It allows using the find method with a single char (#847). --- hardware/arduino/sam/cores/arduino/Stream.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hardware/arduino/sam/cores/arduino/Stream.h b/hardware/arduino/sam/cores/arduino/Stream.h index 83e2e6e90..6abf0762d 100644 --- a/hardware/arduino/sam/cores/arduino/Stream.h +++ b/hardware/arduino/sam/cores/arduino/Stream.h @@ -73,6 +73,8 @@ class Stream : public Print bool find(uint8_t *target, size_t length) { return find ((char *)target, length); } // returns true if target string is found, false if timed out + bool find(char target) { return find (&target, 1); } + bool findUntil(char *target, char *terminator); // as find but search ends if the terminator string is found bool findUntil(uint8_t *target, char *terminator) { return findUntil((char *)target, terminator); }