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

gehe zum Quellcode dieser Datei

Makrodefinitionen

#define NEW_SS   (0x2000)
 

Funktionen

void _platformsub_kbd_fetch_data (long *)
 
int get_usb_bit ()
 
long __attribute__ ((naked))
 
void __attribute__ ((naked, noinline))
 *-------------------------------------------------------------------— Mehr ...
 
void my_kbd_read_keys ()
 
void kbd_fetch_data (long *dst)
 
void jogdial_control (int n)
 
int Get_JogDial (void)
 
long get_jogdial_direction (void)
 

Variablen

long kbd_new_state [3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }
 
long kbd_prev_state [3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }
 
long kbd_mod_state [3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }
 
static char kbd_stack [NEW_SS]
 
KeyMap keymap []
 
int jogdial_stopped =0
 
static int new_jogdial =0
 
static int old_jogdial =0
 

Makro-Dokumentation

#define NEW_SS   (0x2000)

Definiert in Zeile 12 der Datei kbd.c.

Dokumentation der Funktionen

long __attribute__ ( (naked)  )

Definiert in Zeile 64 der Datei kbd.c.

68 {
69  int i;
70  while (physw_run){
71  _SleepTask(10);
72 
73  if (wrap_kbd_p1_f() == 1){ // autorepeat ?
74  _kbd_p2_f();
75  }
76  }
77 }
void __attribute__ ( (naked, noinline)  )

*-------------------------------------------------------------------—

!!

IS_ERROR( hSoundHandle )

IS_ERROR( RetCode )

IS_ERROR( RetCode )

IS_ERROR( RetCode )

IS_ERROR( RetCode )

"MOV R3, #0\n" "STR R3, [R9]\n"

TODO! below is from sd400

"MOV R3, #0\n" "STR R3, [R9]\n"

TODO! below is from sd400

Definiert in Zeile 79 der Datei kbd.c.

80 {
81  /* WARNING
82  * Stack pointer manipulation performed here!
83  * This means (but not limited to):
84  * function arguments destroyed;
85  * function CAN NOT return properly;
86  * MUST NOT call or use stack variables before stack
87  * is setup properly;
88  *
89  */
90 
91  register int i;
92  register long *newstack;
93 
94  newstack = (void*)kbd_stack;
95 
96  for (i=0;i<NEW_SS/4;i++)
97  newstack[i]=0xdededede;
98 
99  asm volatile (
100  "MOV SP, %0"
101  :: "r"(((char*)newstack)+NEW_SS)
102  : "memory"
103  );
104 
105  mykbd_task_proceed();
106 
107  /* function can be modified to restore SP here...
108  */
109 
110  _ExitTask();
111 }
void _platformsub_kbd_fetch_data ( long *  )
int Get_JogDial ( void  )

Definiert in Zeile 163 der Datei kbd.c.

163  {
164  // address from sub above aJogdail (sub_FF84B8D8)
165  return (*(int*)0xC0240104)>>16;
166 }
long get_jogdial_direction ( void  )

Definiert in Zeile 168 der Datei kbd.c.

168  {
169  // XXX this seems to have a overflow bug: old=MIN_INT, new = old-1 = MAX_INT -> old-1 < old < new = old - 1
170  // not likely to happen though (very long runs with a bias for tuning one direction; bias is probably to the right due to menus)
174  else if (old_jogdial>new_jogdial) return JOGDIAL_LEFT;
175  else return 0;
176 }
int get_usb_bit ( )

Definiert in Zeile 27 der Datei kbd.c.

28 {
29  long usb_physw[3];
30  usb_physw[USB_IDX] = 0;
31  _kbd_read_keys_r2(usb_physw);
32  return(( usb_physw[USB_IDX] & USB_MASK)==USB_MASK) ;
33 }
void jogdial_control ( int  n)

Definiert in Zeile 146 der Datei kbd.c.

146  {
147  // this camera did not have jog_position defined
148  /*
149  if (jogdial_stopped && !n) {
150  // If re-enabling jogdial set the task code current & previous positions to the actual
151  // dial positions so that the change won't get processed by the firmware
152  jog_position[0] = jog_position[2] = rear_dial_position; // Rear dial
153  }
154  */
155  jogdial_stopped = n;
156 }
void kbd_fetch_data ( long *  dst)

Definiert in Zeile 141 der Datei kbd.c.

142 {
144 }
void my_kbd_read_keys ( )

Definiert in Zeile 128 der Datei kbd.c.

129 {
130  _kbd_pwr_on();
131 
133 
134  _kbd_read_keys_r2(physw_status);
135 
137 
138  _kbd_pwr_off();
139 }

Variablen-Dokumentation

int jogdial_stopped =0

Definiert in Zeile 126 der Datei kbd.c.

long kbd_mod_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }

Definiert in Zeile 8 der Datei kbd.c.

long kbd_new_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }

Definiert in Zeile 6 der Datei kbd.c.

long kbd_prev_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }

Definiert in Zeile 7 der Datei kbd.c.

char kbd_stack[NEW_SS]
static

Definiert in Zeile 36 der Datei kbd.c.

KeyMap keymap[]
Initialisierung:
= {
{ 2, KEY_SHOOT_FULL , 0x00000003 },
{ 2, KEY_SHOOT_FULL_ONLY, 0x00000002 },
{ 2, KEY_SHOOT_HALF , 0x00000001 },
{ 2, KEY_UP , 0x00000080 },
{ 2, KEY_DOWN , 0x00000040 },
{ 2, KEY_LEFT , 0x00000010 },
{ 2, KEY_RIGHT , 0x00000020 },
{ 2, KEY_SET , 0x00000100 },
{ 2, KEY_ZOOM_IN , 0x00000004 },
{ 2, KEY_ZOOM_OUT , 0x00000008 },
{ 2, KEY_MENU , 0x00000400 },
{ 2, KEY_DISPLAY , 0x00000200 },
{ 2, KEY_PRINT , 0x00000800 },
{ 0, 0, 0 }
}

Definiert in Zeile 38 der Datei kbd.c.

int new_jogdial =0
static

Definiert in Zeile 161 der Datei kbd.c.

int old_jogdial =0
static

Definiert in Zeile 161 der Datei kbd.c.