source: trunk/platform/ixus95_sd1200/lib.c @ 910

Revision 910, 1.5 KB checked in by fe50, 3 years ago (diff)
Line 
1#include "platform.h"
2#include "lolevel.h"
3#include "sd1200_debug.h"
4
5void vid_bitmap_refresh()
6{
7    _ScreenLock();
8    _RefreshPhysicalScreen(1);
9}
10
11void shutdown()
12{
13    volatile long *p = (void*)0xc022001C; // from task_by (not really complete)
14
15    asm(
16         "MRS     R1, CPSR\n"
17         "AND     R0, R1, #0x80\n"
18         "ORR     R1, R1, #0x80\n"
19         "MSR     CPSR_cf, R1\n"
20         :::"r1","r0");
21
22    *p = 0x44;
23
24    while(1);
25}
26
27int get_flash_params_count(void){
28 return 120; // ? _sub_FF962AB8__PropertyTableManagerCore_c__6, similar to s5is
29             // VERIFY_SD1200. Dunno where the above is from (Not SD780)
30}
31
32// based on SX10, values found by experiment
33void ubasic_set_led(int led, int state, int bright) {
34    return; /* doesn't seem to work */
35 static char led_table[]={0, // green
36                          1, // orange, right
37                          2, // yellow, left
38                          3, // power
39                          // 4,5,6,7,
40                          8, // blue
41                          9 // af
42                          };
43 if((unsigned)led < sizeof(led_table))
44  _LEDDrive(led_table[led], state<=1 ? !state : state);
45// _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
46}
47
48#define DEBUG_LED LED_IO_Y
49void debug_led(int state)
50{
51    * (int *) DEBUG_LED = state ? 0x46 : 0x44;
52}
53
54// from sx10
55void JogDial_CW(void){
56 _PostLogicalEventForNotPowerType(0x874, 2);  // RotateJogDialRight
57}
58
59void JogDial_CCW(void){
60 _PostLogicalEventForNotPowerType(0x875, 2);  // RotateJogDialLeft
61}
62
63
Note: See TracBrowser for help on using the repository browser.