X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=flashkit.c;h=e6d57856450545d510f7acb4899c57b10fa184ee;hb=11d3b79ec66be7131ce7a4a69a186a37c92563f9;hp=9884dd62cd5f6bd06ca656569a0d09e027a1d993;hpb=f34ac796daecb84b7228c4eb6aa971039cb4dba8;p=flashkit-mdc.git diff --git a/flashkit.c b/flashkit.c index 9884dd6..e6d5785 100644 --- a/flashkit.c +++ b/flashkit.c @@ -48,7 +48,7 @@ enum dev_cmd { CMD_RY = 4, CMD_DELAY = 5, }; -#define PAR_MODE8 (1 << 4) +#define PAR_MODE8 (1 << 4) /* but still drives noth LWR and UWR */ #define PAR_DEV_ID (1 << 5) #define PAR_SINGE (1 << 6) #define PAR_INC (1 << 7) @@ -466,11 +466,18 @@ static FILE *open_prep_read(const char *fname, long *size) return f; } +static const char *portname = +#ifdef __APPLE__ + "/dev/cu.usbserial-AL0254JM"; +#else + "/dev/ttyUSB0"; +#endif + static void usage(const char *argv0) { printf("usage:\n" "%s [options]\n" - " -d (default /dev/ttyUSB0)\n" + " -d (default %s)\n" " -r [size] dump the cart (default 4MB)\n" " -w [size] program the flash (def. file size)\n" " -s [size] simple write (SRAM, etc, def. file size)\n" @@ -479,7 +486,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 +511,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;