This source file includes following definitions.
- shutdown
- debug_led
- debug_led_c
- camera_set_led
- JogDial_CW
- JogDial_CCW
- get_flash_params_count
- vid_get_palette_type
- vid_get_palette_size
- vid_get_bitmap_active_palette
- vid_get_bitmap_active_buffer
1 #include "platform.h"
2 #include "lolevel.h"
3 #include "leds.h"
4
5 void shutdown()
6 {
7 volatile long *p = (void*)0xc02200a0;
8
9 asm(
10 "MRS R1, CPSR\n"
11 "AND R0, R1, #0x80\n"
12 "ORR R1, R1, #0x80\n"
13 "MSR CPSR_cf, R1\n"
14 :::"r1","r0");
15
16 *p = 0x44;
17
18 while(1);
19 }
20
21 void debug_led(int state)
22 {
23 volatile long *p=(void*)LED_ORANGE;
24 if (state)
25 p[0]=0x46;
26 else
27 p[0]=0x44;
28 }
29
30 void debug_led_c(int color, int state)
31 {
32 volatile long *p;
33 if (color==0)
34 p=(void*)LED_PR;
35 else if (color==1)
36 p=(void*)LED_GREEN;
37 else if (color==2)
38 p=(void*)LED_ORANGE;
39 else
40 p=(void*)LED_AF;
41
42 if (state)
43 p[0]=0x46;
44 else
45 p[0]=0x44;
46 }
47
48
49 void camera_set_led(int led, int state, __attribute__ ((unused))int bright)
50 {
51
52
53
54 int leds[] = {0x134,0x130,0x134,0x130,0xd4,0x3030,0x3030};
55
56 volatile long *p=(void*)0xc0220000 + leds[(led-4)%sizeof(leds)];
57 if (state)
58 p[0]=0x46;
59 else
60 p[0]=0x44;
61 }
62
63
64
65
66
67
68
69 void JogDial_CW(void)
70 {
71 _PostLogicalEventForNotPowerType(0x874, 1);
72 }
73
74 void JogDial_CCW(void)
75 {
76 _PostLogicalEventForNotPowerType(0x875, 1);
77 }
78
79
80 int get_flash_params_count(void) { return 115; }
81
82
83
84 int vid_get_palette_type() { return 1; }
85 int vid_get_palette_size() { return 16*4; }
86
87 void *vid_get_bitmap_active_palette()
88 {
89 return (void *)0x3EF20;
90 }
91
92 void *vid_get_bitmap_active_buffer()
93 {
94 return (void*)(*(int*)0x7EC8);
95 }