예제 #1
0
파일: Log.c 프로젝트: dhylands/projects-old
void LogError
(
    const char *fmt,    ///< printf style format specifier
    ...                 ///< variable list of arguments
)
{
    va_list args;

#if defined( AVR )
    Log_P( PSTR( "ERROR: " ));

    va_start( args, fmt );
    vLog( fmt, args );
    va_end( args );
#else
    va_start( args, fmt );
    vLogFunc( LOG_LEVEL_ERROR, fmt, args );
    va_end( args );
#endif

} // LogError
예제 #2
0
파일: Menu.c 프로젝트: alshorin/projects
void MENU_Dump( uint8_t indent, MENU_ProgItem_t *menuItem )
{
    uint8_t         i;
    MENU_MemItem_t  item;

    while ( MENU_GetItem( menuItem, &item )->name != NULL )
    {
        for ( i = 0; i < indent; i++ ) 
        {
            Log( "  " );
        }
        Log( "Name: " );
        Log_P( item.name );
        Log( ", type: %d\n", item.type );

        if ( item.type == MENU_TYPE_MENU )
        {
            MENU_Dump( indent + 1, item.val.menu );
        }
        menuItem++;
    }

} // MENU_Dump
예제 #3
0
파일: Log.c 프로젝트: dhylands/projects-old
void LogAssertFailed
(
    const char *expr,
    const char *fileName,
    unsigned    lineNum,
    const char *function
)
{
#if defined( AVR )
    Log_P( PSTR( "ASSERT failed: " ));
    Log_P( fileName );
    Log_P( PSTR( ": %d: " ), lineNum );
    Log_P( function );
    Log_P( PSTR( " Assertion '" ));
    Log_P( expr );
    Log_P( PStR( "' failed.\n" ));
#else
    LogFunc( LOG_LEVEL_ASSERT, "%s: %d: %s Assertion '%s' failed.\n", 
             fileName, lineNum, function, expr );
#endif

} // LogAssertFailed