From c53f70238122ce394eb45aa471feebc54515b9ca Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 17 Apr 2012 07:41:20 +0000 Subject: Added timeout on PHY detection setting. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4105 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/mac_lld.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'os/hal/platforms/STM32/mac_lld.h') diff --git a/os/hal/platforms/STM32/mac_lld.h b/os/hal/platforms/STM32/mac_lld.h index 81050053c..3bedc38a2 100644 --- a/os/hal/platforms/STM32/mac_lld.h +++ b/os/hal/platforms/STM32/mac_lld.h @@ -141,6 +141,19 @@ #define STM32_MAC_BUFFERS_SIZE 1518 #endif +/** + * @brief PHY detection timeout. + * @details Timeout, in milliseconds, for PHY address detection, if a PHY + * is not detected within the timeout then the driver halts during + * initialization. This setting applies only if the PHY address is + * not explicitly set in the board header file using + * @p BOARD_PHY_ADDRESS. A zero value disables the timeout and a + * single search path is performed. + */ +#if !defined(STM32_MAC_PHY_TIMEOUT) || defined(__DOXYGEN__) +#define STM32_MAC_PHY_TIMEOUT 100 +#endif + /** * @brief ETHD1 interrupt priority level setting. */ @@ -170,6 +183,10 @@ /* Derived constants and error checks. */ /*===========================================================================*/ +#if (STM32_MAC_PHY_TIMEOUT > 0) && !HAL_IMPLEMENTS_COUNTERS +#error "STM32_MAC_PHY_TIMEOUT requires the realtime counter service" +#endif + /*===========================================================================*/ /* Driver data structures and types. */ /*===========================================================================*/ -- cgit v1.2.3