mirror of
https://github.com/romychs/Ocean-240.2-Emulator.git
synced 2026-11-04 13:47:15 +03:00
fdc mostly fixed
This commit is contained in:
1 parent
42fb80813c
commit
b133807f05
10 files changed
+490
-155
No files matched your search
@@ -1,5 +1,7 @@
|
||||
package usart
|
||||
|
||||
import log "github.com/sirupsen/logrus"
|
||||
|
||||
/**
|
||||
Universal Serial Asynchronous Receiver/Transmitter
|
||||
i8051, MSM82C51, КР580ВВ51
|
||||
@@ -133,12 +135,19 @@ func (s *I8251) Send(value byte) {
|
||||
}
|
||||
|
||||
func (s *I8251) Receive() byte {
|
||||
|
||||
if s.rxe {
|
||||
if len(s.bufferRx) > 0 {
|
||||
res := s.bufferRx[0]
|
||||
s.bufferRx = s.bufferRx[1:]
|
||||
log.Debugf("ReceiveByte: %x", res)
|
||||
return res
|
||||
}
|
||||
}
|
||||
log.Debugf("ReceiveByte: empty buffer")
|
||||
return 0
|
||||
}
|
||||
|
||||
func (s *I8251) SetRxBytes(bytes []byte) {
|
||||
s.bufferRx = append(s.bufferRx, bytes...)
|
||||
}
|
||||
Reference in new issue
Block a user