| 1 | #include "platform.h" |
|---|
| 2 | #include "lolevel.h" |
|---|
| 3 | |
|---|
| 4 | #define LED_DP 0xC02200CC // direct-print (blue) |
|---|
| 5 | #define LED_FLASH 0xC02200D8 // Triggers flash |
|---|
| 6 | #define LED_AF 0xC02200DC // Auto-focus LED |
|---|
| 7 | |
|---|
| 8 | void vid_bitmap_refresh() |
|---|
| 9 | { |
|---|
| 10 | extern int enabled_refresh_physical_screen; |
|---|
| 11 | enabled_refresh_physical_screen=1; |
|---|
| 12 | _RefreshPhysicalScreen(1); |
|---|
| 13 | } |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | void shutdown() |
|---|
| 17 | { |
|---|
| 18 | volatile long *p = (void*)0xC022001C; |
|---|
| 19 | |
|---|
| 20 | asm( |
|---|
| 21 | "MRS R1, CPSR\n" |
|---|
| 22 | "AND R0, R1, #0x80\n" |
|---|
| 23 | "ORR R1, R1, #0x80\n" |
|---|
| 24 | "MSR CPSR_cf, R1\n" |
|---|
| 25 | :::"r1","r0"); |
|---|
| 26 | |
|---|
| 27 | *p = 0x44; // power off. |
|---|
| 28 | |
|---|
| 29 | while(1); |
|---|
| 30 | } |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | void debug_led(int state) |
|---|
| 34 | { |
|---|
| 35 | *(int*)LED_DP=state ? 0x46 : 0x44; |
|---|
| 36 | } |
|---|
| 37 | |
|---|
| 38 | void camera_set_led(int led, int state, int bright) { |
|---|
| 39 | static char led_table[]={7,9}; |
|---|
| 40 | _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state); |
|---|
| 41 | } |
|---|
| 42 | |
|---|
| 43 | int get_flash_params_count(void){ |
|---|
| 44 | return 122; |
|---|
| 45 | } |
|---|
| 46 | |
|---|
| 47 | /* |
|---|
| 48 | GetBatteryTemperature usually will get back temperature of battery compartment/batteries. GetBatteryTemperature is implemented in Canon's firmware for SX120IS. |
|---|
| 49 | Firmware entry point is identified but function is not usable. |
|---|
| 50 | Camera will crash if Canon's GetBatteryTemperature is called by CHDK. |
|---|
| 51 | To avoid a crash Canon's GetBatteryTemperature must not called. As long CHDK general code do not distinguish between cameras that support or don't support GetBatteryTemperature, |
|---|
| 52 | this function will be implemented as specific CHDK-code. It returns always with -99 |
|---|
| 53 | This overrides original canon entry point from stubs_entry.S |
|---|
| 54 | */ |
|---|
| 55 | int _GetBatteryTemperature() |
|---|
| 56 | { |
|---|
| 57 | return -99; |
|---|
| 58 | } |
|---|