Revert "added receivebyte with timeout. sometimes it will just hang,"
[pyfrprog.git] / pkernel / main.c
index 452c3881c7d0040d8b66371be48cf2c1b3bd0313..c40924f4b3c9c3c39e484a486734bba55491b5bb 100644 (file)
@@ -1,8 +1,6 @@
 #include "mb91465k.h"
 #include "flash.h"
 
-#pragma section CODE=IRAM,attr=CODE
-
 #define BUFSIZE 0x20
 #define cleardata() memset(data,0,BUFSIZE)
 
@@ -71,6 +69,15 @@ void main(void)
                cleardata();
                increaseled();
                switch(recvbyte()) {
+                       case 0x15: //chip erase
+                               Putch4(0x45);
+                               increaseled();
+                               if(FLASH_ChipErase() != 1) {
+                                       panic();
+                               }
+                               Putch4(0x23);
+                               break;
+
                        case 0x12: //erase
                                Putch4(0x11);
                                address = recvdword();