OpenCores
URL https://opencores.org/ocsvn/pcie_ds_dma/pcie_ds_dma/trunk

Subversion Repositories pcie_ds_dma

[/] [pcie_ds_dma/] [trunk/] [soft/] [linux/] [common/] [utils/] [tf_workparam.cpp] - Diff between revs 6 and 19

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 6 Rev 19
Line 132... Line 132...
 
 
                        char *ps=*ptr;
                        char *ps=*ptr;
                        if( ps!=NULL )
                        if( ps!=NULL )
                            free( ps );
                            free( ps );
                        ps = (char*)malloc( 128 );
                        ps = (char*)malloc( 128 );
                        *(cfg->ptr)=(U32)ps;
                        //*(cfg->ptr)=(U32)ps;
                        sprintf( ps, "%s", val );
                        sprintf( ps, "%s", val );
 
 
                    }
                    }
                } else if( array_cfg[ii].is_float==3 ) {
                } else if( array_cfg[ii].is_float==3 ) {
                    U32 v;
                    U32 v;
Line 169... Line 169...
    char str[256];
    char str[256];
    int len;
    int len;
    int total=0;
    int total=0;
    U32 ii;
    U32 ii;
    STR_CFG *cfg;
    STR_CFG *cfg;
 
/*
    *((U32*)ptr)=max_item;
    *((U32*)ptr)=max_item;
    total=4;
    total=4;
 
 
    for( ii=0; ii<max_item; ii++ )
    for( ii=0; ii<max_item; ii++ )
    {
    {
        cfg=array_cfg+ii;
        cfg=array_cfg+ii;
        str[0]=0;
        str[0]=0;
        switch( cfg->is_float )
        switch( cfg->is_float )
        {
        {
        case 0: sprintf( str, "%s  %d \r\n", cfg->name, *(cfg->ptr) ); break;
        case 0: sprintf( str, "%s  %d \r\n", cfg->name, *(cfg->ptr) ); break;
        case 1:
        case 1:
            {
            {
                float* v=(float*)(cfg->ptr);
                float* v=(float*)(cfg->ptr);
                sprintf( str, "%s  %g \r\n", cfg->name, *v ); break;
                sprintf( str, "%s  %g \r\n", cfg->name, *v ); break;
            }
            }
            break;
            break;
        case 2:
        case 2:
            {
            {
                if( *(cfg->ptr)==0 )
                if( *(cfg->ptr)==0 )
                {
                {
                    sprintf( str, "%s  \r\n", cfg->name );
                    sprintf( str, "%s  \r\n", cfg->name );
                } else
                } else
                {
                {
                    sprintf( str, "%s  %s \r\n", cfg->name,(char*)(*cfg->ptr) );
                    sprintf( str, "%s  %s \r\n", cfg->name,(char*)(*cfg->ptr) );
                }
                }
 
 
            }
            }
            break;
            break;
 
 
        }
        }
        len=strlen( str )+1;
        len=strlen( str )+1;
        if( (total+len)<(S32)max_size )
        if( (total+len)<(S32)max_size )
        {
        {
            strcpy( ptr+total, str );
            strcpy( ptr+total, str );
            total+=len;
            total+=len;
        }
        }
    }
    }
 
*/
    return total;
    return total;
}
}
 
 
//! Получение параметров из памяти
//! Получение параметров из памяти
void TF_WorkParam::GetParamFromMemory( char* ptr )
void TF_WorkParam::GetParamFromMemory( char* ptr )
Line 219... Line 220...
    U32 len;
    U32 len;
    U32 n;
    U32 n;
    n=*((U32*)ptr);
    n=*((U32*)ptr);
    U32 ii;
    U32 ii;
    int total=4;
    int total=4;
 
/*
    for( ii=0; ii<n; ii++ )
    for( ii=0; ii<n; ii++ )
    {
    {
        src=ptr+total;
        src=ptr+total;
        len=GetParamFromStr( src );
        len=GetParamFromStr( src );
        total+=len;
        total+=len;
    }
    }
 
*/
}
}
 
 
 
 
//! Отображение параметров
//! Отображение параметров
void TF_WorkParam::ShowParam( void )
void TF_WorkParam::ShowParam( void )

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.