OpenCores
URL https://opencores.org/ocsvn/kiss-board/kiss-board/trunk

Subversion Repositories kiss-board

[/] [kiss-board/] [tags/] [initial/] [kiss-board_soc/] [sw/] [utils/] [bin2c.c] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 fukuchi
#include <stdio.h>
2
 
3
int main(void)
4
{
5
 
6
        int c, i = 0;
7
 
8
        printf("#ifdef HAVE_CONFIG_H\n");
9
        printf("# include \"config.h\"\n");
10
        printf("#endif\n\n");
11
        printf("#ifdef EMBED\n");
12
 
13
        printf("unsigned char flash_data[] = {\n");
14
 
15
        while((c = getchar()) != EOF) {
16
                printf("0x%.2x, ", c);
17
                if(!(i % 32))
18
                        printf("\n");
19
                i++;
20
        }
21
 
22
        printf(" };\n");
23
        printf("#endif\n");
24
        return(0);
25
}

powered by: WebSVN 2.1.0

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