Skip to content

Commit ccb29a4

Browse files
committed
add i/o support for memotech.
1 parent 0ee0c75 commit ccb29a4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/memotech/io.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifdef __MEMOTECH__
22
#include <stdio.h>
33
#include <string.h>
4+
#include <rs232.h>
45
#include "../include/io.h"
56
#include "../include/protocol.h"
67

@@ -10,14 +11,25 @@ char io_initialized=0;
1011

1112
void io_init(void)
1213
{
14+
rs232_params(RS_BAUD_9600|RS_STOP_1|RS_BITS_8,RS_PAR_NONE); // Bauds tested 1200[/] 2400[/] 4800[/] 9600[/] 19200[X] 38400[X] 57600[] 115200[]
15+
rs232_init();
16+
io_initialized=1;
1317
}
1418

1519
void io_send_byte(unsigned char b)
1620
{
21+
if (io_initialized==1)
22+
{
23+
rs232_put(b); //*IRQ-OFF (SENDING DATA)
24+
}
1725
}
1826

1927
void io_main(void)
2028
{
29+
if (rs232_get(&inb) != RS_ERR_NO_DATA) // *IRQ-OFF (RECEIVING DATA)
30+
{ /* [RX - Display] */
31+
ShowPLATO(&inb,1);
32+
}
2133
}
2234

2335
#endif /* __MEMOTECH__ */

0 commit comments

Comments
 (0)