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 » Sat Nov 16, 2013 10:30 am

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: 16999
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: String Length in lcd.cpp

Post by MikeB » Sat Nov 16, 2013 11:24 am

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 » Sat Nov 16, 2013 11:27 am

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: 10606
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: String Length in lcd.cpp

Post by Kilrah » Sat Nov 16, 2013 12:55 pm

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 » Sat Nov 16, 2013 2:15 pm

Thanks for your hint.


Post Reply

Return to “openTx for FrSky radios”