nusb/serial: fix nusb/serial hang with ftdi

have to create process, not a thread in ftdi code so main
process can exit after posting fs service.
This commit is contained in:
cinap_lenrek 2014-12-24 11:04:18 +01:00
parent 7a3f0998a0
commit d1799f65ca
3 changed files with 7 additions and 4 deletions

View file

@ -30,6 +30,9 @@ if(! bind -a '#u' /dev)
# HUAWEI E220 modem
if(~ $2$3 12d11003)
nusb/serial $id
# FTDI
if(~ $2 0403)
nusb/serial $id
}
}
fn detach {

View file

@ -1470,7 +1470,7 @@ ftinit(Serialport *p)
ftdiwrite(p, BMMPSSE|0x0b, 0, FTSETBITMODE);
}
incref(ser->dev);
threadcreate(statusreader, p, 8*1024);
proccreate(statusreader, p, 8*1024);
return 0;
}

View file

@ -747,10 +747,10 @@ threadmain(int argc, char* argv[])
ser->nifcs = 1;
/* probe all the drivers */
if(plprobe(ser)
&& uconsprobe(ser)
if(uconsprobe(ser)
&& ftprobe(ser)
&& slprobe(ser))
&& slprobe(ser)
&& plprobe(ser))
sysfatal("no serial devices found");
for(i = 0; i < ser->nifcs; i++){