Changeset 679 for trunk/core/luascript.c


Ignore:
Timestamp:
01/15/09 21:57:34 (4 years ago)
Author:
phyrephox
Message:

+ added two small functions... TurnOnBackLight? & TurnOffBackLight?, which turn on and off the LCD Backlight (or EVF backlight) - useful for energy saving or camouflage missions :D
also added ubasic and lua commands: set_backlight(x), whereas 0 disables Backlight and 1 enables it. mind you, after a shot the display is turned on again (probably loop set_backlight_statement(0) in script!?).
an example script can be found here: http://chdk.setepontos.com/index.php/topic,2744.msg27703.html#msg27703
todo: PERHAPS make it that you can disable (automatically after a given time?) LCD directly in CHDK, also on todo list: Dimming the light

thx to fudgey, ewavr & Dataghost, who made that happen \o/ (see https://chdk.kernreaktor.org/mantis/view.php?id=65 for links)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/luascript.c

    r607 r679  
    847847{ 
    848848  raw_merge_end(); 
     849  return 0; 
     850} 
     851 
     852// Enable/disable LCD back light (input argument 1/0) 
     853static int luaCB_set_backlight( lua_State* L ) 
     854{ 
     855  int val = (luaL_checknumber(L,1)); 
     856 
     857  if (val > 0) TurnOnBackLight(); 
     858  else TurnOffBackLight(); 
    849859  return 0; 
    850860} 
     
    984994  FUNC(raw_merge_add_file); 
    985995  FUNC(raw_merge_end); 
    986 } 
     996  FUNC(set_backlight); 
     997} 
Note: See TracChangeset for help on using the changeset viewer.