Is there a simple way to use the registers as an interrupt trigger? I can make the application run in a new pid and poll for serial input using fork() I just need to read data, no write needed This is the "read" code I am using
fd = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY | O_NDELAY);
fcntl(fd, F_SETFL, 0);
char buf[256];
n = read(fd, (void*)buf, 255);
I am not even sure if I have framed the question correctly Could it look something like this?
int com_data=0;
void main(void)
{
if (com_data){
--do something--
}
}
char getcom()
{
retrieve byte from rxbuffer;
return(byte);
}
interrupt routine
{
com_data=1;
}