Command pending, Teridian proprietary – Maxim Integrated 71M6513H Power Meter IC Family Software User Manual
Page 60

71M651x Software User’s Guide
Command Pending
cmd_pending()
UART0 echo
no entry
len = 0?
c = len
cli_buff[ cli_index ] = NUL_
cp = cb
return (FALSE)
echo0?
S_EMPTY != *status
status = Serial_Tx (port, cb, len)
call_when_waiting()
Y
Y
Y
N
N
cli_index--
Y
BS_ == c ?
CLI_BASE != cli_index
CTRL_X == c)
cli_index = CLI_BASE
c >= ' '
(CLI_BASE == cli_index) && (','
== c)
cli_index++
cli_buff[ cli_index ] && cli_index
< CLI_BUFF_SIZE
status=Serial_Tx(port,cli_buff,cli_idx)
cli_index call_when_waiting () S_EMPTY != *status ? send_crlf (); put_char (&c) return (TRUE) (CR_ == c) || (LF_ == c) ? END !(len = Serial_CRx (port, cb, CMD_BUFF_SIZE)) i < c ? Y i = 0 memcpy_xx(cp+1,cp, len-i- 1) *cp++ = CR_ (CR_== *cp || LF_==*cp) len++ *cp = LF_ cp++ i++ cp = cb Y N N len? len -- Y c = *cp++ Find end of command *cli_buff = NUL_ cli_index = CLI_BASE status = Serial_Tx(port,cli_buff, cli_idx) !echo_0? call_when_waiting () S_EMPTY != *status) send_crlf () Y Y Y N N N len-- cp++ return (TRUE) cli_index = CLI_BASE Y N N N Y return (FALSE) Figure 5-18: cmd_pending() Revision 2.4 TERIDIAN Proprietary 60 of 137 © Copyright 2005-2006 TERIDIAN Semiconductor Corporation