source: trunk/platform/sx200is/lib.c @ 977

Revision 977, 922 bytes checked in by reyalp, 3 years ago (diff)

renames and cleanup in preparation for making script optional. From ultimA in http://chdk.setepontos.com/index.php?topic=5793.msg57064#msg57064

  • Property svn:eol-style set to native
Line 
1#include "platform.h"
2#include "lolevel.h"
3
4void vid_bitmap_refresh()
5{
6 extern int enabled_refresh_physical_screen;
7 enabled_refresh_physical_screen=1;
8 _RefreshPhysicalScreen(1);
9}
10
11
12void shutdown()
13{
14        volatile long *p = (void*)0xC022001C;   
15       
16        asm(
17                "MRS     R1, CPSR\n"
18                "AND     R0, R1, #0x80\n"
19                "ORR     R1, R1, #0x80\n"
20                "MSR     CPSR_cf, R1\n"
21                :::"r1","r0");
22       
23        *p = 0x44;  // power off.
24       
25        while(1);
26}
27
28#define LED_PR 0xC0220138
29
30void debug_led(int state)
31{
32 *(int*)LED_PR=state ? 0x46 : 0x44;
33}
34
35void camera_set_led(int led, int state, int bright) {
36 static char led_table[5]={4,5,7,8,9};
37 _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
38}
39
40int get_flash_params_count(void){
41 return 120;
42}
43
44void JogDial_CW(void){
45 _PostLogicalEventForNotPowerType(0x874, 2);  // RotateJogDialRight
46}
47
48void JogDial_CCW(void){
49 _PostLogicalEventForNotPowerType(0x875, 2);  // RotateJogDialLeft
50}
Note: See TracBrowser for help on using the repository browser.