Compare commits

..

No commits in common. "ba48d53409808e413c4298b7902f28dcaf7ec431" and "6c4dbe94ccb440a2f705f4ce1b9195a6ffb6343a" have entirely different histories.

4 changed files with 3 additions and 9 deletions

View File

@ -173,7 +173,7 @@ void FTDIpp_MPSSE::open_device(const std::string &serial, unsigned int baudrate)
throw std::runtime_error(err);
}
if (_bus == 0 && _addr == 0)
if (_bus == 0 || _addr == 0)
ret = ftdi_usb_open_desc_index(_ftdi, _vid, _pid, NULL, serial.empty() ? NULL : serial.c_str(), _index);
else
#if (FTDI_VERSION < 104)

View File

@ -24,9 +24,6 @@ class Ice40: public Device, SPIInterface {
void program(unsigned int offset, bool unprotect_flash) override;
bool program_cram(const uint8_t *data, uint32_t length);
bool dumpFlash(uint32_t base_addr, uint32_t len) override;
bool detect_flash() override {
return SPIInterface::detect_flash();
}
bool protect_flash(uint32_t len) override;
bool unprotect_flash() override;
bool bulk_erase_flash() override;

View File

@ -57,7 +57,7 @@ int libusb_ll::get_devices_list(const cable_t *cable)
bus_addr = cable->bus_addr;
device_addr = cable->device_addr;
vid_pid_filter = (vid != 0) && (pid != 0);
bus_dev_filter = ~(bus_addr == 0 && device_addr == 0);
bus_dev_filter = (bus_addr != 0) && (device_addr != 0);
}
int i = 0;

View File

@ -305,10 +305,7 @@ int main(int argc, char **argv)
} else if ((args.prg_type == Device::WR_FLASH ||
args.prg_type == Device::WR_SRAM) ||
!args.bit_file.empty() || !args.file_type.empty()) {
if (args.detect_flash)
target->detect_flash();
else
target->program(args.offset, args.unprotect_flash);
target->program(args.offset, args.unprotect_flash);
}
if (args.unprotect_flash && args.bit_file.empty())
if (!target->unprotect_flash())