CHDK_DE Vorschauversion  Trunk Rev. 6014
 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

Funktionen

void _GetKbdState (long *buffer)
 
int get_usb_bit ()
 
long __attribute__ ((naked))
 
long __attribute__ ((naked, noinline))
 
void my_kbd_read_keys ()
 
void kbd_fetch_data (long *dst)
 
int Get_JogDial (void)
 
long get_jogdial_direction (void)
 
void jogdial_control (int n)
 

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 }
 
int jogdial_stopped =0
 
KeyMap keymap []
 
static int new_jogdial =0
 
static int old_jogdial =0
 

Dokumentation der Funktionen

long __attribute__ ( (naked)  )

Definiert in Zeile 43 der Datei kbd.c.

47 {
48  (void)ua; (void)ub; (void)uc; (void)ud; (void)ue; (void)uf;
49  /* Initialize our own kbd_new_state[] array with the
50  current physical status. If we dont do this here,
51  the G11 will immediate switch off at the first call
52  of _GetKbdState1/2 with a (uninitialized) array.
53  */
57 
58  while (physw_run){
59  _SleepTask(10);
60  if (wrap_kbd_p1_f() == 1){ // autorepeat ?
61  _kbd_p2_f();
62  }
63  }
64 
65  _ExitTask();
66 }
long __attribute__ ( (naked, noinline)  )

!!

Definiert in Zeile 69 der Datei kbd.c.

70 {
71  asm volatile(
72  "STMFD SP!, {R1-R5,LR}\n"
73  "MOV R4, #0\n"
74 // "BL _kbd_p1_sub\n"
75  "BL my_kbd_read_keys\n"
76  "B _kbd_p1_f_cont\n"
77 
78  );
79  return 0; // shut up the compiler
80 }
void _GetKbdState ( long *  buffer)
int Get_JogDial ( void  )

Definiert in Zeile 100 der Datei kbd.c.

100  {
101  return (*(int*)0xC0240104)>>16;
102 }
long get_jogdial_direction ( void  )

Definiert in Zeile 104 der Datei kbd.c.

104  {
107  if (old_jogdial<new_jogdial) return JOGDIAL_LEFT;
108  else if (old_jogdial>new_jogdial) return JOGDIAL_RIGHT;
109  else return 0;
110 }
int get_usb_bit ( )

Definiert in Zeile 34 der Datei kbd.c.

35 {
36  long usb_physw[3];
37  usb_physw[USB_IDX] = 0;
38  _kbd_read_keys_r2(usb_physw);
39  return(( usb_physw[USB_IDX] & USB_MASK)==USB_MASK) ;
40 }
void jogdial_control ( int  n)

Definiert in Zeile 112 der Datei kbd.c.

112  {
113  // TODO jog_position was not defined on this port
114  /*
115  if (jogdial_stopped && !n) {
116  // If re-enabling jogdial set the task code current & previous positions to the actual
117  // dial positions so that the change won't get processed by the firmware
118  jog_position[0] = jog_position[2] = rear_dial_position; // Rear dial
119  }
120  */
121  jogdial_stopped = n;
122 }
void kbd_fetch_data ( long *  dst)

Definiert in Zeile 88 der Datei kbd.c.

89 {
92 }
void my_kbd_read_keys ( )

Definiert in Zeile 82 der Datei kbd.c.

83 {
86 }

Variablen-Dokumentation

int jogdial_stopped =0

Definiert in Zeile 11 der Datei kbd.c.

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

Definiert in Zeile 9 der Datei kbd.c.

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

Definiert in Zeile 7 der Datei kbd.c.

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

Definiert in Zeile 8 der Datei kbd.c.

KeyMap keymap[]
Initialisierung:
= {
{ 0, KEY_UP , 0x00004000 },
{ 0, KEY_DOWN , 0x00002000 },
{ 0, KEY_LEFT , 0x00000400 },
{ 0, KEY_RIGHT , 0x00001000 },
{ 0, KEY_SET , 0x00000800 },
{ 2, KEY_SHOOT_FULL , 0x00000003 },
{ 2, KEY_SHOOT_FULL_ONLY, 0x00000002 },
{ 2, KEY_SHOOT_HALF , 0x00000001 },
{ 0, KEY_ZOOM_IN , 0x00000010 },
{ 0, KEY_ZOOM_OUT , 0x00000008 },
{ 0, KEY_MENU , 0x00040000 },
{ 0, KEY_DISPLAY , 0x00020000 },
{ 0, KEY_PRINT , 0x00000200 },
{ 0, KEY_ERASE , 0x00010000 },
{ 0, KEY_EXPO_CORR , 0x00008000 },
{ 0, KEY_MICROPHONE , 0x00080000 },
{ 0, 0, 0 }
}

Definiert in Zeile 13 der Datei kbd.c.

int new_jogdial =0
static

Definiert in Zeile 95 der Datei kbd.c.

int old_jogdial =0
static

Definiert in Zeile 95 der Datei kbd.c.