Compare commits
3 Commits
6c4dbe94cc
...
ba48d53409
| Author | SHA1 | Date |
|---|---|---|
|
|
ba48d53409 | |
|
|
e135f1820b | |
|
|
10ba59c1ec |
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ 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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -305,7 +305,10 @@ 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()) {
|
||||
target->program(args.offset, args.unprotect_flash);
|
||||
if (args.detect_flash)
|
||||
target->detect_flash();
|
||||
else
|
||||
target->program(args.offset, args.unprotect_flash);
|
||||
}
|
||||
if (args.unprotect_flash && args.bit_file.empty())
|
||||
if (!target->unprotect_flash())
|
||||
|
|
|
|||
Loading…
Reference in New Issue