diff options
author | matt | 2008-12-07 01:33:50 +0000 |
---|---|---|
committer | matt | 2008-12-07 01:33:50 +0000 |
commit | 11095bc27990afc62defa06e4304fe26b0457ae6 (patch) | |
tree | ee17031c091488e58aa7ebc15fbf02212191b0b3 /usrp2/firmware | |
parent | b399cfc25429a232aa7a46c8d6ee0765f275588e (diff) | |
download | gnuradio-11095bc27990afc62defa06e4304fe26b0457ae6.tar.gz gnuradio-11095bc27990afc62defa06e4304fe26b0457ae6.tar.bz2 gnuradio-11095bc27990afc62defa06e4304fe26b0457ae6.zip |
split test out into a function
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10109 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'usrp2/firmware')
-rw-r--r-- | usrp2/firmware/apps/test_ram.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/usrp2/firmware/apps/test_ram.c b/usrp2/firmware/apps/test_ram.c index a0bb58251..77ee693f6 100644 --- a/usrp2/firmware/apps/test_ram.c +++ b/usrp2/firmware/apps/test_ram.c @@ -43,38 +43,31 @@ #define BUFSIZE 128 -int -main(void) +int test_ram() { int i,j,k; - - u2_init(); - //hal_uart_init(); - //puts("\ntest_ram\n"); - output_regs->ram_page = 1<<10; - + extram[0] = 0xDEADBEEF; extram[1] = 0xF00D1234; extram[7] = 0x76543210; - + output_regs->ram_page = 2<<10; extram[7] = 0x55555555; extram[1] = 0xaaaaaaaa; extram[0] = 0xeeeeeeee; - + output_regs->ram_page = 1<<10; - + i = extram[0]; k = extram[1]; j = extram[7]; - + if((i != 0xDEADBEEF)||(j!=0x76543210)||(k!=0xF00D1234)) { puts("RAM FAIL1!\n"); puthex32_nl(i); puthex32_nl(j); puthex32_nl(k); - hal_finish(); return 0; } @@ -89,11 +82,23 @@ main(void) puthex32_nl(i); puthex32_nl(j); puthex32_nl(k); - hal_finish(); return 0; } + return 1; +} + +int +main(void) +{ + + u2_init(); + puts("\ntest_ram\n"); + int success = test_ram(); + if(success) + puts("RAM Passed Tests\n"); + else + puts("RAM Failed\n"); - puts("RAM Passes Tests\n"); hal_finish(); return 0; } |