Page 1 of 1

String Length in lcd.cpp

Posted: Sat Nov 16, 2013 10:30 am
by sandmen
Hi,
I'm not 100% sure, but in the lcd_putsnAtt length of str is "only" a uint8_t !
So, for example the string in Telemetry view (TR_VTELEMCHNS) is already too long.
At the moment, openTX didn't show the last 2 "channels" ACC & TIME.
Did you plan to work on that topic :-)
I want to add some Telemetry txt's, and I saw this problem.

by

Re: String Length in lcd.cpp

Posted: Sat Nov 16, 2013 11:24 am
by MikeB
The length is for the number of characters to actually put on the display, you can only get around 35 on a single line of the Taranis display, 21 on the 9X display.
TR_VTELEMCHNS is a list where just some characters are actually displayed.

Mike.

Re: String Length in lcd.cpp

Posted: Sat Nov 16, 2013 11:27 am
by sandmen
Ok, sorry. I misunderstand it.
But if I append some char's on the end of TR_VTELEMCHNS, I didn't get the correct chars.
Also the ACC & TIME, last 2 in this string, are not displayed.
Or, there is something wrong in the function, where the selection line is filled with text.

Re: String Length in lcd.cpp

Posted: Sat Nov 16, 2013 12:55 pm
by Kilrah
In myeeprom.h is an enum TelemetrySource that needs to list all items and set TELEM_DISPLAY_MAX as the last item in the list.

Acc and Time are only available as the first item of the last line of a given custom screen (see model_menu.cpp:5582 and TELEM_STATUS_MAX definition), because they take the entire bottom line.

So if you want to add stuff, you'd likely want to do it before Acc and Time. Note that obviously compatibility with C9X and other radios running normal firmware will be broken (unless you add it to C9X too).
We have an open issue to add a few things: http://code.google.com/p/opentx/issues/detail?id=89
You're welcome to contribute :)

Re: String Length in lcd.cpp

Posted: Sat Nov 16, 2013 2:15 pm
by sandmen
Thanks for your hint.