source: trunk/platform/d10/lib.c @ 1839

Revision 1839, 1.4 KB checked in by reyalp, 14 months ago (diff)

d10 - add script led support (0=green, 1=orange, 2=AF)

  • Property svn:eol-style set to native
Line 
1#include "platform.h"
2#include "lolevel.h"
3
4void vid_bitmap_refresh()
5{
6        _ScreenLock();
7    _RefreshPhysicalScreen(1);
8}
9
10void shutdown()
11{
12    volatile long *p = (void*)0xc0220014; // from task_by (not really complete)
13       
14    asm(
15         "MRS     R1, CPSR\n"
16         "AND     R0, R1, #0x80\n"
17         "ORR     R1, R1, #0x80\n"
18         "MSR     CPSR_cf, R1\n"
19         :::"r1","r0");
20       
21    *p = 0x44;
22
23    while(1);
24}
25
26
27#define LED_PR 0xc0220134 // red LED, no DP
28
29void debug_led(int state)
30{
31    volatile long *p=(void*)LED_PR;
32    if (state)
33        p[0]=0x46;
34    else
35        p[0]=0x44;
36}
37
38int get_flash_params_count(void){
39 return 122; //  sub_FF95A4BC, similar to SD990
40}
41
42/*
43D10 has 3 led values
440/0 - Upper indicator Green
451/1 - Upper indicator Orange
462/9 - AF
4710-11 appears to also drive AF, but using the same codepath as non AF leds (no assert on invalid)
48note, LEDDrive returns 3 on invalid params otherwise 0
49second param 0 = solid on, 1 = off, 2-7 blink patterns
502: continuous ~1 blink/sec
513: continuous fast blink
524: continuous medium blink (2/sec ?)
535: burst of 3? fast blinks
546: continuous slow blinks
557: if led was off 1 very fast blink. depends on previous state
568: no obvious effect, but returns 0 for AF
57>8: If used with AF ASSERT!! LEDDrv.c Line 215, otherwise returns 3
58*/
59void camera_set_led(int led, int state, int bright) {
60 static char led_table[]={0,1,9};
61 _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
62}
Note: See TracBrowser for help on using the repository browser.