make default port name easier to configure and setup for my device on iMac
authorH. Nikolaus Schaller <hns@goldelico.com>
Fri, 4 Sep 2020 13:05:50 +0000 (15:05 +0200)
committernotaz <notasas@gmail.com>
Wed, 16 Sep 2020 16:14:45 +0000 (19:14 +0300)
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
flashkit.c

index 9884dd6..00819c4 100644 (file)
@@ -466,11 +466,13 @@ static FILE *open_prep_read(const char *fname, long *size)
        return f;
 }
 
+static const char *portname = "/dev/cu.usbserial-AL0254JM";
+
 static void usage(const char *argv0)
 {
        printf("usage:\n"
                "%s [options]\n"
-               "  -d <ttydevice>      (default /dev/ttyUSB0)\n"
+               "  -d <ttydevice>      (default %s)\n"
                "  -r <file> [size]    dump the cart (default 4MB)\n"
                "  -w <file> [size]    program the flash (def. file size)\n"
                "  -s <file> [size]    simple write (SRAM, etc, def. file size)\n"
@@ -479,7 +481,7 @@ static void usage(const char *argv0)
                "  -8                  8bit flash\n"
                "  -v                  verify written data\n"
                "  -i                  get info about the flash chip\n"
-               , argv0);
+               , argv0, portname);
        exit(1);
 }
 
@@ -504,7 +506,6 @@ static uint8_t g_block2[0x10000];
 
 int main(int argc, char *argv[])
 {
-       const char *portname = "/dev/ttyUSB0";
        const char *fname_w = NULL;
        const char *fname_r = NULL;
        const char *fname_ws = NULL;