diff options
Diffstat (limited to 'teensy')
-rw-r--r-- | teensy/Makefile | 2 | ||||
-rw-r--r-- | teensy/led.c | 3 | ||||
-rw-r--r-- | teensy/main.c | 2 | ||||
-rw-r--r-- | teensy/mpconfigport.h | 8 | ||||
-rw-r--r-- | teensy/teensy_hal.c | 2 | ||||
-rw-r--r-- | teensy/teensy_hal.h | 3 | ||||
-rw-r--r-- | teensy/uart.c | 4 |
7 files changed, 10 insertions, 14 deletions
diff --git a/teensy/Makefile b/teensy/Makefile index 76cc81ee19..18ffb32af9 100644 --- a/teensy/Makefile +++ b/teensy/Makefile @@ -24,7 +24,7 @@ INC += -I../stmhal INC += -I$(BUILD) INC += -I$(CORE_PATH) -CFLAGS = $(INC) -Wall -ansi -std=gnu99 $(CFLAGS_CORTEX_M4) +CFLAGS = $(INC) -Wall -ansi -std=gnu99 -nostdlib $(CFLAGS_CORTEX_M4) LDFLAGS = -nostdlib -T mk20dx256.ld LIBS = -L $(COMPILER_PATH)/../arm-none-eabi/lib/thumb2 -lm LIBS += -L $(COMPILER_PATH)/../arm-none-eabi/lib/thumb2 -lc diff --git a/teensy/led.c b/teensy/led.c index d825f32198..5a9d8701d2 100644 --- a/teensy/led.c +++ b/teensy/led.c @@ -3,17 +3,16 @@ #include "Arduino.h" #include "mpconfig.h" -#include HAL_H #include "nlr.h" #include "misc.h" #include "qstr.h" #include "obj.h" #include "runtime.h" #include "led.h" +#include MICROPY_HAL_H #include "pin.h" #include "genhdr/pins.h" - typedef struct _pyb_led_obj_t { mp_obj_base_t base; machine_uint_t led_id; diff --git a/teensy/main.c b/teensy/main.c index c22382675d..97c1db6528 100644 --- a/teensy/main.c +++ b/teensy/main.c @@ -19,7 +19,7 @@ #include "readline.h" #include "Arduino.h" -#include HAL_H +#include MICROPY_HAL_H #include "servo.h" #include "usb.h" diff --git a/teensy/mpconfigport.h b/teensy/mpconfigport.h index 417335cfcb..ff0a31f272 100644 --- a/teensy/mpconfigport.h +++ b/teensy/mpconfigport.h @@ -95,9 +95,5 @@ typedef const void *machine_const_ptr_t; // must be of pointer size #define MICROPY_MATH_SQRT_ASM (1) -#define HAL_H "teensy_hal.h" -#define PIN_DEFS_PORT_H "pin_defs_teensy.h" - -#define GPIO_read_pin(gpio, pin) (((gpio)->PDIR >> (pin)) & 1) -#define GPIO_set_pin(gpio, pin_mask) (((gpio)->PSOR) = (pin_mask)) -#define GPIO_clear_pin(gpio, pin_mask) (((gpio)->PCOR) = (pin_mask)) +#define MICROPY_HAL_H "teensy_hal.h" +#define MICROPY_PIN_DEFS_PORT_H "pin_defs_teensy.h" diff --git a/teensy/teensy_hal.c b/teensy/teensy_hal.c index 5f162f1e78..b7ac842af8 100644 --- a/teensy/teensy_hal.c +++ b/teensy/teensy_hal.c @@ -5,7 +5,7 @@ #include "Arduino.h" -#include HAL_H +#include MICROPY_HAL_H uint32_t HAL_GetTick(void) { return micros(); diff --git a/teensy/teensy_hal.h b/teensy/teensy_hal.h index 3afe01b1c9..ff16c98c5c 100644 --- a/teensy/teensy_hal.h +++ b/teensy/teensy_hal.h @@ -106,3 +106,6 @@ void HAL_Delay(uint32_t Delay); void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *init); +#define GPIO_read_pin(gpio, pin) (((gpio)->PDIR >> (pin)) & 1) +#define GPIO_set_pin(gpio, pin_mask) (((gpio)->PSOR) = (pin_mask)) +#define GPIO_clear_pin(gpio, pin_mask) (((gpio)->PCOR) = (pin_mask)) diff --git a/teensy/uart.c b/teensy/uart.c index 3dd546dd54..97a1a058c9 100644 --- a/teensy/uart.c +++ b/teensy/uart.c @@ -28,14 +28,12 @@ #include <string.h> #include "mpconfig.h" - -#include HAL_H - #include "nlr.h" #include "misc.h" #include "qstr.h" #include "obj.h" #include "runtime.h" +#include MICROPY_HAL_H #include "bufhelper.h" #include "uart.h" |