Add to 11U68 11E68

Dependencies:   DirectoryList MODSERIAL mbed

Fork of ika_shouyu_poppoyaki by Tedd OKANO

Files at this revision

API Documentation at this revision

Comitter:
Hapi_Tech
Date:
Sat Jul 04 05:29:32 2015 +0000
Parent:
49:380e7be429ef
Commit message:
Adding LPC11U68,11E68.

Changed in this revision

target_handling.h Show annotated file Show diff for this revision Revisions of this file
target_table.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 380e7be429ef -r 57ad8e04f063 target_handling.h
--- a/target_handling.h	Fri Jun 05 13:37:38 2015 +0000
+++ b/target_handling.h	Sat Jul 04 05:29:32 2015 +0000
@@ -6,6 +6,7 @@
 #define     NO_ISP_MODE         1
 
 #define     SECTOR_SIZE_VALIABLE4Kx16_AND_32KxN     1
+#define     SECTOR_SIZE_VALIABLE4Kx24_AND_32KxN     2
 
 target_param    *open_target( int baud_date );
 void            reset_target( int isp_pin_state );
diff -r 380e7be429ef -r 57ad8e04f063 target_table.cpp
--- a/target_table.cpp	Fri Jun 05 13:37:38 2015 +0000
+++ b/target_table.cpp	Sat Jul 04 05:29:32 2015 +0000
@@ -2,7 +2,7 @@
 #include    "target_table.h"
 
 #define     SECTOR_SIZE_VALIABLE4Kx16_AND_32KxN     1
-
+#define     SECTOR_SIZE_VALIABLE4Kx24_AND_32KxN     2
 target_param    target_table[]  = {
     { "unknown ttarget",        0xFFFFFFFF, 1024,    4096, 4096, UUENCODE, 0x10000200 },
     { "LPC1114FN28(FDH28)/102", 0x0A40902B, 4096,   32768, 4096, UUENCODE, 0x10000200 },
@@ -20,6 +20,9 @@
 ///added for LPC176x series
     { "LPC1769FBD100",          0x26113F37, 65536, 524288, SECTOR_SIZE_VALIABLE4Kx16_AND_32KxN, UUENCODE, 0x10000200 },
     { "LPC1768FBD100",          0x26013F37, 65536, 524288, SECTOR_SIZE_VALIABLE4Kx16_AND_32KxN, UUENCODE, 0x10000200 },
+///added for LPC11U(E)68x series
+    { "LPC11U68JBD100",         0x00007C00, 36864, 262144, SECTOR_SIZE_VALIABLE4Kx24_AND_32KxN, UUENCODE, 0x10000300 },
+    { "LPC11E68JBD100",         0x00007C01, 36864, 262144, SECTOR_SIZE_VALIABLE4Kx24_AND_32KxN, UUENCODE, 0x10000300 },
 };
 
 target_param *find_target_param( char *device_id_string )
@@ -39,18 +42,30 @@
 
 int find_sector( int data_size, target_param *tpp )
 {
+int result;
     switch ( tpp->sector_size ) {
         case SECTOR_SIZE_VALIABLE4Kx16_AND_32KxN :
             if ( data_size <= (4096 * 16) ) {
-                return ( data_size / 4096 );
+             result = ( data_size / 4096 );
             } else {
                 data_size   -= (4096 * 16);
-                return ( (data_size / (4096 * 8)) + 16 );
+             result = ( (data_size / (4096 * 8)) + 16 );
             }
-            //break;
+            break;
+        case SECTOR_SIZE_VALIABLE4Kx24_AND_32KxN :
+            if ( data_size <= (4096 * 24) ) {
+             result = ( data_size / 4096 );
+            } else {
+                data_size   -= (4096 * 24);
+             result = ( (data_size / (4096 * 12)) + 24 );
+            }
+            break;    
+            
+            
         default :
-            return ( data_size / tpp->sector_size );
+            result = ( data_size / tpp->sector_size );
             //break;
     }
+       return (result);
 }