LCD brightness adjustment in A720IS - page 2 - Feature Requests - CHDK Forum

LCD brightness adjustment in A720IS

  • 11 Replies
  • 8712 Views
*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: LCD brightness adjustment in A720IS
« Reply #10 on: 22 / October / 2008, 07:33:44 »
Advertisements
reviving this topic so it doesnt get lost in the archives, hopefully establishing a working feature in the trunk.
will experiment a bit, though i fear my asm skills are not good enough. but maybe someone else will help :)

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: LCD brightness adjustment in A720IS
« Reply #11 on: 22 / October / 2008, 08:12:49 »
ok, so essentially this is about dg_bright_setcurlcd in dgmod.c, right?

Code: (c) [Select]
void dg_bright_setcurlcd(int arg) {
// Changes the current brightness, does not change if brightness is already
// set to this value (for some reason, it cannot be changed after setting
// the already-set value)

short currentvalue;
short newvalue;
volatile short *addr = (volatile short *) 0xC0910080; // FIXME S5 only, make it a lib function somewhere

// Clean up first
if(dgconf_br_curlcd < 0) dgconf_br_curlcd = 0;
if(dgconf_br_curlcd > 0xFF) dgconf_br_curlcd = 0xFF;

if(dgconf_br_curlcd != 0) {
newvalue = ((dgconf_br_curlcd & 0xFF) << 8) | 0xFF;
} else {
newvalue = ((dgconf_br_curlcd & 0xFF) << 8);
}

currentvalue = *addr;
if(newvalue != currentvalue)
*addr = newvalue;

}

how to find out
Quote
   volatile short *addr = (volatile short *) 0xC0910080; // FIXME S5 only, make it a lib function somewhere
?

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal