X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fao-make-product.5c;h=5f2eb8e895557a492405c016336cac51dd3eedea;hp=933032dd6344f3835bfe88d8066ba1c2c508d724;hb=09252ec22d58e946494e4ca2cf367bf3bbe1cc50;hpb=22800dc094797e1e0ad99124198809d0360f7556 diff --git a/src/ao-make-product.5c b/src/ao-make-product.5c index 933032dd..5f2eb8e8 100644 --- a/src/ao-make-product.5c +++ b/src/ao-make-product.5c @@ -37,11 +37,19 @@ write_int(int a, string 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 = { @@ -57,6 +65,12 @@ argdesc argd = { .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', @@ -82,6 +96,7 @@ main() write_ucs2(product, "iProduct"); write_ucs2(sprintf("%06d", serial), "iSerial"); write_int(serial, "iSerial"); + write_hex(id_product, "idProduct"); write_string(version, "iVersion"); }