source: trunk/platform/sx110is/lib.c @ 822

Revision 822, 1.3 KB checked in by reyalp, 4 years ago (diff)

sx110 updates from chdkj in http://chdk.setepontos.com/index.php/topic,2838.msg42208.html#msg42208

  • improved color matrix
  • battery temp return -99c to show missing canon function
  • modified shortcut keys to sx100 style
  • values for sensor dimensions and active area in camera.h
  • Property svn:eol-style set to native
Line 
1
2#include "platform.h"
3#include "lolevel.h"
4
5#define LED_PR  0xc02200C4
6#define LED_RED 0xc02200C8
7#define LED_GRN 0xc02200CC
8#define LED_PWR 0xc02200D0
9
10void vid_bitmap_refresh()
11{
12 extern int enabled_refresh_physical_screen;
13 enabled_refresh_physical_screen=1;
14 _RefreshPhysicalScreen(1);
15}
16void shutdown()
17{
18
19/*
20ROM:FFC0CD8C                 LDR     R1, =0xC0220000
21ROM:FFC0CD90                 MOV     R0, #0x44
22ROM:FFC0CD94                 STR     R0, [R1,#0x54]
23ROM:FFC0CD98                 STR     R0, [R1,#0x4C]
24
25C0220000+54+4C=0xC02200A0
26
27*/
28
29        volatile long *p = (void*)0xC02200A0;   
30       
31        asm(
32                "MRS     R1, CPSR\n"
33                "AND     R0, R1, #0x80\n"
34                "ORR     R1, R1, #0x80\n"
35                "MSR     CPSR_cf, R1\n"
36                :::"r1","r0");
37       
38        *p = 0x44;  // power off.
39       
40        while(1);
41}
42
43
44void debug_led(int state)
45{
46 *(int*)LED_PR=state ? 0x46 : 0x44;
47 *(int*)LED_GRN=state ? 0x46 : 0x44;
48}
49
50void ubasic_set_led(int led, int state, int bright) {
51 static char led_table[5]={4,5,7,8,9};
52 _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
53}
54
55int get_flash_params_count(void){
56 return 120;
57}
58
59void JogDial_CW(void){
60 _PostLogicalEventForNotPowerType(0x874, 2);  // RotateJogDialRight
61}
62
63void JogDial_CCW(void){
64 _PostLogicalEventForNotPowerType(0x875, 2);  // RotateJogDialLeft
65}
66
67
68
Note: See TracBrowser for help on using the repository browser.