root/platform/a3000/lib.c

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

DEFINITIONS

This source file includes following definitions.
  1. shutdown
  2. debug_led
  3. camera_set_led
  4. get_flash_params_count
  5. vid_bitmap_refresh

   1 #include "platform.h"
   2 #include "lolevel.h"
   3 
   4 void shutdown()
   5 {
   6     volatile long *p = (void*)0xC0220010;
   7     
   8     asm(
   9          "MRS     R1, CPSR\n"
  10          "AND     R0, R1, #0x80\n"
  11          "ORR     R1, R1, #0x80\n"
  12          "MSR     CPSR_cf, R1\n"
  13          :::"r1","r0");
  14         
  15     *p = 0x44;
  16 
  17     while(1);
  18 }
  19 
  20 
  21 #define LED_PR 0xC0220010
  22 
  23 void debug_led(int state)
  24 {
  25     volatile long *p=(void*)LED_PR;
  26     if (state)
  27         p[0]=0x46;
  28     else
  29         p[0]=0x44;
  30 }
  31 
  32 /*
  33 M:FFC24CDC sub_FFC24CDC                            ; CODE XREF: sub_FFC24E54+48p
  34 ROM:FFC24CDC                                         ; DATA XREF: sub_FFC24E54+34o
  35 ROM:FFC24CDC                 STMFD   SP!, {R4,LR}
  36 ROM:FFC24CE0                 MOV     R1, #0
  37 ROM:FFC24CE4                 MOV     R0, #4
  38 ROM:FFC24CE8                 BL      LEDDrive
  39 ROM:FFC24CEC                 MOV     R1, #0
  40 ROM:FFC24CF0                 MOV     R0, #2
  41 ROM:FFC24CF4                 BL      LEDDrive
  42 ROM:FFC24CF8                 MOV     R1, #0
  43 ROM:FFC24CFC                 MOV     R0, #0
  44 ROM:FFC24D00                 BL      LEDDrive
  45 ROM:FFC24D04                 MOV     R1, #0
  46 ROM:FFC24D08                 MOV     R0, #7
  47 ROM:FFC24D0C                 BL      LEDDrive
  48 ROM:FFC24D10                 LDMFD   SP!, {R4,LR}
  49 ROM:FFC24D14                 MOV     R1, #0
  50 ROM:FFC24D18                 MOV     R0, #8
  51 ROM:FFC24D1C                 B       LEDDrive
  52 ROM:FFC24D1C ; End of function sub_FFC24CDC
  53 
  54 */
  55 
  56 
  57 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
  58 if (led == 4 || led == 7 ) // Green (power) or orange led
  59         _LEDDrive(7, state<=1 ? !state : state);
  60 else if ( led == 9 ) // Red AF-Light
  61         _LEDDrive(9, state<=1 ? !state : state);
  62 }
  63 
  64 int get_flash_params_count(void){
  65 /*
  66 ROM:FFD36E08                 BIC     R4, R4, #0x4000
  67 ROM:FFD36E0C                 CMP     R4, #0x94
  68 ROM:FFD36E10                 LDRCS   R0, =aPropertytablem ; "PropertyTableManagerCore.c"
  69 */
  70  return 0x94;
  71 }
  72 void vid_bitmap_refresh() {
  73     extern int enabled_refresh_physical_screen;
  74     extern int full_screen_refresh;
  75 
  76     // asm1989: i've tried refreshphysical screen (screen unlock) and that caused the canon and
  77     // function menu to not display at all. This seems to work and is called in a similar
  78     // way in other places where original OSD should be refreshed.
  79     extern void _LockAndRefresh();   // wrapper function for screen lock
  80     extern void _UnlockAndRefresh();   // wrapper function for screen unlock
  81 
  82     _LockAndRefresh();
  83 
  84     enabled_refresh_physical_screen=1;
  85     full_screen_refresh=3;   // found in ScreenUnlock underneath a CameraLog.c call
  86 
  87     _UnlockAndRefresh();
  88 }
  89 

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