Reset the device, so it will possibly start executing the programmed code.
@@ -61,7 +61,7 @@ struct lpc_device *lpc_setup(struct serial_device *port) {
dev = malloc(sizeof(struct lpc_device));
dev->port = port;
dev->part = NULL;
- dev->reply_time = 500;
+ dev->reply_time = 5000;
lpc_reset(dev, 1);
return dev;
}
@@ -345,6 +345,7 @@ void lpc_reset(struct lpc_device *dev, int isp) {
void lpc_close(struct lpc_device *dev) {
+ lpc_reset(dev, 0);
serial_close(dev->port);
free(dev);
@@ -54,8 +54,10 @@ void sprog_process(const struct sprog_family *fam, void *arg, const struct sprog
fam->init(arg);
if(mode==1)
fam->exec(arg, d);
- else if(mode==2)
+ else if(mode==2) {
fam->write(arg, d);
+ fam->close(d);
+ }
void sprog_load(struct sprog_data *d, const char *path) {