Download RL78/G13 Self-Programming
Transcript
RL78/G13 Self-Programming (UART) CC-RL 5.10.10 Receive Packet Analysis Figure 5.15 shows the flowchart for receive packet analysis. R_MAIN_PacketAnalyze() Initialize loop counter count 0 checksum 0 Initialize checksum No (Branch if argument: (rxlength – 1) ! = count) Checksum computation complete? Yes Add to checksum checksum checksum + rxbuf[count] Update loop count count++ No (Branch if rxbuf[rxlength] != checksum) Checksum match? Yes No (Branch if rxbuf[0] is not START, not WRITE, or not END) Received command normal? Yes Set return value to received command Set return value to abnormal termination ret rxdata[0] ret ERROR return (ret) Figure 5.10 R01AN2761EJ0100 Rev. 1.00 May 28, 2015 Receive Packet Analysis Page 40 of 50