From b68d98d61cc013da2df98e5d77d7bf3598d0dd4d Mon Sep 17 00:00:00 2001
From: Damien George <damien.p.george@gmail.com>
Date: Thu, 1 Jan 2015 21:13:30 +0000
Subject: [PATCH] teensy: Prefix includes with py/; remove need for -I../py.

---
 stmhal/pin.c              |  2 +-
 stmhal/pin_named_pins.c   |  2 +-
 teensy/Makefile           |  1 -
 teensy/help.c             |  6 +-----
 teensy/import.c           |  7 +------
 teensy/lcd.c              |  7 +------
 teensy/led.c              |  8 ++------
 teensy/lexermemzip.c      |  6 +-----
 teensy/main.c             | 16 ++++++----------
 teensy/memzip.c           |  4 ++--
 teensy/mk20dx256_prefix.c |  7 +------
 teensy/modpyb.c           |  7 ++-----
 teensy/pin_defs_teensy.c  |  7 +------
 teensy/reg.c              |  7 +------
 teensy/teensy_hal.c       |  3 +--
 teensy/timer.c            | 13 ++++---------
 teensy/uart.c             |  8 ++------
 teensy/usb.c              |  9 ++-------
 18 files changed, 30 insertions(+), 90 deletions(-)

diff --git a/stmhal/pin.c b/stmhal/pin.c
index b71c93efc..91d5d916d 100644
--- a/stmhal/pin.c
+++ b/stmhal/pin.c
@@ -30,8 +30,8 @@
 
 #include "py/nlr.h"
 #include "py/runtime.h"
-#include "pin.h"
 #include MICROPY_HAL_H
+#include "pin.h"
 
 /// \moduleref pyb
 /// \class Pin - control I/O pins
diff --git a/stmhal/pin_named_pins.c b/stmhal/pin_named_pins.c
index 420a5d9e0..f6ee16571 100644
--- a/stmhal/pin_named_pins.c
+++ b/stmhal/pin_named_pins.c
@@ -28,8 +28,8 @@
 #include <string.h>
 
 #include "py/runtime.h"
-#include "pin.h"
 #include MICROPY_HAL_H
+#include "pin.h"
 
 STATIC void pin_named_pins_obj_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
     pin_named_pins_obj_t *self = self_in;
diff --git a/teensy/Makefile b/teensy/Makefile
index 20ba41901..bf3da6780 100644
--- a/teensy/Makefile
+++ b/teensy/Makefile
@@ -31,7 +31,6 @@ CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mcpu=cortex-m4 -msoft-float -mfloat
 
 INC =  -I.
 INC += -I..
-INC += -I$(PY_SRC)
 INC += -I../stmhal
 INC += -I$(BUILD)
 INC += -Icore
diff --git a/teensy/help.c b/teensy/help.c
index 598b6f4e3..38a8d550f 100644
--- a/teensy/help.c
+++ b/teensy/help.c
@@ -26,11 +26,7 @@
 
 #include <stdio.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
+#include "py/obj.h"
 
 STATIC const char *help_text =
 "Welcome to Micro Python!\n"
diff --git a/teensy/import.c b/teensy/import.c
index 5332ebe59..2d5225b88 100644
--- a/teensy/import.c
+++ b/teensy/import.c
@@ -1,11 +1,6 @@
 #include <stdio.h>
-#include <stdint.h>
-
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "lexer.h"
 
+#include "py/lexer.h"
 #include "memzip.h"
 
 mp_import_stat_t mp_import_stat(const char *path) {
diff --git a/teensy/lcd.c b/teensy/lcd.c
index 5b991aac7..e79b7d5ac 100644
--- a/teensy/lcd.c
+++ b/teensy/lcd.c
@@ -1,9 +1,4 @@
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "parse.h"
-#include "obj.h"
+#include "py/obj.h"
 #include "../stmhal/lcd.h"
 
 void lcd_init(void) {
diff --git a/teensy/led.c b/teensy/led.c
index 2f6e8d630..fc60167b9 100644
--- a/teensy/led.c
+++ b/teensy/led.c
@@ -2,12 +2,8 @@
 
 #include "Arduino.h"
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/runtime.h"
 #include "led.h"
 #include MICROPY_HAL_H
 #include "pin.h"
diff --git a/teensy/lexermemzip.c b/teensy/lexermemzip.c
index 4c363cd6d..72fe6b1c6 100644
--- a/teensy/lexermemzip.c
+++ b/teensy/lexermemzip.c
@@ -1,10 +1,6 @@
-#include <stdint.h>
 #include <stdlib.h>
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "lexer.h"
+#include "py/lexer.h"
 #include "memzip.h"
 
 mp_lexer_t *mp_lexer_new_from_file(const char *filename)
diff --git a/teensy/main.c b/teensy/main.c
index bc687fa67..f3b0079bb 100644
--- a/teensy/main.c
+++ b/teensy/main.c
@@ -3,19 +3,15 @@
 #include <string.h>
 #include <stdlib.h>
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "nlr.h"
-#include "lexer.h"
-#include "lexermemzip.h"
-#include "parse.h"
-#include "obj.h"
-#include "runtime.h"
-#include "gc.h"
+#include "py/nlr.h"
+#include "py/parse.h"
+#include "py/lexer.h"
+#include "py/runtime.h"
+#include "py/gc.h"
 #include "gccollect.h"
 #include "pyexec.h"
 #include "readline.h"
+#include "lexermemzip.h"
 
 #include "Arduino.h"
 #include MICROPY_HAL_H
diff --git a/teensy/memzip.c b/teensy/memzip.c
index 7934bea6b..88c084381 100644
--- a/teensy/memzip.c
+++ b/teensy/memzip.c
@@ -1,8 +1,8 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
-#include "mpconfigport.h"
-#include "misc.h"
+#include "py/mpconfig.h"
+#include "py/misc.h"
 #include "memzip.h"
 
 extern uint8_t _staticfs[];
diff --git a/teensy/mk20dx256_prefix.c b/teensy/mk20dx256_prefix.c
index 048b64316..d8e7480b5 100644
--- a/teensy/mk20dx256_prefix.c
+++ b/teensy/mk20dx256_prefix.c
@@ -1,15 +1,10 @@
 // stm32fxx-prefix.c becomes the initial portion of the generated pins file.
 
 #include <stdio.h>
-#include <stdint.h>
 #include <mk20dx128.h>
 
+#include "py/obj.h"
 #include "teensy_hal.h"
-
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
 #include "pin.h"
 
 #define AF(af_idx, af_fn, af_unit, af_type, af_ptr) \
diff --git a/teensy/modpyb.c b/teensy/modpyb.c
index 67c5896a5..13454b253 100644
--- a/teensy/modpyb.c
+++ b/teensy/modpyb.c
@@ -29,14 +29,11 @@
 #include <mk20dx128.h>
 #include "Arduino.h"
 
-#include "mpconfig.h"
-#include "misc.h"
+#include "py/obj.h"
+#include "py/gc.h"
 
 #include "teensy_hal.h"
 
-#include "qstr.h"
-#include "obj.h"
-#include "gc.h"
 #include "gccollect.h"
 #include "irq.h"
 #include "systick.h"
diff --git a/teensy/pin_defs_teensy.c b/teensy/pin_defs_teensy.c
index 35be66997..fd2476f7b 100644
--- a/teensy/pin_defs_teensy.c
+++ b/teensy/pin_defs_teensy.c
@@ -1,11 +1,6 @@
 #include <stdint.h>
 #include <mk20dx128.h>
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/runtime.h"
 #include MICROPY_HAL_H
 #include "pin.h"
 
diff --git a/teensy/reg.c b/teensy/reg.c
index 8783a8351..cbc427d87 100644
--- a/teensy/reg.c
+++ b/teensy/reg.c
@@ -1,11 +1,6 @@
 #include <stdio.h>
 #include <string.h>
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/runtime.h"
 #include "reg.h"
 
 #if MICROPY_REG
diff --git a/teensy/teensy_hal.c b/teensy/teensy_hal.c
index 6e9a27c30..c28dd9182 100644
--- a/teensy/teensy_hal.c
+++ b/teensy/teensy_hal.c
@@ -1,7 +1,6 @@
 #include <stdio.h>
-#include <stdint.h>
 
-#include "mpconfig.h"
+#include "py/mpconfig.h"
 
 #include "Arduino.h"
 
diff --git a/teensy/timer.c b/teensy/timer.c
index a4051e608..e048f61d8 100644
--- a/teensy/timer.c
+++ b/teensy/timer.c
@@ -29,18 +29,13 @@
 #include <string.h>
 #include <stddef.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
-#include "pfenv.h"
+#include "py/nlr.h"
+#include "py/runtime.h"
+#include "py/pfenv.h"
+#include "py/gc.h"
 #include MICROPY_HAL_H
-#include "gc.h"
 #include "pin.h"
 #include "reg.h"
-
 #include "timer.h"
 
 typedef enum {
diff --git a/teensy/uart.c b/teensy/uart.c
index 4751e3293..7e08366b2 100644
--- a/teensy/uart.c
+++ b/teensy/uart.c
@@ -27,12 +27,8 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "mpconfig.h"
-#include "nlr.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
+#include "py/nlr.h"
+#include "py/runtime.h"
 #include MICROPY_HAL_H
 #include "bufhelper.h"
 #include "uart.h"
diff --git a/teensy/usb.c b/teensy/usb.c
index d1601c32d..ed96826b3 100644
--- a/teensy/usb.c
+++ b/teensy/usb.c
@@ -1,13 +1,8 @@
 #include <string.h>
-#include <stdint.h>
 
-#include "Arduino.h"
+#include "py/runtime.h"
 
-#include "mpconfig.h"
-#include "misc.h"
-#include "qstr.h"
-#include "obj.h"
-#include "runtime.h"
+#include "Arduino.h"
 
 #include "usb.h"
 #include "usb_serial.h"
-- 
GitLab