CHDK_DE Vorschauversion  Trunk Rev. 5249
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
lib.c-Dateireferenz
#include "platform.h"
#include "lolevel.h"
+ Include-Abhängigkeitsdiagramm für lib.c:

gehe zum Quellcode dieser Datei

Makrodefinitionen

#define LED_PR   0xC0220130
 

Funktionen

void vid_bitmap_refresh ()
 
void shutdown ()
 
void debug_led (int state)
 
void camera_set_led (int led, int state, int bright)
 
int get_flash_params_count (void)
 
void JogDial_CW (void)
 
void JogDial_CCW (void)
 
int vid_get_viewport_byte_width ()
 
int vid_get_viewport_width ()
 
int vid_get_viewport_display_xoffset ()
 
long vid_get_viewport_height ()
 
int vid_get_viewport_display_yoffset ()
 

Makro-Dokumentation

#define LED_PR   0xC0220130

Definiert in Zeile 54 der Datei lib.c.

Dokumentation der Funktionen

void camera_set_led ( int  led,
int  state,
int  bright 
)

Definiert in Zeile 62 der Datei lib.c.

62  {
63  static char led_table[5]={4,5,7,8,9};
64  _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
65 }
void debug_led ( int  state)

Definiert in Zeile 57 der Datei lib.c.

58 {
59  *(int*)LED_PR=state ? 0x46 : 0x44;
60 }
int get_flash_params_count ( void  )

Definiert in Zeile 67 der Datei lib.c.

67  {
68  return 120;
69 }
void JogDial_CCW ( void  )

Definiert in Zeile 75 der Datei lib.c.

75  {
76  _PostLogicalEventForNotPowerType(0x876, 2); // RotateJogDialLeft old 875
77 }
void JogDial_CW ( void  )

Definiert in Zeile 71 der Datei lib.c.

71  {
72  _PostLogicalEventForNotPowerType(0x875, 2); // RotateJogDialRight old 874 old 877 ???
73 }
void shutdown ( )

Definiert in Zeile 38 der Datei lib.c.

39 {
40  volatile long *p = (void*)0xC022001C;
41 
42  asm(
43  "MRS R1, CPSR\n"
44  "AND R0, R1, #0x80\n"
45  "ORR R1, R1, #0x80\n"
46  "MSR CPSR_cf, R1\n"
47  :::"r1","r0");
48 
49  *p = 0x44; // power off.
50 
51  while(1);
52 }
void vid_bitmap_refresh ( )

Definiert in Zeile 16 der Datei lib.c.

17 {
19  extern int full_screen_refresh;
20 
21  // i've tried refreshphysical screen (screen unlock) and that caused the canon and
22  // function menu to not display at all. This seems to work and is called in a similar
23  // way in other places where original OSD should be refreshed.
24  extern void _LockAndRefresh(); // wrapper function for screen lock
25  extern void _UnlockAndRefresh(); // wrapper function for screen unlock
26 
27  _LockAndRefresh();
28 
29  enabled_refresh_physical_screen=1;
30  full_screen_refresh=3; //found in ScreenUnlock underneath a CameraLog.c call sub_FFA02598
31 
32  _UnlockAndRefresh();
33 }
int vid_get_viewport_byte_width ( )

Definiert in Zeile 86 der Datei lib.c.

86  {
87  return 960 * 6 / 4; // SX210IS - wide screen LCD is 960 pixels wide, each group of 4 pixels uses 6 bytes (UYVYYY)
88 }
int vid_get_viewport_display_xoffset ( )

Definiert in Zeile 111 der Datei lib.c.

112 {
113  // viewport width offset table for each image size
114  // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5
115  //static long vp_w[5] = { 0, 60, 0, 44, 72 };
116 
117  // 0 = 16:9, 1 = 4:3
118  // see vid_get_viewport_width()
119  //static long vp_w[5] = { 0, 60, 0, 44, 72 }; // should all be even values for edge overlay
120  //return vp_w[shooting_get_prop(PROPCASE_ASPECT_RATIO)];
121 
122  // if widescreen, photo and video modes
123  if( ( (shooting_get_prop(PROPCASE_RESOLUTION) == 8) && (!MODE_IS_VIDEO(mode_get())) ) ||
125  return 0;
126  else
127  return 60;
128 }
int vid_get_viewport_display_yoffset ( )

Definiert in Zeile 140 der Datei lib.c.

141 {
142  // viewport height offset table for each image size
143  // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5
144  //static long vp_h[5] = { 0, 0, 13, 0, 0 };
145  //return vp_h[shooting_get_prop(PROPCASE_ASPECT_RATIO)];
146  return 0;
147 }
long vid_get_viewport_height ( )

Definiert in Zeile 130 der Datei lib.c.

131 {
132  // viewport height table for each image size
133  // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5
134  //static long vp_h[5] = { 240, 240, 214, 240, 240 };
135  //return vp_h[shooting_get_prop(PROPCASE_ASPECT_RATIO)];
136  // is always 240 on sx210is
137  return 240;
138 }
int vid_get_viewport_width ( )

Definiert in Zeile 92 der Datei lib.c.

93 {
94  // viewport width table for each image size
95  // 0 = 4:3, 1 = 16:9, 2 = 3:2, 3 = 1:1, 4 = 4:5
96  //static long vp_w[5] = { 480, 360, 360, 272, 216 };
97 
98  // 0 = 16:9, 1 = 4:3
99  // somehow, prop PROPCASE_ASPECT_RATIO doesn't work
100  //static long vp_w[5] = { 480, 360, 360, 272, 216 };
101  //return vp_w[shooting_get_prop(PROPCASE_ASPECT_RATIO)];
102 
103  // if widescreen, photo and video modes
104  if( ( (shooting_get_prop(PROPCASE_RESOLUTION) == 8) && (!MODE_IS_VIDEO(mode_get())) ) ||
106  return 480;
107  else
108  return 360;
109 }