#!/bin/sh
## Retrieve Temperatures
##
##	Read the different temperature sensor at the end of the test
##
##	Future Improvements:
##	- There are no communications between the FPGA and CPU, the test s
##	should read automatically temperature.
##
##
## Authors: 
##	- Benoit Rat (Seven Solutions, www.sevensols.com)
##
## GNU Lesser General Public License Usage
## This file may be used under the terms of the GNU Lesser
## General Public License version 2.1 as published by the Free Software
## Foundation and appearing in the file LICENSE.LGPL included in the
## packaging of this file.  Please review the following information to
## ensure the GNU Lesser General Public License version 2.1 requirements
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
#######################################################################################################

printf "======: $0\n"
. 000-functions.sh


user_echoasking "y/n" "Do you see temperature message on UART?" "UART temp"
if [ $ret == "y" ]; then
	user_echoasking "num" "Number of iteration. " "num-iter"
	user_echoasking "num" "System Monitor Temp. " "temp-sysmon"
	user_echoasking "num" "Temp. Sensor FPGA:" "temp-fpga"
	user_echoasking "num" "Temp. Sensor Power Supply:" "tmp-powsup"
	ret1="0"
else
	ret1="100"
fi

load-virtex ${APTS_SWITCH_DIR}/bin/fpga_scbtest.bit
load-lm32 ${APTS_SWITCH_DIR}/bin/cpu_rt.bin

006-FPGA_TempRetrieving.sh


exit_multierr $ret0
