root/platform/a490/lib.c

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

DEFINITIONS

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

   1 #include "platform.h"
   2 #include "lolevel.h"
   3 
   4 // only two LEDs in A490:
   5 #define LED_PR 0xC0220088  // green LED
   6 #define LED_AF 0xC0220080  // orange AF LED
   7 
   8 
   9 void shutdown()
  10 {
  11     volatile long *p = (void*)LED_PR;    // Green LED
  12 
  13     asm(
  14         "MRS     R1, CPSR\n"
  15         "AND     R0, R1, #0x80\n"
  16         "ORR     R1, R1, #0x80\n"
  17         "MSR     CPSR_cf, R1\n"
  18         :::"r1","r0");
  19 
  20     *p = 0x44;  // power off.
  21 
  22     while(1);
  23 }
  24 
  25 
  26 void debug_led(int state)
  27 {
  28     *(int*)LED_PR=state ? 0x46 : 0x44;
  29 }
  30 
  31 void camera_set_led(int led, int state, __attribute__ ((unused))int bright) {
  32     long val = state ? 0x46 : 0x44;
  33     switch ( led )
  34     {
  35     default:
  36         *(int*)LED_PR = val;
  37     }
  38 }
  39 
  40 void vid_bitmap_refresh() {
  41     extern int enabled_refresh_physical_screen;
  42     extern int full_screen_refresh;
  43 
  44     // asm1989: i've tried refreshphysical screen (screen unlock) and that caused the canon and
  45     // function menu to not display at all. This seems to work and is called in a similar
  46     // way in other places where original OSD should be refreshed.
  47     extern void _ScreenLock();   // wrapper function for screen lock
  48     extern void _ScreenUnlock();   // wrapper function for screen unlock
  49 
  50     _ScreenLock();
  51 
  52     enabled_refresh_physical_screen=1;
  53     full_screen_refresh=3;   // found in ScreenUnlock underneath a CameraLog.c call
  54 
  55     _ScreenUnlock();
  56 }
  57 
  58 // Near "PropertyTableManagerCore.c" ROM:FFD2EBD8
  59 int get_flash_params_count(void){
  60     return 0x74;
  61 }
  62 
  63 
  64 // This camera crashes if GetBatteryTemperature is called, override auto detected stub
  65 int _GetBatteryTemperature()
  66 {
  67       return -99;
  68 }
  69 
  70 /*void vid_turn_off_updates()
  71 {
  72     extern void _LockAndRefresh();   // wrapper function for screen lock
  73 
  74     _LockAndRefresh();
  75 }
  76 
  77 void vid_turn_on_updates()
  78 {
  79     extern void _UnlockAndRefresh();   // wrapper function for screen unlock
  80 
  81     //_RefreshPhysicalScreen(1);
  82     _UnlockAndRefresh();
  83 }*/

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