struct session_s *s = (struct session_s*)arg;
char buffer[1024];
ssize_t read_len;
-
+
int i;
read_len = read(fd, buffer, 1024);
for(i = 0; i < read_len; i++) {
litex_sim_module_pads_get(pads, "source_valid", (void**)&s->tx_valid);
litex_sim_module_pads_get(pads, "source_ready", (void**)&s->tx_ready);
}
-
+
if(!strcmp(plist->name, "sys_clk"))
litex_sim_module_pads_get(pads, "sys_clk", (void**) &s->sys_clk);
*s->tx_ready = 1;
if(*s->tx_valid) {
- if(*s->tx == '\n')
- printf("\r");
printf("%c", *s->tx);
fflush(stdout);
}
signal.signal(signal.SIGINT, self.sigint)
self.sigint_time_last = 0
- self.lf_insert = True
-
def open(self, port, baudrate):
if hasattr(self, "port"):
return
def reader(self):
try:
- c_last = 0
while self.reader_alive:
c = self.port.read()
- if c_last == b"\r":
- if c == b"\n":
- self.lf_insert = False
- else:
- self.lf_insert = True
- c_last = c
- if self.lf_insert and c == b"\r":
- sys.stdout.buffer.write(b"\n")
- else:
- sys.stdout.buffer.write(c)
+ sys.stdout.buffer.write(c)
sys.stdout.flush()
-
if len(self.mem_regions):
if self.serial_boot and self.detect_prompt(c):
self.answer_prompt()