wow - loopback in sim actually worksgit status

This commit is contained in:
Yehowshua Immanuel 2023-09-28 06:57:38 -04:00
parent ad1bdfc8b1
commit 9f90b00b25
10 changed files with 96 additions and 261 deletions

View file

@ -2,6 +2,22 @@
#include <termios.h>
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
#include <stdbool.h>
static volatile bool ctrl_c_received = false;
void sigint_handler(int sig_num) {
ctrl_c_received = true;
}
void setup_sigint_handler() {
signal(SIGINT, sigint_handler);
}
bool was_ctrl_c_received() {
return ctrl_c_received;
}
static struct termios oldt, newt;
@ -25,6 +41,11 @@ char get_char_from_terminal() {
return c;
}
void write_char_to_terminal(char chr) {
putchar(chr);
fflush(stdout);
}
int is_char_available() {
struct timeval tv;
fd_set read_fd_set;