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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [orp/] [orp_soc/] [sw.old/] [utils/] [bin2c.c] - Rev 1782

Compare with Previous | Blame | View Log

#include <stdio.h>
 
int main(void)
{
 
	int c, i = 0;
 
	printf("#ifdef HAVE_CONFIG_H\n");
	printf("# include \"config.h\"\n");
	printf("#endif\n\n");
	printf("#ifdef EMBED\n");
 
	printf("unsigned char flash_data[] = {\n");
 
	while((c = getchar()) != EOF) {
		printf("0x%.2x, ", c);
		if(!(i % 32))
			printf("\n");
		i++;
	}
 
	printf(" };\n");
	printf("#endif\n");
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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