mirror of
https://github.com/bobbimanners/emailler.git
synced 2025-02-19 17:31:40 +00:00
Enhanced C interface to user input control.
This commit is contained in:
parent
0bd53f3af7
commit
6eb4aef0e8
15
inc/ip65.h
15
inc/ip65.h
@ -373,7 +373,14 @@ uint16_t timer_read(void);
|
||||
//
|
||||
bool __fastcall__ timer_timeout(uint16_t time);
|
||||
|
||||
// User abort control
|
||||
// Check whether the abort key is being pressed
|
||||
//
|
||||
// Inputs: None
|
||||
// Output: true if abort key pressed, false otherwise
|
||||
//
|
||||
bool input_check_for_abort_key(void);
|
||||
|
||||
// Control abort key
|
||||
//
|
||||
// Control if the user can abort blocking functions with the abort key
|
||||
// (making them return IP65_ERROR_ABORTED_BY_USER). Initially the abort
|
||||
@ -382,6 +389,10 @@ bool __fastcall__ timer_timeout(uint16_t time);
|
||||
// Inputs: enable: false to disable the key, true to enable the key
|
||||
// Output: None
|
||||
//
|
||||
void __fastcall__ abort_key(bool enable);
|
||||
void __fastcall__ input_set_abort_key(bool enable);
|
||||
|
||||
// Access to actual abort key code
|
||||
//
|
||||
extern uint8_t abort_key;
|
||||
|
||||
#endif
|
||||
|
@ -1,15 +1,27 @@
|
||||
.include "../inc/common.inc"
|
||||
|
||||
.export _input_check_for_abort_key
|
||||
.export _input_set_abort_key
|
||||
.export _abort_key
|
||||
|
||||
.import check_for_abort_key
|
||||
.import abort_key
|
||||
.importzp abort_key_default
|
||||
.importzp abort_key_disable
|
||||
|
||||
_abort_key:
|
||||
_input_check_for_abort_key:
|
||||
jsr check_for_abort_key
|
||||
ldx #$00
|
||||
txa
|
||||
rol
|
||||
rts
|
||||
|
||||
_input_set_abort_key:
|
||||
lsr
|
||||
lda #abort_key_default
|
||||
bcs :+
|
||||
lda #abort_key_disable
|
||||
: sta abort_key
|
||||
rts
|
||||
|
||||
_abort_key := abort_key
|
||||
|
Loading…
x
Reference in New Issue
Block a user