# since we're using devfsd, we need to create our symlinks on every reboot
echo "devices..."
cd /dev


echo "set-up fluorometer on /dev/tts/0 -> /dev/fluoro"
setserial /dev/tts/0  uart 16550A  port 0x89c003f8  irq 33
stty  -F  /dev/tts/0 9600 min 1 time 0 -opost -isig -icanon
rm -f  /dev/fluoro
ln -s  /dev/tts/0  /dev/fluoro


echo "set-up wakey on /dev/tts/1 -> /dev/wakey"
setserial /dev/tts/1  uart 16550A  port 0x89c002f8  irq 33
stty  -F  /dev/tts/1 9600 min 1 time 0 -opost -isig -icanon -echo
rm -f  /dev/wakey
ln -s  /dev/tts/1  /dev/wakey


echo "set-up stepper controller RS485 on /dev/ttyAM1 -> /dev/stepper"
rm -rf /dev/stepper
ln -s /dev/ttyAM1 /dev/stepper
/root/rs485
peekpoke  8  0x22C00000  0x4     # Set rs485 enable bit

#leave interrupts unmasked on IDE accesses so we don't lose serial input
[ "hd[a-z]" = 'hd[a-z]' ] || hdparm -u1k1 hd[a-z] >null

#I2Cgate=null #ttyAM0   #serial port that talks to the I2C gateway
#[ -c $I2Cgate ] && {
#  ln -s $I2Cgate I2Cgate 
#  chmod g+rw $I2Cgate
#  chgrp tty $I2Cgate
#}

#freewave=ttyAM0  #tts/15 #serial port connected to the freewave radio modem
#[ -c $freewave ] && {
#  ln -s $freewave freewave
#  stty -F freewave 19200 clocal raw -echo -echonl  #for modem configuration
#  modprobe ppp_async && modprobe ppp_deflate     #supprt for the ppp deamon
#}

echo "done"
