This source file includes following definitions.
- vid_bitmap_refresh
- shutdown
- debug_led
- get_flash_params_count
- camera_set_led
- _GetBatteryTemperature
1 #include "platform.h"
2 #include "lolevel.h"
3
4 #define LED_PR 0xc02200C4
5 #define LED_RED 0xc02200C8
6 #define LED_GRN 0xc02200CC
7 #define LED_PWR 0xc02200D0
8
9 void vid_bitmap_refresh()
10 {
11 extern int enabled_refresh_physical_screen;
12 enabled_refresh_physical_screen=1;
13 _RefreshPhysicalScreen(1);
14 }
15
16
17 void shutdown()
18 {
19
20
21
22
23
24
25
26
27
28
29
30
31 volatile long *p = (void*)0xC02200A0;
32
33 asm(
34 "MRS R1, CPSR\n"
35 "AND R0, R1, #0x80\n"
36 "ORR R1, R1, #0x80\n"
37 "MSR CPSR_cf, R1\n"
38 :::"r1","r0");
39
40 *p = 0x44;
41
42 while(1);
43 }
44
45
46 void debug_led(int state)
47 {
48 *(int*)LED_PR=state ? 0x46 : 0x44;
49 *(int*)LED_GRN=state ? 0x46 : 0x44;
50 }
51
52
53 int get_flash_params_count(void){
54 return 0x77;
55 }
56
57 void camera_set_led(int led, int state, int bright) {
58 struct led_control led_c;
59 char convert_table[11]={0,1,2,3,0,2,3,1,8,10,10};
60
61
62
63
64
65
66
67
68
69
70 led_c.led_num=convert_table[led%11];
71 led_c.action=state<=1 ? !state : state;
72 led_c.brightness=bright;
73 led_c.blink_count=255;
74 _PostLEDMessage(&led_c);
75 }
76
77
78
79
80
81
82
83
84
85
86 int _GetBatteryTemperature()
87 {
88 return -99;
89 }
90