pattern.c
void vCheckNextPattern( uint32_t* ulPatternCount, const uint32_t ulPatternLength, patterns_t* eCurrentPattern )
{
    *ulPatternCount += configPATTERN_TASK_TIME_MS;
    if ( *ulPatternCount >= ulPatternLength )
    {
        /* Switch to new pattern and reset the counter. */
        *eCurrentPattern = ( patterns_t )( *eCurrentPattern + 1 );
        if ( *eCurrentPattern == AUDIO_PATTERNS )
        {
            *eCurrentPattern = ( patterns_t )( *eCurrentPattern + 1 );
        }

#if ( configALL == 1 )
        *eCurrentPattern = ( patterns_t )( *eCurrentPattern % LAST_PATTERN );
#elif ( configNO_AUDIO == 1 )
        *eCurrentPattern = ( patterns_t )( *eCurrentPattern % AUDIO_PATTERNS );
#elif ( configONLY_AUDIO == 1 )
        *eCurrentPattern = ( patterns_t )( *eCurrentPattern % LAST_PATTERN );
        if ( *eCurrentPattern == 0 )
        {
            *eCurrentPattern = ( patterns_t )( AUDIO_PATTERNS + 1 );
        }
#endif

#if ( configSKIP_AUDIO_DEBUG == 1 )
        if ( *eCurrentPattern == RGB_AUDIO )
        {
            // Assumes there is always at least one higher audio pattern
            *eCurrentPattern = ( patterns_t )( *eCurrentPattern + 1 );
        }
#endif

        *ulPatternCount = 0;
    }
}
/**
  * @brief  Check for the next pattern.
  * @retval None
  */
@brief  Check for the next pattern.
@retval None
@brief Check for the next pattern . @retval None
void vCheckNextPattern( uint32_t* ulPatternCount, const uint32_t ulPatternLength, patterns_t* eCurrentPattern )
{
    *ulPatternCount += configPATTERN_TASK_TIME_MS;
    if ( *ulPatternCount >= ulPatternLength )
    {
        *eCurrentPattern = ( patterns_t )( *eCurrentPattern + 1 );
        if ( *eCurrentPattern == AUDIO_PATTERNS )
        {
            *eCurrentPattern = ( patterns_t )( *eCurrentPattern + 1 );
        }
#if ( configALL == 1 )
        *eCurrentPattern = ( patterns_t )( *eCurrentPattern % LAST_PATTERN );
#elif ( configNO_AUDIO == 1 )
        *eCurrentPattern = ( patterns_t )( *eCurrentPattern % AUDIO_PATTERNS );
#elif ( configONLY_AUDIO == 1 )
        *eCurrentPattern = ( patterns_t )( *eCurrentPattern % LAST_PATTERN );
        if ( *eCurrentPattern == 0 )
        {
            *eCurrentPattern = ( patterns_t )( AUDIO_PATTERNS + 1 );
        }
#endif
#if ( configSKIP_AUDIO_DEBUG == 1 )
        if ( *eCurrentPattern == RGB_AUDIO )
        {
            *eCurrentPattern = ( patterns_t )( *eCurrentPattern + 1 );
        }
#endif
        *ulPatternCount = 0;
    }
}
void vCheckNextPattern ( uint32_t * ulPatternCount , const uint32_t ulPatternLength , patterns_t * eCurrentPattern ) { * ulPatternCount += configPATTERN_TASK_TIME_MS ; if ( * ulPatternCount >= ulPatternLength ) { * eCurrentPattern = ( patterns_t ) ( * eCurrentPattern + 1 ) ; if ( * eCurrentPattern == AUDIO_PATTERNS ) { * eCurrentPattern = ( patterns_t ) ( * eCurrentPattern + 1 ) ; } #if ( configALL == 1 ) * eCurrentPattern = ( patterns_t ) ( * eCurrentPattern % LAST_PATTERN ) ; #elif ( configNO_AUDIO == 1 ) * eCurrentPattern = ( patterns_t ) ( * eCurrentPattern % AUDIO_PATTERNS ) ; #elif ( configONLY_AUDIO == 1 ) * eCurrentPattern = ( patterns_t ) ( * eCurrentPattern % LAST_PATTERN ) ; if ( * eCurrentPattern == 0 ) { * eCurrentPattern = ( patterns_t ) ( AUDIO_PATTERNS + 1 ) ; } #endif #if ( configSKIP_AUDIO_DEBUG == 1 ) if ( * eCurrentPattern == RGB_AUDIO ) { * eCurrentPattern = ( patterns_t ) ( * eCurrentPattern + 1 ) ; } #endif * ulPatternCount = 0 ; } }
@brief  Check for the next pattern.
@brief Check for the next pattern .
/* Switch to new pattern and reset the counter. */ // Assumes there is always at least one higher audio pattern