export AMPY_PORT=/dev/cu.SLAB_USBtoUART
export BAUD_RATE=115200

ARG=$1

if [ "$ARG" = '--kit' ] || [ "$ARG" = '-k' ]; then
  echo "Using ESP-WOVER-kit_v4.1"
#   export AMPY_PORT=/dev/cu.usbserial-143101
  export AMPY_PORT=/dev/cu.usbserial-14401
fi

function _set_kit_usbserial (){

}


function repl_connect (){
	echo "Connecting to $AMPY_PORT"
	echo "Use Ctrl+a then k to kill the session"
	sleep 2;
	screen $AMPY_PORT $BAUD_RATE
}

function upy (){
	_command=${1}
	shift
# 	echo "command $_command params $@"
	ampy -p $AMPY_PORT -b $BAUD_RATE ${_command} $@
}