#!/bin/bash
# 
# EEprom lesen und schreiben
# malkus elektronik GmbH
# 2010-09-07
#
#
# Read EEPROM

CPU="atmega328p"

if [ $1 = "S" ]
then
	echo EEPROM schreiben
	avrdude -p $CPU -P /dev/ttyACM0 -c stk500v2 -B8 -U eeprom:w:eeprom.read
	echo Fertig!
	exit 0
fi

if [ $1 = "R" ]
then
	echo EEPROM lesen
	avrdude -p $CPU -P /dev/ttyACM0 -c stk500v2 -B8 -U eeprom:r:eeprom.read:i
	exit 0
fi
exit 0

