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?
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.
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.)