source: trunk/platform/a800/lib.c @ 1723

Revision 1723, 1.4 KB checked in by reyalp, 2 years ago (diff)

a800 100a port from mland, patch by waterwings in http://chdk.setepontos.com/index.php?topic=650.msg81174#msg81174

  • Property svn:eol-style set to native
Line 
1#include "platform.h"
2#include "lolevel.h"
3
4// only two LEDs in A495 - the same in a800
5#define LED_PR 0xC0220088  // green LED
6#define LED_AF 0xC0220080  // orange AF LED - não sei
7
8
9void shutdown()
10{
11    volatile long *p = (void*)LED_PR;    // Green LED
12
13    asm(
14        "MRS     R1, CPSR\n"
15        "AND     R0, R1, #0x80\n"
16        "ORR     R1, R1, #0x80\n"
17        "MSR     CPSR_cf, R1\n"
18        :::"r1","r0");
19
20    *p = 0x44;  // power off.
21
22    while(1);
23}
24
25
26void debug_led(int state)
27{
28    *(int*)LED_PR=state ? 0x46 : 0x44;
29}
30
31void camera_set_led(int led, int state, int bright) {
32    long val = state ? 0x46 : 0x44;
33    switch ( led )
34    {
35    default:
36        *(int*)LED_PR = val;
37    }
38}
39
40void vid_bitmap_refresh()// as ixus220 instead of a495
41{
42        extern int full_screen_refresh;
43        extern void _ScreenLock(); // wrapper function for screen lock
44        extern void _ScreenUnlock(); // wrapper function for screen unlock
45
46        full_screen_refresh |= 3; //found in ScreenUnlock
47        _ScreenLock(); 
48        _ScreenUnlock();
49}
50
51
52// Near "PropertyTableManagerCore.c" ROM:FFD2ED94
53int get_flash_params_count(void) {
54 return 0xa0;
55 }              // Found @0xffd3af20 de stub_entry.S
56
57/*void vid_turn_off_updates()
58{
59    extern void _LockAndRefresh();   // wrapper function for screen lock
60
61    _LockAndRefresh();
62}
63
64void vid_turn_on_updates()
65{
66    extern void _UnlockAndRefresh();   // wrapper function for screen unlock
67
68    //_RefreshPhysicalScreen(1);
69    _UnlockAndRefresh();
70}*/
Note: See TracBrowser for help on using the repository browser.