No peek() with ATmega644?

Hello,

I got the compiler error for a sketch that peek() in class hardware serial was not defined. I looked into the core files of for the ATmega644 (non-P) from the Sanguino.cc webside and: There was no peek(). Is there a way to implement this? Or is there another way?

Jan

The versions of the Arduino libraries that was modified to support the 644 pre-dates the addition of Serial.peek()
It should be pretty easy to add, but I think the whole HardwareSerial support has been re-written at least once since then, so it won't quite be trivial.

This core may be more up-to-date...

http://www.avr-developers.com/corefiles/index.html

I haven't thought of using these core files (why; i don't know) but I used them instead.

So no the error with peek() is gone. The code uploades. But I can't see anything on the LCD connected?!

What's happening now?

Jan

Would it perhaps help if I copied the peek() function from the core files from avr-deverlopers into the sanguino core files?

I will try that tomorrow.

Jan

if I copied the peek() function from the core files from avr-deverlopers into the sanguino core files?

yes, it looks like that should work (it depends on how close the sanguino core is to the arduino core. It looks like sanguino has been updated to about v0018, which is AFTER the serial code re-write that I was worried about.)

The latest version of the arduino core files should compile and work on the 644. Thus you would then have the peek function.

I have done a lot of work to make the core files processor independent. For more information on this refer to

http://www.avr-developers.com/

Mark