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 // This is the array of targets, with the target id as the key and the
25 // plaintext name of the target as the value
26 $targets = array( 'ipod1g2g' => 'iPod 1st/2nd Gen',
27 'ipodcolor' => 'iPod Color',
28 'ipodmini2g' => 'iPod Mini 2nd Gen',
29 'mrobe500' => 'm%:robe 500'
32 // Looping through all the targets
33 foreach($targets as $target => $plaintext)
35 // Opening a cpp process
36 $configfile = '../../firmware/export/config/' . $target . '.h';
37 $descriptor = array( 0 => array("pipe", "r"), //stdin
38 1 => array("pipe", "w") //stdout
41 $proc = proc_open('cpp', $descriptor, $pipes);
44 die("Failed to open process");
46 // Feeding the input to cpp
47 $input = "#include \"$configfile\"\n";
54 #ifdef HAVE_REMOTE_LCD
70 fwrite($pipes[0], $input);
73 $results = stream_get_contents($pipes[1]);
75 $results = explode("\n", $results);
77 // Header for the target
78 echo $target . "\n{\n";
79 echo ' name : ' . $plaintext . "\n";
81 // Writing the LCD dimensions
82 echo ' screen : ' . $results[7] . ' x ' . $results[8] . ' @ ';
85 else if($results[10] == 2)
91 // Writing the remote dimensions if necessary
99 echo $results[12] . ' x ' .$results[13] . ' @ ';
100 if($results[14] == 1)
102 else if($results[14] == 2)
109 // Writing FM capability
111 if($results[18] == 'yes')
117 // Writing record capability
119 if($results[22] == 'yes')
125 // Closing the target