33 #ifdef CONF_AUTOSHUTOFF 44 volatile unsigned char dkey;
52 char dkey_timer __attribute__ ((unused));
59 #ifndef DOXYGEN_SHOULD_SKIP_THIS 63 .global _dkey_handler\n\ 65 mov.b @_dkey_timer,r6l ; check debouncing timer==0\n\ 69 mov.b r6l,@_dkey_timer\n\ 73 sub.b r6l,r6l ; generate button codes\n\ 74 ; from PORT4/PORT7 in r6l\n\ 87 mov.b @_dkey_multi,r6h\n\ 88 xor.b r6l,r6h ; create mask of changed positions in r6h\n\ 91 mov.b r6l,@_dkey_multi\n\ 93 and.b r6h,r6l ; mask out unchanged positions\n\ 96 mov.b #100,r6l ; set debouncing timer\n\ 97 mov.b r6l,@_dkey_timer\n\ 102 #endif // DOXYGEN_SHOULD_SKIP_THIS 107 #ifdef CONF_AUTOSHUTOFF 113 return (
dkey & (
unsigned char)data);
119 return ! (
dkey & (
unsigned char)data);
126 #ifdef CONF_AUTOSHUTOFF int getchar()
wait for keypress and return key code.
void shutoff_restart(void)
Internal Interface: Powerdown Timer Routines.
wakeup_t dkey_released(wakeup_t data)
wakeup if all of the given keys are released.
__asm__("\.text\.globl _atomic_inc\ _atomic_inc:\ stc ccr, r1h ; save flags\ orc #0x80, ccr ; disable all but NMI\ mov.b @r0, r1l\ inc r1l\ mov.b r1l, @r0\ ldc r1h, ccr ; restore flags\ rts\")
Internal Interface: task management.
volatile unsigned char dkey_multi
the currently active keys
Interface: debounced key driver.
Interface: reduced UNIX standard library.
unsigned long wakeup_t
wakeup data area type
#define KEY_ONOFF
the on/off key is pressed
#define KEY_ANY
any of the keys
wakeup_t wait_event(wakeup_t(*wakeup)(wakeup_t), wakeup_t data)
volatile unsigned char dkey
the current key
wakeup_t dkey_pressed(wakeup_t data)
wakeup if any of the given keys is pressed.
volatile unsigned int idle_powerdown