summaryrefslogtreecommitdiff
path: root/src/ao-make-product.5c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-08-25 20:43:44 -0700
committerKeith Packard <keithp@keithp.com>2011-08-25 20:49:11 -0700
commit9513be7f9d3d0b0ec29f6487fa9dc8f1ac24d0de (patch)
tree6cfa006884cab18f56e95c79c3268df4817885f1 /src/ao-make-product.5c
parent3bfe8df44b575ca430ffaa051e20faa955a06c03 (diff)
altos: Restructure altos build to prepare for multi-arch support
Split out sources into separate directories: core: architecture and product independent bits cc1111: cc1111-specific code drivers: architecture independent drivers product: product-specific sources and Makefile fragments util: scripts for building stuff This should have no effect on the built products, but testing is encouraged Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao-make-product.5c')
-rw-r--r--src/ao-make-product.5c103
1 files changed, 0 insertions, 103 deletions
diff --git a/src/ao-make-product.5c b/src/ao-make-product.5c
deleted file mode 100644
index 5f2eb8e8..00000000
--- a/src/ao-make-product.5c
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/sh
-
-autoimport ParseArgs;
-
-void
-write_ucs2(string a, string description)
-{
- int len = String::length(a);
-
- printf("/* %s */\n", description);
- printf("#define AO_%s_LEN 0x%02x\n", description, len * 2 + 2);
- printf("#define AO_%s_STRING \"%s\"\n", description, a);
- printf("#define AO_%s_UCS2", description);
- for (int i = 0; i < len; i++) {
- int c = a[i];
- if (i > 0)
- printf(",");
- if (0x20 <= c && c < 128)
- printf(" '%c', 0", c);
- else
- printf(" LE_WORD(0x%04x),", c);
- }
- printf("\n\n");
-}
-
-void
-write_string(string a, string description)
-{
- printf ("/* %s */\n", description);
- printf ("#define AO_%s_STRING \"%s\"\n", description, a);
-}
-
-void
-write_int(int a, string description)
-{
- printf ("/* %s */\n", description);
- printf ("#define AO_%s_NUMBER %d\n\n", description, a);
-}
-
-void
-write_hex(int a, string description)
-{
- printf ("/* %s */\n", description);
- printf ("#define AO_%s_NUMBER 0x%04x\n\n", description, a);
-}
-
-string manufacturer = "altusmetrum.org";
-string product = "TeleMetrum";
-string version = "0.0";
-int serial = 1;
-int user_argind = 0;
-int id_product = 0x000a;
-
-argdesc argd = {
- .args = {
- {
- .var = { .arg_string = &manufacturer },
- .abbr = 'm',
- .name = "manufacturer",
- .expr_name = "manf",
- .desc = "Manufacturer name." },
- {
- .var = { .arg_string = &product },
- .abbr = 'p',
- .name = "product",
- .expr_name = "prod",
- .desc = "Product name." },
- {
- .var = { .arg_int = &id_product },
- .abbr = 'i',
- .name = "id_product",
- .expr_name = "id_p",
- .desc = "Product ID." },
- {
- .var = { .arg_int = &serial },
- .abbr = 's',
- .name = "serial",
- .expr_name = "number",
- .desc = "Serial number." },
- {
- .var = { .arg_string = &version },
- .abbr = 'v',
- .name = "version",
- .expr_name = "string",
- .desc = "Program version." },
- },
- .prog_name = "usb descriptors",
-};
-
-void
-main()
-{
- string[dim(argv)-1] nargv = {[n] = argv[n+1]};
- parseargs(&argd, &nargv);
- write_ucs2(manufacturer, "iManufacturer");
- write_ucs2(product, "iProduct");
- write_ucs2(sprintf("%06d", serial), "iSerial");
- write_int(serial, "iSerial");
- write_hex(id_product, "idProduct");
- write_string(version, "iVersion");
-}
-
-main();