configure
changeset 284 24bf3d692993
parent 279 9b69f2fabafe
child 329 7717252e3ed9
equal deleted inserted replaced
283:e0b3096230e5 284:24bf3d692993
    52 TIMEVAL=
    52 TIMEVAL=
    53 TIMEVAL_MAX=
    53 TIMEVAL_MAX=
    54 
    54 
    55 # Default to little-endian
    55 # Default to little-endian
    56 CANOPEN_BIG_ENDIAN=
    56 CANOPEN_BIG_ENDIAN=
       
    57 
       
    58 # Max number of active errors managed in error_data structure.
       
    59 EMCY_MAX_ERRORS=8
    57 
    60 
    58 ###########################################################################
    61 ###########################################################################
    59 #                             DEFAULT BUILD OPTIONS                       #
    62 #                             DEFAULT BUILD OPTIONS                       #
    60 ###########################################################################
    63 ###########################################################################
    61 
    64 
   106 	--SDO_MAX_SIMULTANEOUS_TRANSFERTS=*)	SDO_MAX_SIMULTANEOUS_TRANSFERTS=$1;;
   109 	--SDO_MAX_SIMULTANEOUS_TRANSFERTS=*)	SDO_MAX_SIMULTANEOUS_TRANSFERTS=$1;;
   107 	--NMT_MAX_NODE_ID=*)	NMT_MAX_NODE_ID=$1;;
   110 	--NMT_MAX_NODE_ID=*)	NMT_MAX_NODE_ID=$1;;
   108 	--SDO_TIMEOUT_MS=*)	SDO_TIMEOUT_MS=$1;;
   111 	--SDO_TIMEOUT_MS=*)	SDO_TIMEOUT_MS=$1;;
   109 	--CANOPEN_BIG_ENDIAN=*)	CANOPEN_BIG_ENDIAN=$1;;
   112 	--CANOPEN_BIG_ENDIAN=*)	CANOPEN_BIG_ENDIAN=$1;;
   110 	--MAX_NB_TIMER=*) MAX_NB_TIMER=$1;;
   113 	--MAX_NB_TIMER=*) MAX_NB_TIMER=$1;;
       
   114 	--EMCY_MAX_ERRORS=*) EMCY_MAX_ERRORS=$1;;
   111 	--help)	echo	"Usage: ./configure [options]"
   115 	--help)	echo	"Usage: ./configure [options]"
   112     		echo	"Options:"
   116     		echo	"Options:"
   113     		echo 	" --cc=foo      Use compiler 'foo' instead of defaults ${CC1} or ${CC2}."
   117     		echo 	" --cc=foo      Use compiler 'foo' instead of defaults ${CC1} or ${CC2}."
   114 		echo 	" --arch=foo    Use architecture 'foo' instead of trying to autodetect."
   118 		echo 	" --arch=foo    Use architecture 'foo' instead of trying to autodetect."
   115 		echo 	" --os=foo      Use operative system 'foo' instead of trying to autodetect."
   119 		echo 	" --os=foo      Use operative system 'foo' instead of trying to autodetect."
   141 		echo	" --MAX_CAN_BUS_ID [=1] Number of can bus to use"
   145 		echo	" --MAX_CAN_BUS_ID [=1] Number of can bus to use"
   142 		echo	" --SDO_MAX_LENGTH_TRANSFERT [=32] max bytes to transmit by SDO"
   146 		echo	" --SDO_MAX_LENGTH_TRANSFERT [=32] max bytes to transmit by SDO"
   143 		echo	" --SDO_MAX_SIMULTANEOUS_TRANSFERTS [=4] Number of SDO that the node can manage concurrently"
   147 		echo	" --SDO_MAX_SIMULTANEOUS_TRANSFERTS [=4] Number of SDO that the node can manage concurrently"
   144 		echo	" --NMT_MAX_NODE_ID [=128] can be reduced to gain memory on small network"
   148 		echo	" --NMT_MAX_NODE_ID [=128] can be reduced to gain memory on small network"
   145 		echo	" --SDO_TIMEOUT_MS [=3000] Timeout in milliseconds for SDO (None to disable the feature)"
   149 		echo	" --SDO_TIMEOUT_MS [=3000] Timeout in milliseconds for SDO (None to disable the feature)"
       
   150 		echo	" --EMCY_MAX_ERRORS [=8] Max number of active errors managed in error_data structure"
   146 		exit 0;;
   151 		exit 0;;
   147 	*)		echo "Unknown argument ${1}"; exit -1;;
   152 	*)		echo "Unknown argument ${1}"; exit -1;;
   148 	esac
   153 	esac
   149 
   154 
   150 	shift
   155 	shift
   572  MAX_NB_TIMER\
   577  MAX_NB_TIMER\
   573  CANOPEN_BIG_ENDIAN\
   578  CANOPEN_BIG_ENDIAN\
   574  US_TO_TIMEVAL_FACTOR\
   579  US_TO_TIMEVAL_FACTOR\
   575  TIMEVAL\
   580  TIMEVAL\
   576  TIMEVAL_MAX\
   581  TIMEVAL_MAX\
   577  RTCAN_SOCKET; do
   582  RTCAN_SOCKET\
       
   583  EMCY_MAX_ERRORS; do
   578 if [ "${!i}" = "" ]; then
   584 if [ "${!i}" = "" ]; then
   579 echo "/* $i is not defined */" >> include/config.h
   585 echo "/* $i is not defined */" >> include/config.h
   580 else
   586 else
   581 echo "#define $i ${!i}" >> include/config.h
   587 echo "#define $i ${!i}" >> include/config.h
   582 fi
   588 fi
   583 done	
   589 done	
   584 echo "" >> include/config.h
   590 echo "" >> include/config.h
   585 
   591 
   586 for i in \
   592 for i in \
   587  SDO_MAX_SIMULTANEOUS_TRANSFERTS\
   593  SDO_MAX_SIMULTANEOUS_TRANSFERTS\
   588  NMT_MAX_NODE_ID; do
   594  NMT_MAX_NODE_ID\
       
   595  EMCY_MAX_ERRORS; do
   589 	echo "#define REPEAT_"$i"_TIMES(repeat)\\">> include/config.h
   596 	echo "#define REPEAT_"$i"_TIMES(repeat)\\">> include/config.h
   590 	times=${!i}
   597 	times=${!i}
   591 	result=""
   598 	result=""
   592 	for (( j=0; j<times; j++ ));do
   599 	for (( j=0; j<times; j++ ));do
   593 		result="$result repeat"
   600 		result="$result repeat"