Add printing of chip voltage ranges to print_wiki.c
- add voltage ranges
- center some headers (test values OK, No, ? are centered via wiki templates)
- fix style error in header (align:right -> text-align:right)
Corresponding to flashrom svn r1441.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
diff --git a/print_wiki.c b/print_wiki.c
index 74479a5..c3ca1f4 100644
--- a/print_wiki.c
+++ b/print_wiki.c
@@ -29,7 +29,8 @@
static const char wiki_header[] = "= Supported devices =\n\n\
<div style=\"margin-top:0.5em; padding:0.5em 0.5em 0.5em 0.5em; \
-background-color:#eeeeee; align:right; border:1px solid #aabbcc;\"><small>\n\
+background-color:#eeeeee; text-align:right; border:1px solid #aabbcc;\">\
+<small>\n\
Please do '''not''' edit these tables in the wiki directly, they are \
generated by pasting '''flashrom -z''' output.<br />\
'''Last update:''' %s(generated by flashrom %s)\n</small></div>\n";
@@ -37,12 +38,13 @@
#if CONFIG_INTERNAL == 1
static const char chipset_th[] = "{| border=\"0\" style=\"font-size: smaller\"\n\
|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
-! align=\"left\" | Southbridge\n! align=\"left\" | PCI IDs\n\
-! align=\"left\" | Status\n\n";
+! align=\"left\" | Southbridge\n! align=\"center\" | PCI IDs\n\
+! align=\"center\" | Status\n\n";
static const char board_th[] = "{| border=\"0\" style=\"font-size: smaller\" \
valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
-! align=\"left\" | Mainboard\n! align=\"left\" | Required option\n! align=\"left\" | Status\n\n";
+! align=\"left\" | Mainboard\n! align=\"left\" | Required option\n\
+! align=\"center\" | Status\n\n";
static const char board_intro[] = "\
\n== Supported mainboards ==\n\n\
@@ -57,20 +59,26 @@
further verified mainboards on the [[Mailinglist|mailing list]].\n";
#endif
-static const char chip_th[] = "{| border=\"0\" style=\"font-size: smaller\" \
-valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
-! align=\"left\" | Device\n! align=\"left\" | Size / kB\n\
-! align=\"left\" | Type\n! align=\"left\" colspan=\"4\" | Status\n\n\
+static const char chip_th[] = "{\
+| border=\"0\" style=\"font-size: smaller\" valign=\"top\"\n\
+|- bgcolor=\"#6699dd\"\n\
+! align=\"left\" | Vendor\n\
+! align=\"left\" | Device\n\
+! align=\"center\" | Size [kB]\n\
+! align=\"center\" | Type\n\
+! align=\"center\" colspan=\"4\" | Status\n\
+! align=\"center\" colspan=\"2\" | Voltage [V]\n\n\
|- bgcolor=\"#6699ff\"\n| colspan=\"4\" | \n\
-| Probe\n| Read\n| Erase\n| Write\n\n";
+| Probe\n| Read\n| Erase\n| Write\n\
+| align=\"center\" | min \n| align=\"center\" | max\n\n";
static const char programmer_section[] = "\
\n== Supported programmers ==\n\nThis is a list \
of supported PCI devices flashrom can use as programmer:\n\n{| border=\"0\" \
valign=\"top\"\n| valign=\"top\"|\n\n{| border=\"0\" style=\"font-size: \
smaller\" valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
-! align=\"left\" | Device\n! align=\"left\" | PCI IDs\n\
-! align=\"left\" | Status\n\n";
+! align=\"left\" | Device\n! align=\"center\" | PCI IDs\n\
+! align=\"center\" | Status\n\n";
#if CONFIG_INTERNAL == 1
static const char laptop_intro[] = "\n== Supported laptops/notebooks ==\n\n\
@@ -204,6 +212,8 @@
const struct flashchip *f, *old = NULL;
uint32_t t;
char *s;
+ char vmax[6];
+ char vmin[6];
for (f = flashchips; f->name != NULL; f++) {
/* Don't count "unknown XXXX SPI chip" entries. */
@@ -227,8 +237,13 @@
t = f->tested;
s = flashbuses_to_text(f->bustype);
- printf("|- bgcolor=\"#%s\"\n| %s || %s || %d "
- "|| %s || {{%s}} || {{%s}} || {{%s}} || {{%s}}\n",
+ sprintf(vmin, "%0.03f", f->voltage.min / (double)1000);
+ sprintf(vmax, "%0.03f", f->voltage.max / (double)1000);
+ /* '{{%s}}' is used in combination with 'OK', 'No' and '?3' to
+ * select special formatting templates for the bg color. */
+ printf("|- bgcolor=\"#%s\"\n| %s || %s || align=\"right\" | %d "
+ "|| %s || {{%s}} || {{%s}} || {{%s}} || {{%s}}"
+ "|| %s || %s \n",
(c == 1) ? "eeeeee" : "dddddd", f->vendor, f->name,
f->total_size, s,
(t & TEST_OK_PROBE) ? "OK" :
@@ -238,7 +253,9 @@
(t & TEST_OK_ERASE) ? "OK" :
(t & TEST_BAD_ERASE) ? "No" : "?3",
(t & TEST_OK_WRITE) ? "OK" :
- (t & TEST_BAD_WRITE) ? "No" : "?3");
+ (t & TEST_BAD_WRITE) ? "No" : "?3",
+ f->voltage.min ? vmin : "N/A",
+ f->voltage.min ? vmax : "N/A");
free(s);
/* Split table into 'cols' columns. */