All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m35s
37 lines
598 B
C
37 lines
598 B
C
#include <kb.h>
|
|
#include <limits.h>
|
|
#include <process.h>
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <string.h>
|
|
#include <terminal.h>
|
|
|
|
static int ce_pgid;
|
|
|
|
void receiver (void) {
|
|
for (;;) {
|
|
char rcv;
|
|
mail_receive (&rcv, 1);
|
|
if (rcv == '\n')
|
|
terminal_print ("\r\n", 2);
|
|
else
|
|
terminal_print (&rcv, 1);
|
|
}
|
|
}
|
|
|
|
void app_main (void) {
|
|
int ce_pid = exec ("RD", "ce");
|
|
ce_pgid = get_procgroup (ce_pid);
|
|
|
|
process_spawn (&receiver, NULL);
|
|
|
|
for (;;) {
|
|
int ch = kb_read_key ();
|
|
|
|
if (ch <= 0)
|
|
continue;
|
|
|
|
mail_send (ce_pgid, (uint8_t*)&ch, 1);
|
|
}
|
|
}
|