python-on-a-chip online compiler

Dependencies:   mbed TSI

/media/uploads/va009039/p14p-f446re.png

more info: python-on-a-chip

Files at this revision

API Documentation at this revision

Comitter:
va009039
Date:
Fri Apr 11 12:18:37 2014 +0000
Parent:
4:23becb24acb8
Child:
6:e428c1e68f0c
Commit message:
add FRDM-KL46Z,LPC1549

Changed in this revision

mbed.bld Show annotated file Show diff for this revision Revisions of this file
platform/mbed/PinNameTable.h Show annotated file Show diff for this revision Revisions of this file
platform/mbed/main.cpp Show annotated file Show diff for this revision Revisions of this file
platform/mbed/main_nat.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/mbed.bld	Sat Mar 16 13:29:02 2013 +0000
+++ b/mbed.bld	Fri Apr 11 12:18:37 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/5e5da4a5990b
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/6473597d706e
\ No newline at end of file
--- a/platform/mbed/PinNameTable.h	Sat Mar 16 13:29:02 2013 +0000
+++ b/platform/mbed/PinNameTable.h	Fri Apr 11 12:18:37 2014 +0000
@@ -1,4 +1,4 @@
-// PinNameTable.h 2013/3/13
+// PinNameTable.h 2014/4/11
 #include "mbed.h"
 #pragma once
 
@@ -9,235 +9,88 @@
 
 #define P(A) {#A, A}
 const struct pinNameStr pinname_table[] = {
-#if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC11U24)
-// LPC1768 PinNames sorted
-P(LED1),
-P(LED2),
-P(LED3),
-P(LED4),
-P(USBRX),
+#if defined(TARGET_LPC1768)
+P(A0),P(A1),P(A2),P(A3),P(A4),P(A5),P(D0),P(D1),P(D10),P(D11),P(D12),P(D13),P(D14),
+P(D15),P(D2),P(D3),P(D4),P(D5),P(D6),P(D7),P(D8),P(D9),P(LED1),
+P(LED2),P(LED3),P(LED4),P(NC),P(P0_0),P(P0_1),P(P0_10),P(P0_11),P(P0_12),P(P0_13),
+P(P0_14),P(P0_15),P(P0_16),P(P0_17),P(P0_18),P(P0_19),P(P0_2),P(P0_20),P(P0_21),
+P(P0_22),P(P0_23),P(P0_24),P(P0_25),P(P0_26),P(P0_27),P(P0_28),P(P0_29),P(P0_3),
+P(P0_30),P(P0_31),P(P0_4),P(P0_5),P(P0_6),P(P0_7),P(P0_8),P(P0_9),P(P1_0),P(P1_1),
+P(P1_10),P(P1_11),P(P1_12),P(P1_13),P(P1_14),P(P1_15),P(P1_16),P(P1_17),P(P1_18),
+P(P1_19),P(P1_2),P(P1_20),P(P1_21),P(P1_22),P(P1_23),P(P1_24),P(P1_25),P(P1_26),
+P(P1_27),P(P1_28),P(P1_29),P(P1_3),P(P1_30),P(P1_31),P(P1_4),P(P1_5),P(P1_6),P(P1_7),
+P(P1_8),P(P1_9),P(P2_0),P(P2_1),P(P2_10),P(P2_11),P(P2_12),P(P2_13),P(P2_14),P(P2_15),
+P(P2_16),P(P2_17),P(P2_18),P(P2_19),P(P2_2),P(P2_20),P(P2_21),P(P2_22),P(P2_23),
+P(P2_24),P(P2_25),P(P2_26),P(P2_27),P(P2_28),P(P2_29),P(P2_3),P(P2_30),P(P2_31),
+P(P2_4),P(P2_5),P(P2_6),P(P2_7),P(P2_8),P(P2_9),P(P3_0),P(P3_1),P(P3_10),P(P3_11),
+P(P3_12),P(P3_13),P(P3_14),P(P3_15),P(P3_16),P(P3_17),P(P3_18),P(P3_19),P(P3_2),
+P(P3_20),P(P3_21),P(P3_22),P(P3_23),P(P3_24),P(P3_25),P(P3_26),P(P3_27),P(P3_28),
+P(P3_29),P(P3_3),P(P3_30),P(P3_31),P(P3_4),P(P3_5),P(P3_6),P(P3_7),P(P3_8),P(P3_9),
+P(P4_0),P(P4_1),P(P4_10),P(P4_11),P(P4_12),P(P4_13),P(P4_14),P(P4_15),P(P4_16),P(P4_17),
+P(P4_18),P(P4_19),P(P4_2),P(P4_20),P(P4_21),P(P4_22),P(P4_23),P(P4_24),P(P4_25),
+P(P4_26),P(P4_27),P(P4_28),P(P4_29),P(P4_3),P(P4_30),P(P4_31),P(P4_4),P(P4_5),P(P4_6),
+P(P4_7),P(P4_8),P(P4_9),P(USBRX),P(USBTX),P(p10),P(p11),P(p12),P(p13),P(p14),P(p15),
+P(p16),P(p17),P(p18),P(p19),P(p20),P(p21),P(p22),P(p23),P(p24),P(p25),P(p26),P(p27),
+P(p28),P(p29),P(p30),P(p5),P(p6),P(p7),P(p8),P(p9),
+#elif defined(TARGET_LPC1549)
+P(A0),P(A1),P(A2),P(A3),P(A4),P(A5),P(D0),P(D1),P(D10),P(D11),P(D12),P(D13),P(D14),
+P(D15),P(D2),P(D3),P(D4),P(D5),P(D6),P(D7),P(D8),P(D9),P(LED1),P(LED2),P(LED3),P(LED4),
+P(LED_BLUE),P(LED_GREEN),P(LED_RED),P(NC),P(P0_0),P(P0_1),P(P0_10),P(P0_11),P(P0_12),
+P(P0_13),P(P0_14),P(P0_15),P(P0_16),P(P0_17),P(P0_18),P(P0_19),P(P0_2),P(P0_20),
+P(P0_21),P(P0_22),P(P0_23),P(P0_24),P(P0_25),P(P0_26),P(P0_27),P(P0_28),P(P0_29),
+P(P0_3),P(P0_30),P(P0_31),P(P0_4),P(P0_5),P(P0_6),P(P0_7),P(P0_8),P(P0_9),P(P1_0),
+P(P1_1),P(P1_10),P(P1_11),P(P1_12),P(P1_13),P(P1_14),P(P1_15),P(P1_16),P(P1_17),
+P(P1_18),P(P1_19),P(P1_2),P(P1_20),P(P1_21),P(P1_22),P(P1_23),P(P1_24),P(P1_25),
+P(P1_26),P(P1_27),P(P1_28),P(P1_29),P(P1_3),P(P1_30),P(P1_31),P(P1_4),P(P1_5),P(P1_6),
+P(P1_7),P(P1_8),P(P1_9),P(P2_0),P(P2_1),P(P2_10),P(P2_11),P(P2_12),P(P2_2),P(P2_3),
+P(P2_4),P(P2_5),P(P2_6),P(P2_7),P(P2_8),P(P2_9),P(SCL),P(SDA),P(USBRX),P(USBTX),
+
+#elif defined(TARGET_KL25Z)
+P(A0),P(A1),P(A2),P(A3),P(A4),P(A5),P(D0),P(D1),P(D10),P(D11),P(D12),P(D13),P(D14),
+P(D15),P(D2),P(D3),P(D4),P(D5),P(D6),P(D7),P(D8),P(D9),P(I2C_SCL),P(I2C_SDA),P(LED1),
+P(LED2),P(LED3),P(LED4),P(LED_BLUE),P(LED_GREEN),P(LED_RED),P(NC),P(PTA0),P(PTA1),
+P(PTA10),P(PTA11),P(PTA12),P(PTA13),P(PTA14),P(PTA15),P(PTA16),P(PTA17),P(PTA18),
+P(PTA19),P(PTA2),P(PTA20),P(PTA21),P(PTA22),P(PTA23),P(PTA24),P(PTA25),P(PTA26),
+P(PTA27),P(PTA28),P(PTA29),P(PTA3),P(PTA30),P(PTA31),P(PTA4),P(PTA5),P(PTA6),P(PTA7),
+P(PTA8),P(PTA9),P(PTB0),P(PTB1),P(PTB10),P(PTB11),P(PTB12),P(PTB13),P(PTB14),P(PTB15),
+P(PTB16),P(PTB17),P(PTB18),P(PTB19),P(PTB2),P(PTB20),P(PTB21),P(PTB22),P(PTB23),
+P(PTB24),P(PTB25),P(PTB26),P(PTB27),P(PTB28),P(PTB29),P(PTB3),P(PTB30),P(PTB31),
+P(PTB4),P(PTB5),P(PTB6),P(PTB7),P(PTB8),P(PTB9),P(PTC0),P(PTC1),P(PTC10),P(PTC11),
+P(PTC12),P(PTC13),P(PTC14),P(PTC15),P(PTC16),P(PTC17),P(PTC18),P(PTC19),P(PTC2),
+P(PTC20),P(PTC21),P(PTC22),P(PTC23),P(PTC24),P(PTC25),P(PTC26),P(PTC27),P(PTC28),
+P(PTC29),P(PTC3),P(PTC30),P(PTC31),P(PTC4),P(PTC5),P(PTC6),P(PTC7),P(PTC8),P(PTC9),
+P(PTD0),P(PTD1),P(PTD10),P(PTD11),P(PTD12),P(PTD13),P(PTD14),P(PTD15),P(PTD16),P(PTD17),
+P(PTD18),P(PTD19),P(PTD2),P(PTD20),P(PTD21),P(PTD22),P(PTD23),P(PTD24),P(PTD25),
+P(PTD26),P(PTD27),P(PTD28),P(PTD29),P(PTD3),P(PTD30),P(PTD31),P(PTD4),P(PTD5),P(PTD6),
+P(PTD7),P(PTD8),P(PTD9),P(PTE0),P(PTE1),P(PTE10),P(PTE11),P(PTE12),P(PTE13),P(PTE14),
+P(PTE15),P(PTE16),P(PTE17),P(PTE18),P(PTE19),P(PTE2),P(PTE20),P(PTE21),P(PTE22),
+P(PTE23),P(PTE24),P(PTE25),P(PTE26),P(PTE27),P(PTE28),P(PTE29),P(PTE3),P(PTE30),
+P(PTE31),P(PTE4),P(PTE5),P(PTE6),P(PTE7),P(PTE8),P(PTE9),P(TSI_ELEC0),P(TSI_ELEC1),
+P(USBRX),P(USBTX),
+#elif defined(TARGET_KL46Z)
+P(A0),P(A1),P(A2),P(A3),P(A4),P(A5),P(D0),P(D1),P(D10),P(D11),P(D12),P(D13),P(D14),
+P(D15),P(D2),P(D3),P(D4),P(D5),P(D6),P(D7),P(D8),P(D9),P(I2C_SCL),P(I2C_SDA),P(LED1),
+P(LED2),P(LED3),P(LED4),P(LED_GREEN),P(LED_RED),P(NC),P(PTA0),P(PTA1),P(PTA10),P(PTA11),
+P(PTA12),P(PTA13),P(PTA14),P(PTA15),P(PTA16),P(PTA17),P(PTA18),P(PTA19),P(PTA2),
+P(PTA20),P(PTA21),P(PTA22),P(PTA23),P(PTA24),P(PTA25),P(PTA26),P(PTA27),P(PTA28),
+P(PTA29),P(PTA3),P(PTA30),P(PTA31),P(PTA4),P(PTA5),P(PTA6),P(PTA7),P(PTA8),P(PTA9),
+P(PTB0),P(PTB1),P(PTB10),P(PTB11),P(PTB12),P(PTB13),P(PTB14),P(PTB15),P(PTB16),P(PTB17),
+P(PTB18),P(PTB19),P(PTB2),P(PTB20),P(PTB21),P(PTB22),P(PTB23),P(PTB24),P(PTB25),
+P(PTB26),P(PTB27),P(PTB28),P(PTB29),P(PTB3),P(PTB30),P(PTB31),P(PTB4),P(PTB5),P(PTB6),
+P(PTB7),P(PTB8),P(PTB9),P(PTC0),P(PTC1),P(PTC10),P(PTC11),P(PTC12),P(PTC13),P(PTC14),
+P(PTC15),P(PTC16),P(PTC17),P(PTC18),P(PTC19),P(PTC2),P(PTC20),P(PTC21),P(PTC22),
+P(PTC23),P(PTC24),P(PTC25),P(PTC26),P(PTC27),P(PTC28),P(PTC29),P(PTC3),P(PTC30),
+P(PTC31),P(PTC4),P(PTC5),P(PTC6),P(PTC7),P(PTC8),P(PTC9),P(PTD0),P(PTD1),P(PTD10),
+P(PTD11),P(PTD12),P(PTD13),P(PTD14),P(PTD15),P(PTD16),P(PTD17),P(PTD18),P(PTD19),
+P(PTD2),P(PTD20),P(PTD21),P(PTD22),P(PTD23),P(PTD24),P(PTD25),P(PTD26),P(PTD27),
+P(PTD28),P(PTD29),P(PTD3),P(PTD30),P(PTD31),P(PTD4),P(PTD5),P(PTD6),P(PTD7),P(PTD8),
+P(PTD9),P(PTE0),P(PTE1),P(PTE10),P(PTE11),P(PTE12),P(PTE13),P(PTE14),P(PTE15),P(PTE16),
+P(PTE17),P(PTE18),P(PTE19),P(PTE2),P(PTE20),P(PTE21),P(PTE22),P(PTE23),P(PTE24),
+P(PTE25),P(PTE26),P(PTE27),P(PTE28),P(PTE29),P(PTE3),P(PTE30),P(PTE31),P(PTE4),P(PTE5),
+P(PTE6),P(PTE7),P(PTE8),P(PTE9),P(SW1),P(SW3),P(TSI_ELEC0),P(TSI_ELEC1),P(USBRX),
 P(USBTX),
-P(p10),
-P(p11),
-P(p12),
-P(p13),
-P(p14),
-P(p15),
-P(p16),
-P(p17),
-P(p18),
-P(p19),
-P(p20),
-P(p21),
-P(p22),
-P(p23),
-P(p24),
-P(p25),
-P(p26),
-P(p27),
-P(p28),
-P(p29),
-P(p30),
-P(p5),
-P(p6),
-P(p7),
-P(p8),
-P(p9),
+#else
+#error "target error"
 #endif
 
-#if defined(TARGET_KL25Z)
-// KL25Z PinName sorted
-P(A0),
-P(A1),
-P(A2),
-P(A3),
-P(A4),
-P(A5),
-P(D0),
-P(D1),
-P(D10),
-P(D11),
-P(D12),
-P(D13),
-P(D14),
-P(D15),
-P(D2),
-P(D3),
-P(D4),
-P(D5),
-P(D6),
-P(D7),
-P(D8),
-P(D9),
-P(LED1),
-P(LED2),
-P(LED3),
-P(LED4),
-P(LED_BLUE),
-P(LED_GREEN),
-P(LED_RED),
-P(PTA0),
-P(PTA1),
-P(PTA10),
-P(PTA11),
-P(PTA12),
-P(PTA13),
-P(PTA14),
-P(PTA15),
-P(PTA16),
-P(PTA17),
-P(PTA18),
-P(PTA19),
-P(PTA2),
-P(PTA20),
-P(PTA21),
-P(PTA22),
-P(PTA23),
-P(PTA24),
-P(PTA25),
-P(PTA26),
-P(PTA27),
-P(PTA28),
-P(PTA29),
-P(PTA3),
-P(PTA30),
-P(PTA31),
-P(PTA4),
-P(PTA5),
-P(PTA6),
-P(PTA7),
-P(PTA8),
-P(PTA9),
-P(PTB0),
-P(PTB1),
-P(PTB10),
-P(PTB11),
-P(PTB12),
-P(PTB13),
-P(PTB14),
-P(PTB15),
-P(PTB16),
-P(PTB17),
-P(PTB18),
-P(PTB19),
-P(PTB2),
-P(PTB20),
-P(PTB21),
-P(PTB22),
-P(PTB23),
-P(PTB24),
-P(PTB25),
-P(PTB26),
-P(PTB27),
-P(PTB28),
-P(PTB29),
-P(PTB3),
-P(PTB30),
-P(PTB31),
-P(PTB4),
-P(PTB5),
-P(PTB6),
-P(PTB7),
-P(PTB8),
-P(PTB9),
-P(PTC0),
-P(PTC1),
-P(PTC10),
-P(PTC11),
-P(PTC12),
-P(PTC13),
-P(PTC14),
-P(PTC15),
-P(PTC16),
-P(PTC17),
-P(PTC18),
-P(PTC19),
-P(PTC2),
-P(PTC20),
-P(PTC21),
-P(PTC22),
-P(PTC23),
-P(PTC24),
-P(PTC25),
-P(PTC26),
-P(PTC27),
-P(PTC28),
-P(PTC29),
-P(PTC3),
-P(PTC30),
-P(PTC31),
-P(PTC4),
-P(PTC5),
-P(PTC6),
-P(PTC7),
-P(PTC8),
-P(PTC9),
-P(PTD0),
-P(PTD1),
-P(PTD10),
-P(PTD11),
-P(PTD12),
-P(PTD13),
-P(PTD14),
-P(PTD15),
-P(PTD16),
-P(PTD17),
-P(PTD18),
-P(PTD19),
-P(PTD2),
-P(PTD20),
-P(PTD21),
-P(PTD22),
-P(PTD23),
-P(PTD24),
-P(PTD25),
-P(PTD26),
-P(PTD27),
-P(PTD28),
-P(PTD29),
-P(PTD3),
-P(PTD30),
-P(PTD31),
-P(PTD4),
-P(PTD5),
-P(PTD6),
-P(PTD7),
-P(PTD8),
-P(PTD9),
-P(PTE0),
-P(PTE1),
-P(PTE10),
-P(PTE11),
-P(PTE12),
-P(PTE13),
-P(PTE14),
-P(PTE15),
-P(PTE16),
-P(PTE17),
-P(PTE18),
-P(PTE19),
-P(PTE2),
-P(PTE20),
-P(PTE21),
-P(PTE22),
-P(PTE23),
-P(PTE24),
-P(PTE25),
-P(PTE26),
-P(PTE27),
-P(PTE28),
-P(PTE29),
-P(PTE3),
-P(PTE30),
-P(PTE31),
-P(PTE4),
-P(PTE5),
-P(PTE6),
-P(PTE7),
-P(PTE8),
-P(PTE9),
-P(USBRX),
-P(USBTX),
-#endif
 };
- 
\ No newline at end of file
--- a/platform/mbed/main.cpp	Sat Mar 16 13:29:02 2013 +0000
+++ b/platform/mbed/main.cpp	Fri Apr 11 12:18:37 2014 +0000
@@ -20,20 +20,25 @@
 extern
 #endif
 
-#if defined(TARGET_LPC1768) || defined(TARGET_LPC2368)
+#if defined(TARGET_LPC1768)
 #define HEAP_SIZE 0x7000
-#endif
-#if defined(TARGET_KL25Z)
-#define HEAP_SIZE 0x3800
+#elif defined(TARGET_LPC1549)
+#define HEAP_SIZE 0x8000
+#elif defined(TARGET_KL46Z)
+#define HEAP_SIZE 0x7000
+#elif defined(TARGET_KL25Z)
+#define HEAP_SIZE 0x3400
+#else
+#error "target error"
 #endif
 
 unsigned char const usrlib_img[];
 
+uint8_t heap[HEAP_SIZE];
 
 int
 main(void)
 {
-    uint8_t heap[HEAP_SIZE];
     PmReturn_t retval;
 
     retval = pm_init(heap, HEAP_SIZE, MEMSPACE_PROG, usrlib_img);
--- a/platform/mbed/main_nat.cpp	Sat Mar 16 13:29:02 2013 +0000
+++ b/platform/mbed/main_nat.cpp	Fri Apr 11 12:18:37 2014 +0000
@@ -285,7 +285,11 @@
 {
 
         NativeClassInterface nci;
-        return nci.method<Serial,int,&Serial::baud>(OBJ_TYPE_NON, OBJ_TYPE_INT);
+        Serial* obj;
+        nci._load_obj<Serial>(&obj);
+        obj->baud(nci.argv<int>(1));
+        return nci.set_return_value<int>(OBJ_TYPE_INT, 0);
+        //return nci.method<Serial,int,&Serial::baud>(OBJ_TYPE_NON, OBJ_TYPE_INT);
         
 }
 
@@ -294,8 +298,12 @@
 {
 
         NativeClassInterface nci;
-        return nci.method<int,Serial,&Serial::readable>(OBJ_TYPE_INT);
-        
+        Serial* obj;
+        nci._load_obj<Serial>(&obj);
+        int r = obj->readable();
+        return nci.set_return_value<int>(OBJ_TYPE_INT, r);
+        //return nci.method<int,Serial,&Serial::readable>(OBJ_TYPE_INT);
+   
 }
 
 PmReturn_t
@@ -303,7 +311,11 @@
 {
 
         NativeClassInterface nci;
-        return nci.method<int,Serial,&Serial::writeable>(OBJ_TYPE_INT);
+        Serial* obj;
+        nci._load_obj<Serial>(&obj);
+        int r = obj->writeable();
+        return nci.set_return_value<int>(OBJ_TYPE_INT, r);
+        //return nci.method<int,Serial,&Serial::writeable>(OBJ_TYPE_INT);
         
 }