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

Revision 977, 976 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
3int get_flash_params_count(void){
4 return 111;
5}
6
7void shutdown()
8{
9    volatile long *p = (void*)0xc02200a0;
10       
11    asm(
12         "MRS     R1, CPSR\n"
13         "AND     R0, R1, #0x80\n"
14         "ORR     R1, R1, #0x80\n"
15         "MSR     CPSR_cf, R1\n"
16         :::"r1","r0");
17       
18    *p = 0x44;
19
20    while(1);
21}
22//LED ports:
23//AF:           0xC02200C0
24//Print (blue): 0xC02200C4
25//Orange:               0xC02200C8
26//Gr//een:              0xC02200CC
27//Yellow:       0xC02200D0
28//Power (green):        0xC02200D4
29
30
31#define LED_PR 0xC02200C4
32
33void debug_led(int state)
34{
35    volatile long *p=(void*)LED_PR;
36    if (state)
37        p[0]=0x46;
38    else
39        p[0]=0x44;
40}
41
42#define LED_BASE 0xC02200C0
43
44void camera_set_led(int led, int state, int bright)
45
46{
47  int leds[] = {12,16,-1,8,4,0,20}; // cannot quite figure, in which order they're supposed to be..
48  if(led < 4 || led > 10 || led == 6) return;
49  volatile long *p=(void*)LED_BASE + leds[led-4];
50    if (state)
51        p[0]=0x46;
52    else
53        p[0]=0x44;
54}
Note: See TracBrowser for help on using the repository browser.