#!/bin/sh
# FROM: http://gumstix.org/tikiwiki/tiki-index.php?page=Robostix-Gumstix-ISP

# Make sure ttyS2 is setup
echo "AF2 in"  > /proc/gpio/GPIO46
echo "AF1 out" > /proc/gpio/GPIO47

# Make sure that the /dev/robostix device exists:
mknod /dev/robostix c 240 0

# and load the module:
insmod robostix_drv.ko

# Pulse the reset line on the robostix:
robostix reset pulse

# Program the ATMega128 Fuses:
uisp --wr_fuse_l=0xbf --wr_fuse_h=0xc9 --wr_fuse_e=0xff

# Write the program specified on the command line to the robostix:
uisp --erase --upload if=$1
