smpinterface fix: missing rampZ-write for atmega1284p
[pub/USBaspLoader.git] / firmware / main.c
index c762fed..fd5dd48 100644 (file)
@@ -20,6 +20,8 @@
 
 #include <avr/cpufunc.h>
 
+#include <avr/boot.h>
+
 #include <string.h>
 
 
@@ -46,6 +48,15 @@ static void leaveBootloader() __attribute__((__noreturn__));
 #define USBASP_FUNC_WRITEEEPROM     8
 #define USBASP_FUNC_SETLONGADDRESS  9
 
+// additional USBasp Commands
+#define USBASP_FUNC_SETISPSCK       10
+#define USBASP_FUNC_TPI_CONNECT      11
+#define USBASP_FUNC_TPI_DISCONNECT   12
+#define USBASP_FUNC_TPI_RAWREAD      13
+#define USBASP_FUNC_TPI_RAWWRITE     14
+#define USBASP_FUNC_TPI_READBLOCK    15
+#define USBASP_FUNC_TPI_WRITEBLOCK   16
+#define USBASP_FUNC_GETCAPABILITIES 127
 /* ------------------------------------------------------------------------ */
 
 #ifndef ulong
@@ -206,7 +217,7 @@ static uchar    replyBuffer[4];
         }
         replyBuffer[3] = rval;
         len = 4;
-    }else if(rq->bRequest == USBASP_FUNC_ENABLEPROG){
+    }else if((rq->bRequest == USBASP_FUNC_ENABLEPROG) || (rq->bRequest == USBASP_FUNC_SETISPSCK)){
         /* replyBuffer[0] = 0; is never touched and thus always 0 which means success */
         len = 1;
     }else if(rq->bRequest >= USBASP_FUNC_READFLASH && rq->bRequest <= USBASP_FUNC_SETLONGADDRESS){