AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/ports/xplained/ASF/common/services/clock/xmega/sysclk.h
static inline uint32_t sysclk_get_per4_hz (void)
  {
    uint8_t shift = 0;

#if XMEGA_E
    if (CONFIG_SYSCLK_PSADIV > SYSCLK_PSADIV_512)
      {
	switch (CONFIG_SYSCLK_PSADIV)
	  {
	  case SYSCLK_PSADIV_6:
	    return sysclk_get_main_hz () / 6;
	  case SYSCLK_PSADIV_10:
	    return sysclk_get_main_hz () / 10;
	  case SYSCLK_PSADIV_12:
	    return sysclk_get_main_hz () / 12;
	  case SYSCLK_PSADIV_24:
	    return sysclk_get_main_hz () / 24;
	  case SYSCLK_PSADIV_48:
	    return sysclk_get_main_hz () / 48;
	  default:
	    //unhandled_case;
	    return 0;
	  }
      }
#endif
    if (CONFIG_SYSCLK_PSADIV & (1U << CLK_PSADIV_gp))
      {
	shift = (CONFIG_SYSCLK_PSADIV >> (1 + CLK_PSADIV_gp)) + 1;
      }

    return sysclk_get_main_hz () >> shift;
  }
/**
 * \brief Return the current rate in Hz of clk_PER4.
 *
 * This clock can run up to four times faster than the CPU clock.
 *
 * \return Frequency of the clk_PER4 clock, in Hz.
 */
\brief Return the current rate in Hz of clk_PER4.
This clock can run up to four times faster than the CPU clock.

\return Frequency of the clk_PER4 clock, in Hz.
\ brief Return the current rate in Hz of clk_PER4 . This clock can run up to four times faster than the CPU clock . \ return Frequency of the clk_PER4 clock in Hz .
static inline uint32_t sysclk_get_per4_hz (void)
  {
    uint8_t shift = 0;
#if XMEGA_E
    if (CONFIG_SYSCLK_PSADIV > SYSCLK_PSADIV_512)
      {
	switch (CONFIG_SYSCLK_PSADIV)
	  {
	  case SYSCLK_PSADIV_6:
	    return sysclk_get_main_hz () / 6;
	  case SYSCLK_PSADIV_10:
	    return sysclk_get_main_hz () / 10;
	  case SYSCLK_PSADIV_12:
	    return sysclk_get_main_hz () / 12;
	  case SYSCLK_PSADIV_24:
	    return sysclk_get_main_hz () / 24;
	  case SYSCLK_PSADIV_48:
	    return sysclk_get_main_hz () / 48;
	  default:
	    return 0;
	  }
      }
#endif
    if (CONFIG_SYSCLK_PSADIV & (1U << CLK_PSADIV_gp))
      {
	shift = (CONFIG_SYSCLK_PSADIV >> (1 + CLK_PSADIV_gp)) + 1;
      }
    return sysclk_get_main_hz () >> shift;
  }
static inline uint32_t sysclk_get_per4_hz ( void ) { uint8_t shift = 0 ; #if XMEGA_E if ( CONFIG_SYSCLK_PSADIV > SYSCLK_PSADIV_512 ) { switch ( CONFIG_SYSCLK_PSADIV ) { case SYSCLK_PSADIV_6 : return sysclk_get_main_hz ( ) / 6 ; case SYSCLK_PSADIV_10 : return sysclk_get_main_hz ( ) / 10 ; case SYSCLK_PSADIV_12 : return sysclk_get_main_hz ( ) / 12 ; case SYSCLK_PSADIV_24 : return sysclk_get_main_hz ( ) / 24 ; case SYSCLK_PSADIV_48 : return sysclk_get_main_hz ( ) / 48 ; default : return 0 ; } } #endif if ( CONFIG_SYSCLK_PSADIV & ( 1U << CLK_PSADIV_gp ) ) { shift = ( CONFIG_SYSCLK_PSADIV >> ( 1 + CLK_PSADIV_gp ) ) + 1 ; } return sysclk_get_main_hz ( ) >> shift ; }
\brief Return the current rate in Hz of clk_PER4.
\ brief Return the current rate in Hz of clk_PER4 .
//unhandled_case;