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

Subversion Repositories gecko4

[/] [gecko4/] [trunk/] [GECKO4com/] [utils/] [c/] [generate_pud_data.c] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 ktt1
/******************************************************************************/
2
/*            _   _            __   ____                                      */
3
/*           / / | |          / _| |  __|                                     */
4
/*           | |_| |  _   _  / /   | |_                                       */
5
/*           |  _  | | | | | | |   |  _|                                      */
6
/*           | | | | | |_| | \ \_  | |__                                      */
7
/*           |_| |_| \_____|  \__| |____| microLab                            */
8
/*                                                                            */
9
/*           Bern University of Applied Sciences (BFH)                        */
10
/*           Quellgasse 21                                                    */
11
/*           Room HG 4.33                                                     */
12
/*           2501 Biel/Bienne                                                 */
13
/*           Switzerland                                                      */
14
/*                                                                            */
15
/*           http://www.microlab.ch                                           */
16
/******************************************************************************/
17
/*   GECKO4com
18
 
19
     2010/2011 Dr. Theo Kluter
20
 
21
     This program is free software: you can redistribute it and/or modify
22
     it under the terms of the GNU General Public License as published by
23
     the Free Software Foundation, either version 3 of the License, or
24
     (at your option) any later version.
25
 
26
     This program is distributed in the hope that it will be useful,
27
     but WITHOUT ANY WARRANTY; without even the implied warranty of
28
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
29
     GNU General Public License for more details.
30
     You should have received a copy of the GNU General Public License
31
     along with these sources.  If not, see <http://www.gnu.org/licenses/>.
32
*/
33
#include <stdio.h>
34
#include <stdlib.h>
35
#include <string.h>
36
 
37
unsigned char* strs[13] = {
38
" ",
39
"This is a static user window of 13 lines x 64 chars",
40
"It is stored in the last 832 locations of the",
41
"PUD memory an can be used to display for example",
42
"user logos.",
43
" ",
44
"It's contents can be written with the *PUD command",
45
" ",
46
"For further information see http://gecko.microlab.ch",
47
" ",
48
"This is GECKO4main and GECKO4com",
49
" ",
50
"Dr. Theo Kluter 2011"};
51
 
52
 
53
int main() {
54
   unsigned char data[2048];
55
   int loop,index,line,fill;
56
   FILE *ofile;
57
 
58
   for (loop = 0 ; loop < 2048 ; loop++)
59
      data[loop] = 0xFF;
60
   index=2048-832;
61
   for (loop = 0 ; loop < 13 ; loop++) {
62
      line = 0;
63
      for (fill = 0  ; fill <(64-strlen(strs[loop])) / 2; fill++) {
64
         data[index++] = 0x20;
65
         line++;
66
      }
67
      for (fill = 0 ; fill < strlen(strs[loop]) ; fill++) {
68
         data[index++] = strs[loop][fill];
69
         line++;
70
      }
71
      while (line < 64) {
72
         data[index++] = 0x20;
73
         line++;
74
      }
75
   }
76
   printf("%d\n" , index );
77
   ofile=fopen("pud.cmd","w");
78
   fprintf( ofile , "*pud " );
79
   for (loop = 0 ; loop < 2048 ; loop++)
80
      fputc(data[loop],ofile);
81
}

powered by: WebSVN 2.1.0

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