From 4f0568d030fb5d8bcf90ff76c2b01360cc99ce07 Mon Sep 17 00:00:00 2001 From: Aaron Stone Date: Tue, 17 Dec 2013 12:47:19 -0800 Subject: commandline: pretty sure this should be a comparison not an assignment --- commandline/library/micronucleus_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commandline/library') diff --git a/commandline/library/micronucleus_lib.c b/commandline/library/micronucleus_lib.c index 6bbf04c..47a3952 100644 --- a/commandline/library/micronucleus_lib.c +++ b/commandline/library/micronucleus_lib.c @@ -102,7 +102,7 @@ int micronucleus_eraseFlash(micronucleus* deviceHandle, micronucleus_callback pr Assertion failed: (res >= 4), function micronucleus_connect, file library/micronucleus_lib.c, line 63. */ if (res == -5 || res == -34 || res == -84) { - if (res = -34) { + if (res == -34) { usb_close(deviceHandle->device); deviceHandle->device = NULL; } -- cgit v1.2.3 From e8fc0bd1c7af9d7018df37876806c8ee5afc7c3c Mon Sep 17 00:00:00 2001 From: Aaron Stone Date: Tue, 17 Dec 2013 12:48:10 -0800 Subject: commandline: silence a warning since this is used correctly --- commandline/library/micronucleus_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commandline/library') diff --git a/commandline/library/micronucleus_lib.c b/commandline/library/micronucleus_lib.c index 47a3952..8774e25 100644 --- a/commandline/library/micronucleus_lib.c +++ b/commandline/library/micronucleus_lib.c @@ -60,7 +60,7 @@ micronucleus* micronucleus_connect() { // get nucleus info unsigned char buffer[4]; - int res = usb_control_msg(nucleus->device, 0xC0, 0, 0, 0, buffer, 4, MICRONUCLEUS_USB_TIMEOUT); + int res = usb_control_msg(nucleus->device, 0xC0, 0, 0, 0, (char *)buffer, 4, MICRONUCLEUS_USB_TIMEOUT); assert(res >= 4); nucleus->flash_size = (buffer[0]<<8) + buffer[1]; -- cgit v1.2.3 From ed8501462ec235d1dd34afd21ef3fbab484055c4 Mon Sep 17 00:00:00 2001 From: Aaron Stone Date: Tue, 17 Dec 2013 12:51:17 -0800 Subject: commandline: use C automatic stringification --- commandline/library/micronucleus_lib.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'commandline/library') diff --git a/commandline/library/micronucleus_lib.c b/commandline/library/micronucleus_lib.c index 8774e25..9b73d46 100644 --- a/commandline/library/micronucleus_lib.c +++ b/commandline/library/micronucleus_lib.c @@ -50,10 +50,12 @@ micronucleus* micronucleus_connect() { nucleus->version.minor = dev->descriptor.bcdDevice & 0xFF; if (nucleus->version.major > MICRONUCLEUS_MAX_MAJOR_VERSION) { - fprintf(stderr, "Warning: device with unknown new version of Micronucleus detected.\n"); - fprintf(stderr, "This tool doesn't know how to upload to this new device. Updates may be available.\n"); - fprintf(stderr, "Device reports version as: %d.%d\n", nucleus->version.major, nucleus->version.minor); - return NULL; + fprintf(stderr, + "Warning: device with unknown new version of Micronucleus detected.\n" + "This tool doesn't know how to upload to this new device. Updates may be available.\n" + "Device reports version as: %d.%d\n", + nucleus->version.major, nucleus->version.minor); + return NULL; } nucleus->device = usb_open(dev); -- cgit v1.2.3 From d9e1adda960b22b9571a04b79d1a261983e6e11a Mon Sep 17 00:00:00 2001 From: Aaron Stone Date: Tue, 17 Dec 2013 12:53:29 -0800 Subject: commandline: whitespace --- commandline/library/micronucleus_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commandline/library') diff --git a/commandline/library/micronucleus_lib.c b/commandline/library/micronucleus_lib.c index 9b73d46..b9bceb2 100644 --- a/commandline/library/micronucleus_lib.c +++ b/commandline/library/micronucleus_lib.c @@ -151,7 +151,7 @@ int micronucleus_writeFlash(micronucleus* deviceHandle, unsigned int program_siz // give microcontroller enough time to write this page and come back online delay(deviceHandle->write_sleep); - + if (res != page_length) return -1; } -- cgit v1.2.3