3 /***************************************************************************
5 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
6 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
7 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
8 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
12 * Copyright (C) 2010 Robert Bieber
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
22 ****************************************************************************/
24 // Printing the do-not-modify warning
25 echo "# ----------------------------------------------------------- #\n";
26 echo "# ----------------------------------------------------------- #\n";
27 echo "# --- This file automatically generated, do not modify! --- #\n";
28 echo "# ----------------------------------------------------------- #\n";
29 echo "# ----------------------------------------------------------- #\n\n";
31 // Importing the target array
32 system('./includetargets.pl');
33 require('./targets.php');
34 unlink('./targets.php');
36 // Looping through all the targets
37 foreach($targets as $target => $plaintext)
39 // Opening a cpp process
40 $configfile = '../../firmware/export/config/' . $target . '.h';
41 if(!file_exists($configfile))
43 $descriptor = array( 0 => array("pipe", "r"), //stdin
44 1 => array("pipe", "w") //stdout
47 $proc = proc_open('cpp', $descriptor, $pipes);
50 die("Failed to open process");
52 // Feeding the input to cpp
53 $input = "#include \"$configfile\"\n";
60 #ifdef HAVE_REMOTE_LCD
76 fwrite($pipes[0], $input);
79 $results = stream_get_contents($pipes[1]);
81 $results = explode("\n", $results);
84 while($results[$base] != 'lcd')
87 // Header for the target
88 echo $target . "\n{\n";
89 echo ' name : ' . $plaintext . "\n";
91 // Writing the LCD dimensions
92 echo ' screen : ' . $results[$base +
1] . ' x ' . $results[$base +
2] . ' @ ';
93 if($results[$base +
3] == 1)
95 else if($results[$base +
3] == 2)
101 // Writing the remote dimensions if necessary
103 if($results[$base +
6] == 0)
109 echo $results[$base +
6] . ' x ' .$results[$base +
7] . ' @ ';
110 if($results[$base +
8] == 1)
112 else if($results[$base +
8] == 2)
119 // Writing FM capability
121 if($results[$base +
12] == 'yes')
127 // Writing record capability
129 if($results[$base +
16] == 'yes')
135 // Closing the target