Merge pull request #754 from dhylands/fix-teensy

Fix teensy to build on latest tree.
This commit is contained in:
Damien George 2014-07-17 12:26:35 +01:00
commit db56ad2915
9 changed files with 13 additions and 11 deletions

View File

@ -1,8 +1,8 @@
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include "misc.h"
#include "mpconfig.h" #include "mpconfig.h"
#include "misc.h"
#include "qstr.h" #include "qstr.h"
#include "lexer.h" #include "lexer.h"

View File

@ -31,7 +31,7 @@ STATIC const pyb_led_obj_t pyb_led_obj[] = {
#endif #endif
#endif #endif
}; };
#define NUM_LEDS ARRAY_SIZE(pyb_led_obj) #define NUM_LEDS MP_ARRAY_SIZE(pyb_led_obj)
void led_init(void) { void led_init(void) {
/* GPIO structure */ /* GPIO structure */

View File

@ -1,8 +1,8 @@
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include "misc.h"
#include "mpconfig.h" #include "mpconfig.h"
#include "misc.h"
#include "qstr.h" #include "qstr.h"
#include "lexer.h" #include "lexer.h"
#include "memzip.h" #include "memzip.h"

View File

@ -3,8 +3,8 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "misc.h"
#include "mpconfig.h" #include "mpconfig.h"
#include "misc.h"
#include "qstr.h" #include "qstr.h"
#include "nlr.h" #include "nlr.h"
#include "lexer.h" #include "lexer.h"

View File

@ -1,6 +1,7 @@
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "mpconfigport.h"
#include "misc.h" #include "misc.h"
#include "memzip.h" #include "memzip.h"

View File

@ -6,8 +6,8 @@
#include "teensy_hal.h" #include "teensy_hal.h"
#include "misc.h"
#include "mpconfig.h" #include "mpconfig.h"
#include "misc.h"
#include "qstr.h" #include "qstr.h"
#include "obj.h" #include "obj.h"
#include "pin.h" #include "pin.h"

View File

@ -29,8 +29,8 @@
#include <mk20dx128.h> #include <mk20dx128.h>
#include "Arduino.h" #include "Arduino.h"
#include "misc.h"
#include "mpconfig.h" #include "mpconfig.h"
#include "misc.h"
#include "teensy_hal.h" #include "teensy_hal.h"
@ -328,8 +328,8 @@ STATIC const mp_obj_dict_t pyb_module_globals = {
.map = { .map = {
.all_keys_are_qstrs = 1, .all_keys_are_qstrs = 1,
.table_is_fixed_array = 1, .table_is_fixed_array = 1,
.used = ARRAY_SIZE(pyb_module_globals_table), .used = MP_ARRAY_SIZE(pyb_module_globals_table),
.alloc = ARRAY_SIZE(pyb_module_globals_table), .alloc = MP_ARRAY_SIZE(pyb_module_globals_table),
.table = (mp_map_elem_t*)pyb_module_globals_table, .table = (mp_map_elem_t*)pyb_module_globals_table,
}, },
}; };

View File

@ -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 // The following would be from a board specific file, if one existed
#define MICROPY_HW_BOARD_NAME "Teensy-3.1" #define MICROPY_HW_BOARD_NAME "Teensy-3.1"
#define MICROPY_HW_MCU_NAME "MK20DX256"
#define MICROPY_HW_HAS_SWITCH (0) #define MICROPY_HW_HAS_SWITCH (0)
#define MICROPY_HW_HAS_SDCARD (0) #define MICROPY_HW_HAS_SDCARD (0)

View File

@ -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_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} }, { 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) { 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 // 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_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} }, { 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) { 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 // 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_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} }, { 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) { 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 // TODO assumes transmission size is 8-bits wide