[PATCH 10/11] Firmware upgrade for OSTC3

Anton Lundin glance at acc.umu.se
Mon Dec 15 15:39:45 PST 2014


On 21 November, 2014 - Anton Lundin wrote:

> diff --git a/src/hw_ostc3.c b/src/hw_ostc3.c
> index 5ca26f2..64a861b 100644
> --- a/src/hw_ostc3.c
> +++ b/src/hw_ostc3.c
> @@ -79,6 +79,7 @@ typedef struct hw_ostc3_device_t {
>  		OPEN,
>  		DOWNLOAD,
>  		SERVICE,
> +		REBOOTING,
>  	} state;
>  } hw_ostc3_device_t;
>  
> @@ -319,7 +320,7 @@ hw_ostc3_device_close (dc_device_t *abstract)
>  		return DC_STATUS_INVALIDARGS;
>  
>  	// Send the exit command
> -	if (device->state != OPEN) {
> +	if (device->state != REBOOTING && device->state != OPEN) {
>  		status = hw_ostc3_transfer (device, NULL, EXIT, NULL, 0, NULL, 0);
>  		if (status != DC_STATUS_SUCCESS) {
>  			ERROR (abstract->context, "Failed to send the command.");
> @@ -987,7 +988,121 @@ hw_ostc3_device_upgrade_firmware (dc_device_t *abstract, unsigned int checksum)
>  	// Now the device resets, and if everything is well, it reprograms.
>  	serial_sleep (device->port, 500);
>  
> -	// FIXME: How should we force the application to close the device here?
> +	device->state = REBOOTING;
>  
>  	return DC_STATUS_SUCCESS;
>  }

I found this slip-up and fixed it. This should have bin a part of "Add a
function upgrade the firmware in the OSTC3"

//Anton

-- 
Anton Lundin	+46702-161604


More information about the devel mailing list