summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-07-17 12:26:35 +0100
committerDamien George <damien.p.george@gmail.com>2014-07-17 12:26:35 +0100
commitdb56ad2915473eb474be694eb40918ba045be9c1 (patch)
tree6dff510e9be2f025fad7f8ef0ee0fd3371266e9d
parentdce8876dbe272d34d8d28aac21b4a4c3bdea0317 (diff)
parent4d9dd26818547e252768d62bf3e319c6f1ca7b7f (diff)
downloadmicropython-db56ad2915473eb474be694eb40918ba045be9c1.tar.gz
micropython-db56ad2915473eb474be694eb40918ba045be9c1.zip
Merge pull request #754 from dhylands/fix-teensy
Fix teensy to build on latest tree.
-rw-r--r--teensy/import.c2
-rw-r--r--teensy/led.c2
-rw-r--r--teensy/lexermemzip.c2
-rw-r--r--teensy/main.c2
-rw-r--r--teensy/memzip.c1
-rw-r--r--teensy/mk20dx256-prefix.c2
-rw-r--r--teensy/modpyb.c6
-rw-r--r--teensy/mpconfigport.h1
-rw-r--r--teensy/uart.c6
9 files changed, 13 insertions, 11 deletions
diff --git a/teensy/import.c b/teensy/import.c
index 967de102ac..5332ebe599 100644
--- a/teensy/import.c
+++ b/teensy/import.c
@@ -1,8 +1,8 @@
#include <stdio.h>
#include <stdint.h>
-#include "misc.h"
#include "mpconfig.h"
+#include "misc.h"
#include "qstr.h"
#include "lexer.h"
diff --git a/teensy/led.c b/teensy/led.c
index 999ca98071..2f6e8d6301 100644
--- a/teensy/led.c
+++ b/teensy/led.c
@@ -31,7 +31,7 @@ STATIC const pyb_led_obj_t pyb_led_obj[] = {
#endif
#endif
};
-#define NUM_LEDS ARRAY_SIZE(pyb_led_obj)
+#define NUM_LEDS MP_ARRAY_SIZE(pyb_led_obj)
void led_init(void) {
/* GPIO structure */
diff --git a/teensy/lexermemzip.c b/teensy/lexermemzip.c
index b74d2ebee3..4c363cd6dc 100644
--- a/teensy/lexermemzip.c
+++ b/teensy/lexermemzip.c
@@ -1,8 +1,8 @@
#include <stdint.h>
#include <stdlib.h>
-#include "misc.h"
#include "mpconfig.h"
+#include "misc.h"
#include "qstr.h"
#include "lexer.h"
#include "memzip.h"
diff --git a/teensy/main.c b/teensy/main.c
index 5e7918cdc6..f15b3dedd0 100644
--- a/teensy/main.c
+++ b/teensy/main.c
@@ -3,8 +3,8 @@
#include <string.h>
#include <stdlib.h>
-#include "misc.h"
#include "mpconfig.h"
+#include "misc.h"
#include "qstr.h"
#include "nlr.h"
#include "lexer.h"
diff --git a/teensy/memzip.c b/teensy/memzip.c
index b269c472a1..7934bea6b2 100644
--- a/teensy/memzip.c
+++ b/teensy/memzip.c
@@ -1,6 +1,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+#include "mpconfigport.h"
#include "misc.h"
#include "memzip.h"
diff --git a/teensy/mk20dx256-prefix.c b/teensy/mk20dx256-prefix.c
index ea9eec74a2..2485dc01ab 100644
--- a/teensy/mk20dx256-prefix.c
+++ b/teensy/mk20dx256-prefix.c
@@ -6,8 +6,8 @@
#include "teensy_hal.h"
-#include "misc.h"
#include "mpconfig.h"
+#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "pin.h"
diff --git a/teensy/modpyb.c b/teensy/modpyb.c
index 435b198d0b..64b9bda2d9 100644
--- a/teensy/modpyb.c
+++ b/teensy/modpyb.c
@@ -29,8 +29,8 @@
#include <mk20dx128.h>
#include "Arduino.h"
-#include "misc.h"
#include "mpconfig.h"
+#include "misc.h"
#include "teensy_hal.h"
@@ -328,8 +328,8 @@ STATIC const mp_obj_dict_t pyb_module_globals = {
.map = {
.all_keys_are_qstrs = 1,
.table_is_fixed_array = 1,
- .used = ARRAY_SIZE(pyb_module_globals_table),
- .alloc = ARRAY_SIZE(pyb_module_globals_table),
+ .used = MP_ARRAY_SIZE(pyb_module_globals_table),
+ .alloc = MP_ARRAY_SIZE(pyb_module_globals_table),
.table = (mp_map_elem_t*)pyb_module_globals_table,
},
};
diff --git a/teensy/mpconfigport.h b/teensy/mpconfigport.h
index 108b230dfd..56bd25c61a 100644
--- a/teensy/mpconfigport.h
+++ b/teensy/mpconfigport.h
@@ -65,6 +65,7 @@ typedef const void *machine_const_ptr_t; // must be of pointer size
// The following would be from a board specific file, if one existed
#define MICROPY_HW_BOARD_NAME "Teensy-3.1"
+#define MICROPY_HW_MCU_NAME "MK20DX256"
#define MICROPY_HW_HAS_SWITCH (0)
#define MICROPY_HW_HAS_SDCARD (0)
diff --git a/teensy/uart.c b/teensy/uart.c
index e3a35153bc..48149c795d 100644
--- a/teensy/uart.c
+++ b/teensy/uart.c
@@ -290,7 +290,7 @@ STATIC const mp_arg_t pyb_uart_init_args[] = {
{ MP_QSTR_stop, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} },
{ MP_QSTR_parity, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
};
-#define PYB_UART_INIT_NUM_ARGS ARRAY_SIZE(pyb_uart_init_args)
+#define PYB_UART_INIT_NUM_ARGS MP_ARRAY_SIZE(pyb_uart_init_args)
STATIC mp_obj_t pyb_uart_init_helper(pyb_uart_obj_t *self, uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
// parse args
@@ -419,7 +419,7 @@ STATIC const mp_arg_t pyb_uart_send_args[] = {
{ MP_QSTR_send, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
{ MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 5000} },
};
-#define PYB_UART_SEND_NUM_ARGS ARRAY_SIZE(pyb_uart_send_args)
+#define PYB_UART_SEND_NUM_ARGS MP_ARRAY_SIZE(pyb_uart_send_args)
STATIC mp_obj_t pyb_uart_send(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
// TODO assumes transmission size is 8-bits wide
@@ -465,7 +465,7 @@ STATIC const mp_arg_t pyb_uart_recv_args[] = {
{ MP_QSTR_recv, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
{ MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 5000} },
};
-#define PYB_UART_RECV_NUM_ARGS ARRAY_SIZE(pyb_uart_recv_args)
+#define PYB_UART_RECV_NUM_ARGS MP_ARRAY_SIZE(pyb_uart_recv_args)
STATIC mp_obj_t pyb_uart_recv(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
// TODO assumes transmission size is 8-bits wide