• R/O
  • SSH
  • HTTPS

avrdude: 提交


Commit MetaInfo

修訂1474 (tree)
時間2020-05-31 06:39:17
作者gottfried

Log Message

fixed bug with USB devices (has no pgm or spi mode)

Change Summary

差異

--- trunk/term.cpp (revision 1473)
+++ trunk/term.cpp (revision 1474)
@@ -730,6 +730,12 @@
730730 static int cmd_spi(PROGRAMMER * pgm, struct avrpart * p,
731731 int argc, char * argv[])
732732 {
733+ if(!pgm->setpin)
734+ {
735+ // fixed bug: USB device has no SPI mode
736+ avrdude_message(MSG_INFO, "Device has no SPI mode!\n");
737+ return 0;
738+ }
733739 pgm->setpin(pgm, PIN_AVR_RESET, 1);
734740 spi_mode = 1;
735741 return 0;
@@ -738,6 +744,12 @@
738744 static int cmd_pgm(PROGRAMMER * pgm, struct avrpart * p,
739745 int argc, char * argv[])
740746 {
747+ if(!pgm->setpin)
748+ {
749+ // fixed bug: USB device has no pgm mode
750+ avrdude_message(MSG_INFO, "Device has no direct programming mode!\n");
751+ return 0;
752+ }
741753 pgm->setpin(pgm, PIN_AVR_RESET, 0);
742754 spi_mode = 0;
743755 pgm->initialize(pgm, p);
Show on old repository browser