String Length in lcd.cpp

Post Reply
sandmen
Posts: 7
Joined: Mon Apr 09, 2012 9:07 am
Country: -

String Length in lcd.cpp

Post 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

User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: String Length in lcd.cpp

Post 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.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
sandmen
Posts: 7
Joined: Mon Apr 09, 2012 9:07 am
Country: -

Re: String Length in lcd.cpp

Post 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.
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: String Length in lcd.cpp

Post 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 :)
sandmen
Posts: 7
Joined: Mon Apr 09, 2012 9:07 am
Country: -

Re: String Length in lcd.cpp

Post by sandmen »

Thanks for your hint.

Post Reply

Return to “openTx for FrSky radios”