View Full Version : Teensy and SerialUI library

09-22-2013, 06:53 AM
Posting this here as initial investigations seem to show this might be Teensy library issue.

Using the example code for SerialUI works OK until compiled using any Teensy board. The error is different for Teensy3 and earlier versions.

Teensy3 error:
/home/spanner888/Documents/sKETCHES/libraries/SerialUI/SerialUI.cpp: In member function 'size_t SUI::SerialUI::print_P(const char*)':
/home/spanner888/Documents/sKETCHES/libraries/SerialUI/SerialUI.cpp:301:69: error: 'strncpy_P' was not declared in this scope
/home/spanner888/Documents/sKETCHES/libraries/SerialUI/SerialUI.cpp: In member function 'size_t SUI::SerialUI::println_P(const char*)':
/home/spanner888/Documents/sKETCHES/libraries/SerialUI/SerialUI.cpp:310:69: error: 'strncpy_P' was not declared in this scope

other Teensy's error:

SuperBlinker.cpp.o: In function `setup':
/home/spanner888/Documents/sKETCHES/libraries/SerialUI/includes/SUIPlat_ArduinoSerial.h:61: undefined reference to `Print::write(unsigned char)'


Also sending email to SerialUI developer with link to this post.

09-22-2013, 06:16 PM
Looks like the problem on Teensy 2.0 is due to not having Print::write(unsigned char) declared as a pure virtual. This is the first library where it's ever really mattered.

Here's a fixed Print.h. This goes into hardware/teensy/cores/teensy. I'll publish this fix in Teensyduino 1.17.

09-22-2013, 06:26 PM
On Teensy3, the problem seems to be missing definitions for AVR-specific strncmp_P and strncpy_P.

I've added them to pgmspace.h. This file goes into hardware/teensy/cores/teensy/avr. I'll also publish this fix in Teensyduino 1.17.

09-23-2013, 03:58 AM
Thanks for the fix it works!

Thanks also for the really fast response.

I have seen many other examples of your excellent and fast work on this site - you really are doing a fantastic job and the Teensy's are a really great board.

thanks :)