| Line | |
|---|
| 1 | #include "platform.h" |
|---|
| 2 | |
|---|
| 3 | void shutdown() |
|---|
| 4 | { |
|---|
| 5 | volatile long *p = (void*)0xc02200a0; |
|---|
| 6 | |
|---|
| 7 | asm( |
|---|
| 8 | "MRS R1, CPSR\n" |
|---|
| 9 | "AND R0, R1, #0x80\n" |
|---|
| 10 | "ORR R1, R1, #0x80\n" |
|---|
| 11 | "MSR CPSR_cf, R1\n" |
|---|
| 12 | :::"r1","r0"); |
|---|
| 13 | |
|---|
| 14 | *p = 0x44; |
|---|
| 15 | |
|---|
| 16 | while(1); |
|---|
| 17 | } |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | #define LED_PR 0xc02200e4 // found in sub_FF82D1A0 |
|---|
| 21 | |
|---|
| 22 | void debug_led(int state) |
|---|
| 23 | { |
|---|
| 24 | volatile long *p=(void*)LED_PR; |
|---|
| 25 | if (state) |
|---|
| 26 | p[0]=0x46; |
|---|
| 27 | else |
|---|
| 28 | p[0]=0x44; |
|---|
| 29 | } |
|---|
| 30 | #define LED_AF 0xc02200ec |
|---|
| 31 | #define LED_BASE 0xc02200dc |
|---|
| 32 | |
|---|
| 33 | void camera_set_led(int led, int state, int bright) |
|---|
| 34 | |
|---|
| 35 | { |
|---|
| 36 | int leds[] = {12,16,4,8,4,0,4}; |
|---|
| 37 | if(led < 4 || led > 10 || led == 6) return; |
|---|
| 38 | volatile long *p=(void*)LED_BASE+ leds[led-4]; |
|---|
| 39 | if (state) |
|---|
| 40 | p[0]=0x46; |
|---|
| 41 | else |
|---|
| 42 | p[0]=0x44; |
|---|
| 43 | } |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | int get_flash_params_count(void){ |
|---|
| 47 | return 83; |
|---|
| 48 | } |
|---|
| 49 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.