avrftdi_tpi.c: Adds avrftdi_tpi_disable()
In this function the NVM enable bit in TPISR is written to zero, like described in AVR918. The reset line is released in avrftdi_close(). git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1149 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
parent
f949c94465
commit
d61242c19c
|
@ -20,6 +20,8 @@
|
||||||
#include <libusb-1.0/libusb.h>
|
#include <libusb-1.0/libusb.h>
|
||||||
#include <libftdi1/ftdi.h>
|
#include <libftdi1/ftdi.h>
|
||||||
|
|
||||||
|
static void avrftdi_tpi_disable(PROGRAMMER *);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
avrftdi_debug_frame(uint16_t frame)
|
avrftdi_debug_frame(uint16_t frame)
|
||||||
{
|
{
|
||||||
|
@ -75,8 +77,10 @@ avrftdi_tpi_initialize(PROGRAMMER * pgm, AVRPART * p)
|
||||||
pgm->program_enable = avrftdi_tpi_program_enable;
|
pgm->program_enable = avrftdi_tpi_program_enable;
|
||||||
pgm->cmd_tpi = avrftdi_cmd_tpi;
|
pgm->cmd_tpi = avrftdi_cmd_tpi;
|
||||||
pgm->chip_erase = avrftdi_tpi_chip_erase;
|
pgm->chip_erase = avrftdi_tpi_chip_erase;
|
||||||
//pgm->read_byte = avrftdi_tpi_read_byte;
|
pgm->disable = avrftdi_tpi_disable;
|
||||||
//pgm->write_byte = avrftdi_tpi_write_byte;
|
|
||||||
|
pgm->paged_load = NULL;
|
||||||
|
pgm->paged_write = NULL;
|
||||||
|
|
||||||
log_info("Setting /Reset pin low\n");
|
log_info("Setting /Reset pin low\n");
|
||||||
pdata->set_pin(pgm, PIN_AVR_RESET, OFF);
|
pdata->set_pin(pgm, PIN_AVR_RESET, OFF);
|
||||||
|
@ -341,7 +345,15 @@ avrftdi_tpi_chip_erase(PROGRAMMER * pgm, AVRPART * p)
|
||||||
usleep(p->chip_erase_delay);
|
usleep(p->chip_erase_delay);
|
||||||
pgm->initialize(pgm, p);
|
pgm->initialize(pgm, p);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
avrftdi_tpi_disable(PROGRAMMER * pgm)
|
||||||
|
{
|
||||||
|
log_info("Leaving Programming mode.\n");
|
||||||
|
avrftdi_tpi_write_byte(pgm, TPI_OP_SSTCS(TPIPCR));
|
||||||
|
avrftdi_tpi_write_byte(pgm, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /*HAVE_LIBFTDI*/
|
#else /*HAVE_LIBFTDI*/
|
||||||
|
|
Loading…
Reference in New Issue