Skip to content
Snippets Groups Projects
Commit 20bb25c4 authored by Satoru Yamada's avatar Satoru Yamada
Browse files

Convert pcie40_dma_check with C++.

parent 19f4dfe8
No related branches found
No related tags found
1 merge request!56links
......@@ -59,7 +59,7 @@ PCIE40_UL_LDFLAGS = -L../Pcie40Libraries/lib -lpcie40 -L../Pcie40DriverLibraries
PCIE40_DMA_CHECK :=pcie40_dma_check
PCIE40_DMA_CHECK_OBJS =main_pcie40_dma_check.o
PCIE40_DMA_CHECK_CFLAGS =$(CFLAGS) -I$(TOP) -I$(TOP)/../Pcie40Driver
PCIE40_DMA_CHECK_CXXFLAGS =$(CFLAGS) -I$(TOP) -I$(TOP)/../Pcie40Driver
PCIE40_DMA_CHECK_INSTALL =$(PREFIX)/bin
PCIE40_DMA_CHECK_LDFLAGS = -L../Pcie40Libraries/lib -lpcie40 -L../Pcie40DriverLibraries/ -lpcie40driver_ecs
......
......@@ -17,13 +17,29 @@ int main (int argc ,char** argv) {
else printf("SUCCESS: Device opened for ECS\n");
// Read DMA
res = pcie40_b2dmabufferreset( 0 ) ;
unsigned int * data ;
// unsigned int data[ DMASIZE ] = { 0 } ;
unsigned int * data;
int cnt = 0;
while( 1 ){
printf("Reading... %d\n", cnt );
res = pcie40_b2dmapointerread( 0 , &data ) ;
int i = 0 ;
if ( res == 0 ) printf( "DMA Error\n" ) ;
else {
for (i= 0 ;i < DMASIZE;i++) printf("0X%08x\n",data[i]);
printf("00000000 " );
for (i= 0 ;i < DMASIZE;i++){
printf("%08x ",data[i]);
if( ( i % 8 ) == 7 ){
printf("\n");
printf("%.8x ", i + 1);
}
}
}
usleep(500000);
cnt++;
}
//
ecs_close( 0 , 0 ) ;
ecs_close( 0 , 2 ) ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment