accept multiple address/data octets

This commit is contained in:
Wolfgang Hottgenroth 2024-03-08 08:16:56 +01:00
parent d295a36598
commit a5438cef14

19
main.S
View File

@ -225,30 +225,33 @@ receivedata:
push r10 push r10
;; wait for first octet ;; wait for first octet
receivedata_wait_for_first_octet: receivedata_wait_for_control_octet:
bit #UCB0RXIFG, &UC0IFG bit #UCB0RXIFG, &UC0IFG
jz receivedata_wait_for_first_octet jz receivedata_wait_for_control_octet
;; get data from buffer register ;; get control or address octet from buffer register
mov.b UCB0RXBUF, r9 mov.b UCB0RXBUF, r9
;; check whether value == 0xff (wait for the whole ;; check whether value == 0xff (wait for the whole
;; set of data to fill the screendata) ;; set of data to fill the screendata)
cmp.b #0xff, r9 cmp.b #0xff, r9
;; receive all data ;; receive all data
jz receivedata_wait_for_all_data jz receivedata_wait_for_all_data
;; check whether value == 0xfe (no more data)
cmp.b #0xfe, r9
;; no more data
jz receivedata_end
;; if it is not 0xff, it is the octet number which is the ;; it is an address octet
;; relative address within screendata
receivedata_wait_for_octet: receivedata_wait_for_octet:
bit #UCB0RXIFG, &UC0IFG bit #UCB0RXIFG, &UC0IFG
jz receivedata_wait_for_octet jz receivedata_wait_for_octet
;; get octet from buffer register ;; get data octet from buffer register
mov.b UCB0RXBUF, r10 mov.b UCB0RXBUF, r10
;; move it to the destination ;; move it to the destination
mov.b r10, screendata(r9) mov.b r10, screendata(r9)
;; done ;; next address/control octet
jmp receivedata_end jmp receivedata_wait_for_control_octet
receivedata_wait_for_all_data: receivedata_wait_for_all_data:
;; this is a bit dangerous, if the application controller ;; this is a bit dangerous, if the application controller