From fd3e84941de463fa1a7ebab0a69515b4bf2614cd Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 7 Oct 2014 11:25:20 +0200 Subject: Removed copy of FPGA source files. --- .../usrp2/opencores/spi_boot/sw/misc/bit_reverse.c | 74 ---------------------- 1 file changed, 74 deletions(-) delete mode 100644 fpga/usrp2/opencores/spi_boot/sw/misc/bit_reverse.c (limited to 'fpga/usrp2/opencores/spi_boot/sw') diff --git a/fpga/usrp2/opencores/spi_boot/sw/misc/bit_reverse.c b/fpga/usrp2/opencores/spi_boot/sw/misc/bit_reverse.c deleted file mode 100644 index 9defb106a..000000000 --- a/fpga/usrp2/opencores/spi_boot/sw/misc/bit_reverse.c +++ /dev/null @@ -1,74 +0,0 @@ -// Altera requires configuration bytes to be sent LSB first but the -// SD Card reads bytes MSB first -// This code reverses the bits of the altera bitstream so -// it will come out correct when read from the SD card -// $Log: bit_reverse.c,v $ -// Revision 1.1 2006/01/06 14:44:17 mbl -// initial version -// - - - -#include "stdio.h" -#include "string.h" - -FILE* fileOut; -FILE* fileIn; - -void outIOerror(char* pfn); -void inIOerror(char* pfn); - -int main(int argc, char* arg[]) -{ - unsigned char input, output; - unsigned char in_mask, out_mask; - int i; - - fileOut = fopen(arg[2],"wb"); - if (fileOut == NULL) - { - outIOerror(arg[2]); - exit(-1); - } - - printf("Opening input file %s\n", arg[1]); - fileIn = fopen(arg[1],"rb"); - if (fileIn == NULL) - { - inIOerror(arg[1]); - exit(-1); - } - - while (!feof(fileIn) && fgets((char*)&input, 2 ,fileIn) != NULL) - { - in_mask = 1; - out_mask = 0x80; - output = 0; - - for ( i=0; i < 8; ++i ) - { - if (input & in_mask) - { - output |= out_mask; - } - out_mask = out_mask >> 1; - in_mask = in_mask << 1; - } - fwrite((void*)&output,sizeof(char),1,fileOut); - } - - fclose(fileIn); - fclose(fileOut); - printf("\n%s has been created\n", arg[2]); - exit(0); -} - -void outIOerror(char *pfn) -{ - printf("I/O Error while writing to file=%s\n",pfn); -} - -void inIOerror(char *pfn) -{ - printf("I/O Error while reading file=%s\n",pfn); -} -- cgit v1.2.3