Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Improvement to Stream.h

  1. #1
    Junior Member
    Join Date
    Apr 2014
    Posts
    6

    Improvement to Stream.h

    Hello Paul, All

    I would like to request that you add the line below (marked in bold) to Stream.h (@ line 35, ref to version 1.27 ) to make it more compatible with HardwareSerial.h

    Code:
    	...
    	virtual int peek() = 0;
    	virtual void flush() = 0;
    
    	virtual int availableForWrite() { return 0xFFFF; }
    
    	void setTimeout(unsigned long timeout);
    	bool find(char *target);
    	...

    I believe this will make it easier to pass an object of type HardwareSerial[1,2,3] as a Stream object.

    Thanks for your time,
    Gene

    ps, You and the teensy are (IMHO) amazing, please keep up the great work.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,171
    This is the sort of change that should be proposed upstream with Arduino.

    Adding it only on Teensy could lead to compatibility issues....

  3. #3
    Junior Member
    Join Date
    Apr 2014
    Posts
    6
    Ok, thanks for the quick reply..

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,171
    If you want to ask them to put this into Stream.h, here's the place to start the request....

    https://github.com/arduino/Arduino/issues/new

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •