root/platform/ixus1000_sd4500/lib.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. vid_bitmap_refresh
  2. shutdown
  3. debug_led
  4. camera_set_led
  5. get_flash_params_count
  6. JogDial_CW
  7. JogDial_CCW
  8. _get_nd_value
  9. _get_current_nd_value

   1 #include "platform.h"
   2 #include "lolevel.h"
   3 
   4 /*
   5 void vid_bitmap_refresh() //ASM1989
   6 {
   7  extern int enabled_refresh_physical_screen;
   8  enabled_refresh_physical_screen=1;
   9  *(int*)0x9D08=3;//this is set somewhere in a function called by RefreshPhysicalScreen, should be easy to find
  10  _RefreshPhysicalScreen(1);
  11 }
  12 
  13 */
  14 /*
  15 void shooting_set_iso_real(short iso, short is_now)
  16 {
  17     long iso2=iso;
  18 if ((mode_get()&MODE_MASK) != MODE_PLAY){
  19         if (iso>0){ _SetPropertyCase(PROPCASE_ISO_MODE, &iso2, sizeof(iso2));
  20         //_SetPropertyCase(PROPCASE_SV_MARKET, &iso2, sizeof(iso2));
  21     }
  22 }
  23 }
  24 */
  25 
  26 void vid_bitmap_refresh()
  27 {
  28         extern int enabled_refresh_physical_screen;
  29         extern int full_screen_refresh;
  30 
  31         // i've tried refreshphysical screen (screen unlock) and that caused the canon and
  32         // function menu to not display at all. This seems to work and is called in a similar
  33         // way in other places where original OSD should be refreshed.
  34         extern void _LockAndRefresh(); // wrapper function for screen lock
  35         extern void _UnlockAndRefresh(); // wrapper function for screen unlock
  36 
  37         _LockAndRefresh();
  38 
  39         enabled_refresh_physical_screen=1;
  40         full_screen_refresh=3; //found in ScreenUnlock underneath a CameraLog.c call sub_FFA02598
  41 
  42         _UnlockAndRefresh();
  43 }
  44 
  45 
  46 
  47 
  48 void shutdown()
  49 {
  50         volatile long *p = (void*)0xC022001C;
  51 
  52         asm(
  53                 "MRS     R1, CPSR\n"
  54                 "AND     R0, R1, #0x80\n"
  55                 "ORR     R1, R1, #0x80\n"
  56                 "MSR     CPSR_cf, R1\n"
  57                 :::"r1","r0");
  58 
  59         *p = 0x44;  // power off.
  60 
  61         while(1);
  62 }
  63 
  64 #define LED_PR 0xC0220138    // -> 0xC0223030 maybe front led ASM1989 ixus1000  found at  FF929BDC
  65 
  66 
  67 void debug_led(int state)
  68 {
  69  *(int*)LED_PR=state ? 0x46 : 0x44;
  70 }
  71 
  72 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
  73  static char led_table[5]={4,5,7,8,9};
  74  _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
  75 }
  76 
  77 int get_flash_params_count(void){
  78  return 120;
  79 }
  80 
  81 void JogDial_CW(void){
  82  _PostLogicalEventForNotPowerType(0x877, 1);  // RotateJogDialRight  old 874
  83 }
  84 
  85 void JogDial_CCW(void){
  86  _PostLogicalEventForNotPowerType(0x876, 1);  // RotateJogDialLeft  old 875
  87 }
  88 
  89 // temporary dummy functions because camera is defined as ND but probably doesn't have one
  90 short _get_nd_value(void)
  91 {
  92     return 0;
  93 }
  94 short _get_current_nd_value(void)
  95 {
  96     return 0;
  97 }
  98 

/* [<][>][^][v][top][bottom][index][help] */