Added C interface to abort key control.

This commit is contained in:
Oliver Schmidt 2017-11-05 22:55:55 +01:00
parent 6680772b04
commit 3c9ab2eb5f
3 changed files with 27 additions and 0 deletions

View File

@ -178,4 +178,15 @@ unsigned char __fastcall__ udp_send(const unsigned char* buf, unsigned int len,
unsigned long dest, unsigned int dest_port,
unsigned int src_port);
// User abort control
//
// Control if the user can abort blocking functions with the abort key
// (making them return IP65_ERROR_ABORTED_BY_USER). Initially the abort
// key is enabled.
//
// Inputs: enable: 0 to disable the key, 1 to enable the key
// Output: None
//
void __fastcall__ abort_key(unsigned char enable);
#endif

View File

@ -25,6 +25,7 @@ IP65OBJS=\
http.o \
httpd.o \
icmp_c.o \
input_c.o \
ip65.o \
ip65_c.o \
tftp.o \

15
ip65/input_c.s Normal file
View File

@ -0,0 +1,15 @@
.include "../inc/common.i"
.export _abort_key
.import abort_key
.importzp abort_key_default
.importzp abort_key_disable
_abort_key:
lsr
lda #abort_key_default
bcs :+
lda #abort_key_disable
: sta abort_key
rts