[BUG] lcd telemetry, checkbox page

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

[BUG] lcd telemetry, checkbox page

Post by haydent »

the line number is calculated wrong starting at 0 when it should start at 1-4, causing missing line at end
not sure if my fix is best way to do it, but works in my case.
i just took formula from other pages for doing similar thing and it worked...
also i made it show if armed by stick

LCD.cpp
currently:

Code: Select all

    case 3: // checkboxes and modes
    case '3':
    {
      static uint8_t index = 0;
      index %= CHECKBOXITEMS;
      if (index == 0) linenr = 1;
      LCDsetLine((linenr++ + POSSIBLE_OFFSET)%CHECKBOXITEMS);
      LCDprintChar(checkboxitemNames[index]);
      //LCDprintChar((PGM_P)(boxnames[index]));
      LCDprint(' ');
      LCDprint( rcOptions[index] ? 'X' : '.');
      LCDcrlf();
      index++;
      break;
    }


i made it:

Code: Select all

    case 3: // checkboxes and modes
    case '3':
    {
      static uint8_t index = 0;     
      index = linenr++ % CHECKBOXITEMS;
     LCDsetLine((index - POSSIBLE_OFFSET)%CHECKBOXITEMS + 1);
     LCDprintChar(checkboxitemNames[index]);
     //LCDprintChar((PGM_P)(boxnames[index]));
      LCDprint(' ');
      if(index==0 && f.ARMED)LCDprint('X');
      else LCDprint( rcOptions[index] ? 'X' : '.');
      LCDcrlf();
      index++;     
      break;
    }

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: [BUG] lcd telemetry, checkbox page

Post by Hamburger »

Ok. Nedds more testing. Lcdsetline does indeed require linenr>=1

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: [BUG] lcd telemetry, checkbox page

Post by haydent »

what needs testing ? is there meant to be a stick command to switch pages and that is what you mean ? can test it or do i need to ?

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: [BUG] lcd telemetry, checkbox page

Post by Hamburger »

did you verify it worked for double font size (which introduces offset)?

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: [BUG] lcd telemetry, checkbox page

Post by haydent »

thats the only one i tested

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: [BUG] lcd telemetry, checkbox page

Post by Hamburger »

done in r1696

Post Reply