Move verbose output, exit is static config detected

This commit is contained in:
Rémy GIBERT 2016-01-09 23:39:10 +01:00
parent b1e65588a9
commit 2bc2428de2

View File

@ -36,16 +36,15 @@ CS.START cld
.DA CS.RUN .DA CS.RUN
.DA CS.DOEVENT .DA CS.DOEVENT
.DA CS.QUIT .DA CS.QUIT
L.LIBSTR .DA LIBSTR
L.LIBTCPIP .DA LIBTCPIP L.LIBTCPIP .DA LIBTCPIP
L.IPCFG .DA IPCFG L.IPCFG .DA IPCFG
L.MSG.CFG .DA MSG.CFG
L.MSG.CFG.KO .DA MSG.CFG.KO
L.MSG.CFG.OK .DA MSG.CFG.OK
L.MSG.CFG.NA .DA MSG.CFG.NA
.DA 0 .DA 0
*-------------------------------------- *--------------------------------------
CS.INIT >LDYA L.LIBSTR CS.INIT >LDYA L.LIBTCPIP
>SYSCALL SYS.LoadLibYA
sta hLIBSTR
>LDYA L.LIBTCPIP
>SYSCALL SYS.LoadLibYA >SYSCALL SYS.LoadLibYA
sta hLIBTCPIP sta hLIBTCPIP
@ -53,6 +52,9 @@ CS.INIT >LDYA L.LIBSTR
bcs .9 bcs .9
>STYA ZPPtr1 >STYA ZPPtr1
lda (ZPPtr1)
bmi .99 Already Configured, exit
ldy #S.IPCFG ldy #S.IPCFG
.1 dey .1 dey
lda (ZPPtr1),y lda (ZPPtr1),y
@ -88,8 +90,16 @@ CS.INIT >LDYA L.LIBSTR
clc clc
.9 rts .9 rts
.99 >LDYA L.MSG.CFG.NA
>SYSCALL SYS.PSTROutYA
lda #0
sec
rts
*-------------------------------------- *--------------------------------------
CS.RUN CS.RUN >LDYA L.MSG.CFG
>SYSCALL SYS.PSTROutYA
CS.RUN.DISC jsr SendDHCPDiscFrame CS.RUN.DISC jsr SendDHCPDiscFrame
bcs CS.RUN.KO bcs CS.RUN.KO
@ -126,11 +136,30 @@ CS.RUN.OK lda #S.IPCFG.STATUS.OK
>PUSHW L.IPCFG >PUSHW L.IPCFG
>LIBCALL hLIBTCPIP,LIBTCPIP.SET.IPCFG >LIBCALL hLIBTCPIP,LIBTCPIP.SET.IPCFG
ldx #3
.1 lda IPCFG+S.IPCFG.MASK,x
>PUSHA
dex
bpl .1
ldx #3
.2 lda IPCFG+S.IPCFG.IP,x
>PUSHA
dex
bpl .2
>LDYA L.MSG.CFG.OK
>SYSCALL SYS.PSTROutYA
lda #0 Leave with NO ERROR lda #0 Leave with NO ERROR
sec sec
rts rts
CS.RUN.KO sec CS.RUN.KO pha
>PUSHA
>LDYA L.MSG.CFG.KO
>SYSCALL SYS.PSTROutYA
pla
sec
rts rts
*-------------------------------------- *--------------------------------------
CS.DOEVENT lda (pEvent) CS.DOEVENT lda (pEvent)
@ -190,8 +219,6 @@ CS.DOEVENT lda (pEvent)
rts rts
*-------------------------------------- *--------------------------------------
CS.QUIT lda hLIBTCPIP CS.QUIT lda hLIBTCPIP
>SYSCALL SYS.UnloadLibA
lda hLIBSTR
>SYSCALL SYS.UnloadLibA >SYSCALL SYS.UnloadLibA
clc clc
rts rts
@ -451,8 +478,11 @@ SetFramePtr1AX clc
rts rts
*-------------------------------------- *--------------------------------------
CS.END CS.END
LIBSTR >PSTRING "libstr.o"
LIBTCPIP >PSTRING "libtcpip.o" LIBTCPIP >PSTRING "libtcpip.o"
MSG.CFG >PSTRING "DHCPCLNT:Querying DHCP Server...\n"
MSG.CFG.KO >PSTRING "DHCPCLNT:Time Out [%h].\n"
MSG.CFG.OK >PSTRING "DHCPCLNT:Success:[IP=%d.%d.%d.%d/%d.%d.%d.%d]\n"
MSG.CFG.NA >PSTRING "DHCPCLNT:TCPIP Already Configured, Exiting.\n"
*-------------------------------------- *--------------------------------------
FRAME.DISC .HS 01010600 OP,HTYPE,HLEN,HOPS FRAME.DISC .HS 01010600 OP,HTYPE,HLEN,HOPS
FRAME.DISC.XID .BS 4 FRAME.DISC.XID .BS 4
@ -492,7 +522,6 @@ FRAME.REQ.OPT.SVRIP .BS 4
.HS FF .HS FF
FRAME.REQ.LEN .EQ *-FRAME.REQ FRAME.REQ.LEN .EQ *-FRAME.REQ
*-------------------------------------- *--------------------------------------
hLIBSTR .BS 1
hLIBTCPIP .BS 1 hLIBTCPIP .BS 1
TimeOut .BS 1 TimeOut .BS 1
IPCFG .BS S.IPCFG IPCFG .BS S.IPCFG