Added C interface to SNTP function.

This commit is contained in:
Oliver Schmidt 2017-11-09 21:48:08 +01:00
parent 2045754236
commit 5427dee30d
2 changed files with 27 additions and 0 deletions

View File

@ -35,6 +35,7 @@ IP65OBJS=\
output_buffer.o \
parser.o \
sntp.o \
sntp_c.o \
string_utils.o \
udp.o \
udp_c.o \

26
ip65/sntp_c.s Normal file
View File

@ -0,0 +1,26 @@
.include "../inc/common.i"
.export _sntp_get_time
.import sntp_get_time
.import sntp_ip
.import sntp_utc_timestamp
.importzp sreg
_sntp_get_time:
stax sntp_ip
ldax sreg
stax sntp_ip+2
jsr sntp_get_time
bcs error
ldax sntp_utc_timestamp+2
stax sreg
ldax sntp_utc_timestamp
rts
error:
ldx #$00
txa
stax sreg
rts