source: trunk/platform/a1100/lib.c @ 945

Revision 945, 1.5 KB checked in by rudi_de, 16 months ago (diff)

Aktualisierung auf Rev. 1643, 1644, 1645 internationaler Branch: Release-1.0
http://trac.assembla.com/chdk/changeset/1643/branches/release-1_0
http://trac.assembla.com/chdk/changeset/1644/branches/release-1_0
http://trac.assembla.com/chdk/changeset/1645/branches/release-1_0

Betrifft a1100

  • Abfrage der Batterietemperatur führt zum Absturz, daher konstant auf -99 gesetzt
  • kleinere Korrekturen
  • Property svn:eol-style set to native
Line 
1#include "platform.h"
2#include "lolevel.h"
3
4#define LED_DP      0xC02200CC    // direct-print (blue)
5#define LED_FLASH   0xC02200D8    // Triggers flash
6#define LED_AF      0xC02200DC    // Auto-focus LED
7
8void vid_bitmap_refresh()
9{
10 extern int enabled_refresh_physical_screen;
11 enabled_refresh_physical_screen=1;
12 _RefreshPhysicalScreen(1);
13}
14
15
16void shutdown()
17{
18    volatile long *p = (void*)0xC022001C;   
19   
20    asm(
21        "MRS     R1, CPSR\n"
22        "AND     R0, R1, #0x80\n"
23        "ORR     R1, R1, #0x80\n"
24        "MSR     CPSR_cf, R1\n"
25        :::"r1","r0");
26
27    *p = 0x44;  // power off.
28
29    while(1);
30}
31
32
33void debug_led(int state)
34{
35 *(int*)LED_DP=state ? 0x46 : 0x44;
36}
37
38void camera_set_led(int led, int state, int bright) {
39 static char led_table[]={7,9};
40 _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
41}
42
43int get_flash_params_count(void){
44 return 122;
45}
46
47/*
48GetBatteryTemperature usually will get back temperature of battery compartment/batteries. GetBatteryTemperature is implemented in Canon's firmware for SX120IS.
49Firmware entry point is identified but function is not usable.
50Camera will crash if Canon's GetBatteryTemperature is called by CHDK.
51To avoid a crash Canon's GetBatteryTemperature must not called. As long CHDK general code do not distinguish between cameras that support or don't support GetBatteryTemperature,
52this function will be implemented as specific CHDK-code. It returns always with -99
53This overrides original canon entry point from stubs_entry.S
54*/
55int _GetBatteryTemperature()
56{
57      return -99;
58}
Note: See TracBrowser for help on using the repository browser.