33#ifdef CONF_AUTOSHUTOFF
44volatile unsigned char dkey;
52char 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\
107#ifdef CONF_AUTOSHUTOFF
113 return (
dkey & (
unsigned char)data);
119 return ! (
dkey & (
unsigned char)data);
126#ifdef CONF_AUTOSHUTOFF
__asm__("\n\
.text\n\
.globl _atomic_inc\n\
_atomic_inc:\n\
stc ccr, r1h ; save flags\n\
orc #0x80, ccr ; disable all but NMI\n\
mov.b @r0, r1l\n\
inc r1l\n\
mov.b r1l, @r0\n\
ldc r1h, ccr ; restore flags\n\
rts\n\
")
Interface: debounced key driver.
wakeup_t dkey_released(wakeup_t data)
wakeup if all of the given keys are released.
#define KEY_ANY
any of the keys
volatile unsigned char dkey
the current key
volatile unsigned char dkey_multi
the currently active keys
wakeup_t dkey_pressed(wakeup_t data)
wakeup if any of the given keys is pressed.
#define KEY_ONOFF
the on/off key is pressed
int getchar()
wait for keypress and return key code.
Internal Interface: task management.
Internal Interface: Powerdown Timer Routines.
void shutoff_restart(void)
volatile unsigned int idle_powerdown
unsigned long wakeup_t
wakeup data area type
Interface: reduced UNIX standard library.
wakeup_t wait_event(wakeup_t(*wakeup)(wakeup_t), wakeup_t data)