Teensy and SerialUI library

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)'

http://flyingcarsandstuff.com/projects/SerialUI/

Also sending email to SerialUI developer with link to this post.
 
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.
 

Attachments

  • Print.h
    5.8 KB · Views: 296
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.
 

Attachments

  • pgmspace.h
    1.5 KB · Views: 204
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 :)
 
I am late to this party, but have been tinkering with a Teensy 4.0 and hoping to include a Teensy 4.1 in a future project. Based on what I can find, there is not a more powerful little board out there, and while I don't need all that power now, I like the idea of having lots of headroom. I'd like to use SerialUI and DeviceDruid with both Teensy 4.0 and Teensy4.1 (in the future), but I am encountering some initial compilation errors related to Teensy 4.0 compatibility with SerialUI. My environment is intact -- I have compiled and uploaded the BasicUI and Graphin examples provided for SerialUI to an Arduino Pro Mini, and they function. With Teensy4.0, the platform is not recognized:

...\documents\arduino\libraries\serialui-3\src\includes\SerialUIPlatform.h:45:2: warning: #warning "SERIALUI FAIL: Could not detect platform?" [-Wcpp]
#warning "SERIALUI FAIL: Could not detect platform?"

I hope Teensy 4.0 is similar enough to another platform that it can be made to work. Any advice?
 
Back
Top