Read programmer serial number from libusb or hidusb (#1223)

* Silence compiler warnings

* Fix a fall-through error in switch

* Slightly reformat programmer info printout
Now the target voltage is printed out along with the HW version, FW version and serial number, and they all allign nicely. When in ISP mode, the "SCK period" value is printed _after_ the target voltage readout, and _before_ the additional clocks the programmer holds, such as JTAG, PDI and UPDI clocks.

Co-authored-by: Stefan Rueger <stefan.rueger@urclocks.com>
This commit is contained in:
Hans
2022-12-21 20:11:31 +01:00
committed by GitHub
parent a696c94d8f
commit c991ae9739
6 changed files with 191 additions and 95 deletions

View File

@@ -649,6 +649,7 @@ union pinfo
struct serial_device {
// open should return -1 on error, other values on success
int (*open)(const char *port, union pinfo pinfo, union filedescriptor *fd);
const char *(*serno)();
int (*setparams)(const union filedescriptor *fd, long baud, unsigned long cflags);
void (*close)(union filedescriptor *fd);
@@ -671,6 +672,7 @@ extern struct serial_device avrdoper_serdev;
extern struct serial_device usbhid_serdev;
#define serial_open (serdev->open)
#define serial_serno (serdev->serno)
#define serial_setparams (serdev->setparams)
#define serial_close (serdev->close)
#define serial_send (serdev->send)