Switch to full style
Libraries, utilities, bootloaders...
Post a reply

Settings.hex and the backlight

Thu Aug 07, 2014 3:20 am

It appears that Settings.hex has a bit of a bug, where both ambient light sensor menu options seem to alter the same setting. after changing both Min and Max ambient light settings, the 'max' setting stays at 680, and the 'min' is whatever I set either 'min' or 'max' to.

I'll see if I can poke a bit at the code and figure out why it's doing that.

Re: Settings.hex and the backlight

Thu Aug 07, 2014 9:35 am

You're right, I just took a look at the code and here is the bug:
Code:
    case 3: //ambient min
      while(1){
        if(gb.update()){
          gb.backlight.automatic = false;
          gb.backlight.set(backlightMax);
          if(changeValue(lightMin, 0, 1024, F("Min ambient light \n(when it's dark)\nassociated with\nmin backlight")))
            break;
          gb.display.print(F("\nCurrent ambient:"));
          gb.display.print(gb.backlight.ambientLight);
        }
      }
      gb.backlight.automatic = true;
      break;
    case 4: //ambient max
      while(1){
        if(gb.update()){
          gb.backlight.automatic = false;
          gb.backlight.set(backlightMin);
          if(changeValue(lightMin, 0, 1024, F("Max ambient light \n(when it's bright)\nassociated with\nmax backlight")))
            break;
          gb.display.print(F("\nCurrent ambient:"));
          gb.display.print(gb.backlight.ambientLight);
        }
      }


You can see it changes "lightMin" even when selecting "ambient max" (looks like a copy/past mistake :P). I'll correct that in the next update.

Re: Settings.hex and the backlight

Thu Aug 07, 2014 1:55 pm

Also it would be nice if the values went back to max from 0... sometimes I am trying to set the max and then go past it to 0. It sucks having to wait to hit high values again!

Re: Settings.hex and the backlight

Thu Aug 07, 2014 9:05 pm

treflip wrote:Also it would be nice if the values went back to max from 0... sometimes I am trying to set the max and then go past it to 0. It sucks having to wait to hit high values again!


Also, I second that, Treflip.

Thanks Rodot! Proves to me I wasn't just unsure how it was supposed to work.

Re: Settings.hex and the backlight

Thu Aug 07, 2014 10:42 pm

I agree, that how it was supposed to work, I simply forgot to correct that but. I'll give it a look.

Re: Settings.hex and the backlight

Fri Aug 08, 2014 10:22 am

It was because the variables were unsigned, bug solved. It'll be in the next commit.
Edit: it's now online on github

Re: Settings.hex and the backlight

Sat Aug 09, 2014 9:43 pm

rodot wrote:It was because the variables were unsigned, bug solved. It'll be in the next commit.
Edit: it's now online on github


Awesome! Thanks. I'll test it in a bit, though I noticed the current one likes to reset settings every time SETTINGS.HEX is loaded. Is that intentional behavior?

Re: Settings.hex and the backlight

Sat Aug 09, 2014 10:32 pm

SETTING.HEX automatically restores the default settings and save them on start-up when there is no settings detected.
Did you load another game in between for your settings to be erased? Did you do it over USB, or from the micro SD card?

Re: Settings.hex and the backlight

Sun Aug 10, 2014 7:40 am

rodot wrote:SETTING.HEX automatically restores the default settings and save them on start-up when there is no settings detected.
Did you load another game in between for your settings to be erased? Did you do it over USB, or from the micro SD card?


The version that you just uploaded seems to have fixed that problem. I'd tried it off of both USB and SD before. Huh! Working now!

Re: Settings.hex and the backlight

Sun Aug 10, 2014 1:06 pm

Yes, Thanks Rodot! That is much more usable for me to be able to flip around is very convenient. Thank you!!!
Post a reply