source: trunk/platform/a430/lib.c @ 2798

Revision 1663, 777 bytes checked in by philmoz, 16 months ago (diff)

Merged revision(s) 1662 from branches/release-1_0:

  • Property svn:eol-style set to native
Line 
1
2int get_flash_params_count(void){
3 return 108;
4}
5
6void shutdown()
7{
8    volatile long *p = (void*)0xc02200a0;
9       
10    asm(
11         "MRS     R1, CPSR\n"
12         "AND     R0, R1, #0x80\n"
13         "ORR     R1, R1, #0x80\n"
14         "MSR     CPSR_cf, R1\n"
15         :::"r1","r0");
16       
17    *p = 0x44;
18
19    while(1);
20}
21
22#define LED_PR 0xc0220084
23void debug_led(int state)
24{
25    volatile long *p=(void*)LED_PR;
26    if (state)
27        p[0]=0x46;
28    else
29        p[0]=0x44;
30}
31
32#define LED_AF 0xc0220080
33void __attribute__((weak)) camera_set_led(int led, int state, int bright)
34{
35  int leds[] = {12,16,4,8,4,0,4};
36  if(led < 4 || led > 10 || led == 6) return;
37  volatile long *p=(void*)LED_AF + leds[led-4];
38    if (state)
39        p[0]=0x46;
40    else
41        p[0]=0x44;
42}
Note: See TracBrowser for help on using the repository browser.