Added C interface to timer handling.

This commit is contained in:
Oliver Schmidt 2017-11-05 23:16:34 +01:00
parent 3c9ab2eb5f
commit c6efcebf97
3 changed files with 32 additions and 0 deletions

View File

@ -178,6 +178,20 @@ unsigned char __fastcall__ udp_send(const unsigned char* buf, unsigned int len,
unsigned long dest, unsigned int dest_port,
unsigned int src_port);
// Get number of milliseconds since initialization
//
// Inputs: None
// Output: Current number of milliseconds
//
unsigned int timer_read(void);
// Check if specified period of time has passed yet
//
// Inputs: time: Number of milliseconds we are willing to wait for
// Output: 1 if timeout occured, 0 otherwise
//
unsigned char __fastcall__ timer_timeout(unsigned int time);
// User abort control
//
// Control if the user can abort blocking functions with the abort key

View File

@ -30,6 +30,7 @@ IP65OBJS=\
ip65_c.o \
tftp.o \
timer.o \
timer_c.o \
output_buffer.o \
parser.o \
sntp.o \

17
ip65/timer_c.s Normal file
View File

@ -0,0 +1,17 @@
.include "../inc/common.i"
.export _timer_read
.export _timer_timeout
.import timer_read
.import timer_timeout
_timer_read := timer_read
_timer_timeout:
jsr timer_timeout
ldx #$00
txa
rol
eor #$01
rts