Pages: [1]   Go Down
Author Topic: No peek() with ATmega644?  (Read 1577 times)
0 Members and 1 Guest are viewing this topic.
Sweden
Offline Offline
Full Member
***
Karma: 11
Posts: 237
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6805
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

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

Sweden
Offline Offline
Full Member
***
Karma: 11
Posts: 237
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Sweden
Offline Offline
Full Member
***
Karma: 11
Posts: 237
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6805
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
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.)
Logged

USA
Offline Offline
Full Member
***
Karma: 2
Posts: 213
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Jump to: