Skip to content

Commit db56ad2

Browse files
committed
Merge pull request adafruit#754 from dhylands/fix-teensy
Fix teensy to build on latest tree.
2 parents dce8876 + 4d9dd26 commit db56ad2

9 files changed

Lines changed: 13 additions & 11 deletions

File tree

teensy/import.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include <stdio.h>
22
#include <stdint.h>
33

4-
#include "misc.h"
54
#include "mpconfig.h"
5+
#include "misc.h"
66
#include "qstr.h"
77
#include "lexer.h"
88

teensy/led.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ STATIC const pyb_led_obj_t pyb_led_obj[] = {
3131
#endif
3232
#endif
3333
};
34-
#define NUM_LEDS ARRAY_SIZE(pyb_led_obj)
34+
#define NUM_LEDS MP_ARRAY_SIZE(pyb_led_obj)
3535

3636
void led_init(void) {
3737
/* GPIO structure */

teensy/lexermemzip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include <stdint.h>
22
#include <stdlib.h>
33

4-
#include "misc.h"
54
#include "mpconfig.h"
5+
#include "misc.h"
66
#include "qstr.h"
77
#include "lexer.h"
88
#include "memzip.h"

teensy/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#include <string.h>
44
#include <stdlib.h>
55

6-
#include "misc.h"
76
#include "mpconfig.h"
7+
#include "misc.h"
88
#include "qstr.h"
99
#include "nlr.h"
1010
#include "lexer.h"

teensy/memzip.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <stdint.h>
22
#include <stdlib.h>
33
#include <string.h>
4+
#include "mpconfigport.h"
45
#include "misc.h"
56
#include "memzip.h"
67

teensy/mk20dx256-prefix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
#include "teensy_hal.h"
88

9-
#include "misc.h"
109
#include "mpconfig.h"
10+
#include "misc.h"
1111
#include "qstr.h"
1212
#include "obj.h"
1313
#include "pin.h"

teensy/modpyb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
#include <mk20dx128.h>
3030
#include "Arduino.h"
3131

32-
#include "misc.h"
3332
#include "mpconfig.h"
33+
#include "misc.h"
3434

3535
#include "teensy_hal.h"
3636

@@ -328,8 +328,8 @@ STATIC const mp_obj_dict_t pyb_module_globals = {
328328
.map = {
329329
.all_keys_are_qstrs = 1,
330330
.table_is_fixed_array = 1,
331-
.used = ARRAY_SIZE(pyb_module_globals_table),
332-
.alloc = ARRAY_SIZE(pyb_module_globals_table),
331+
.used = MP_ARRAY_SIZE(pyb_module_globals_table),
332+
.alloc = MP_ARRAY_SIZE(pyb_module_globals_table),
333333
.table = (mp_map_elem_t*)pyb_module_globals_table,
334334
},
335335
};

teensy/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ typedef const void *machine_const_ptr_t; // must be of pointer size
6565
// The following would be from a board specific file, if one existed
6666

6767
#define MICROPY_HW_BOARD_NAME "Teensy-3.1"
68+
#define MICROPY_HW_MCU_NAME "MK20DX256"
6869

6970
#define MICROPY_HW_HAS_SWITCH (0)
7071
#define MICROPY_HW_HAS_SDCARD (0)

teensy/uart.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ STATIC const mp_arg_t pyb_uart_init_args[] = {
290290
{ MP_QSTR_stop, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} },
291291
{ MP_QSTR_parity, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
292292
};
293-
#define PYB_UART_INIT_NUM_ARGS ARRAY_SIZE(pyb_uart_init_args)
293+
#define PYB_UART_INIT_NUM_ARGS MP_ARRAY_SIZE(pyb_uart_init_args)
294294

295295
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) {
296296
// parse args
@@ -419,7 +419,7 @@ STATIC const mp_arg_t pyb_uart_send_args[] = {
419419
{ MP_QSTR_send, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
420420
{ MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 5000} },
421421
};
422-
#define PYB_UART_SEND_NUM_ARGS ARRAY_SIZE(pyb_uart_send_args)
422+
#define PYB_UART_SEND_NUM_ARGS MP_ARRAY_SIZE(pyb_uart_send_args)
423423

424424
STATIC mp_obj_t pyb_uart_send(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
425425
// TODO assumes transmission size is 8-bits wide
@@ -465,7 +465,7 @@ STATIC const mp_arg_t pyb_uart_recv_args[] = {
465465
{ MP_QSTR_recv, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
466466
{ MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 5000} },
467467
};
468-
#define PYB_UART_RECV_NUM_ARGS ARRAY_SIZE(pyb_uart_recv_args)
468+
#define PYB_UART_RECV_NUM_ARGS MP_ARRAY_SIZE(pyb_uart_recv_args)
469469

470470
STATIC mp_obj_t pyb_uart_recv(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
471471
// TODO assumes transmission size is 8-bits wide

0 commit comments

Comments
 (0)