nickgammon/arduino_sketches

Atmega_Board_Detector patch

gknauf opened this issue · 1 comments

Here's a patch similar to issue #39 but for Atmega_Board_Detector sketch;
as I did read the patch to signature.h should go to Atmega_Hex_Uploader ...

--- Atmega_Board_Detector.ino.orig  2016-08-31 07:31:47 +0200
+++ Atmega_Board_Detector.ino   2016-09-15 19:14:16 +0200
@@ -72,6 +72,7 @@
  or the use or other dealings in the software.

 */
+#pragma GCC optimize ("-O0") // avoid GCC memcpy inline

 #include <SPI.h>
 extern "C"
@@ -327,6 +328,8 @@
     // show address
     if (i % 16 == 0)
       {
+      if ((addr + i) < 16)
+        Serial.print (F("0"));
       Serial.print (addr + i, HEX);
       Serial.print (F(": "));
       }
##############################################################################
--- md5.c.orig  2016-08-31 07:31:47 +0200
+++ md5.c   2016-09-18 19:38:23 +0200
@@ -17,7 +17,9 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+#pragma GCC optimize ("-O0") // avoid GCC memcpy inline

+#include <string.h>  // for memcpy
 #include "md5.h"

 #define GET_UINT32(n,b,i)                       \
##############################################################################
--- Signatures.h.orig   2016-08-31 07:31:47 +0200
+++ Signatures.h    2016-09-18 01:29:55 +0200
@@ -63,7 +63,9 @@
   { { 0x1E, 0x92, 0x0A }, "ATmega48PA",   4 * kb,         0,    64,  NO_FUSE,  false  },
   { { 0x1E, 0x93, 0x0F }, "ATmega88PA",   8 * kb,       256,   128,  extFuse,  false },
   { { 0x1E, 0x94, 0x0B }, "ATmega168PA", 16 * kb,       256,   128,  extFuse,  false },
+  { { 0x1E, 0x94, 0x06 }, "ATmega168V",  16 * kb,       256,   128,  extFuse,  false },
   { { 0x1E, 0x95, 0x0F }, "ATmega328P",  32 * kb,       512,   128,  highFuse, false },
+  { { 0x1E, 0x95, 0x16 }, "ATmega328PB", 32 * kb,       512,   128,  highFuse, false },
   { { 0x1E, 0x95, 0x14 }, "ATmega328",   32 * kb,       512,   128,  highFuse, false },

   // Atmega644 family
@@ -94,6 +96,7 @@

   // ATmega1284P family
   { { 0x1E, 0x97, 0x05 }, "ATmega1284P", 128 * kb,   1 * kb,   256,  highFuse, false },
+  { { 0x1E, 0x97, 0x06 }, "ATmega1284",  128 * kb,   1 * kb,   256,  highFuse, false },

   // ATtiny4313 family
   { { 0x1E, 0x91, 0x0A }, "ATtiny2313A",   2 * kb,        0,    32,  NO_FUSE,  false   },

Atmega_Board_Detector.diff.txt

See 898cb62

Thanks!