summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-02-14 10:52:45 +1100
committerDamien George <damien.p.george@gmail.com>2018-02-14 10:52:45 +1100
commite6235fe6470b0513000cb0206079be0b9975a122 (patch)
treee6bd6233d52f438e700eb7e4ce9bbfb0df800abb
parentfa13e0d35bc6326fb87676e33a64864e47407a00 (diff)
downloadmicropython-e6235fe6470b0513000cb0206079be0b9975a122.tar.gz
micropython-e6235fe6470b0513000cb0206079be0b9975a122.zip
teensy: Update GPIO speed consts to align with changes in stm32 port.
-rw-r--r--ports/teensy/hal_gpio.c2
-rw-r--r--ports/teensy/led.c2
-rw-r--r--ports/teensy/teensy_hal.h8
3 files changed, 6 insertions, 6 deletions
diff --git a/ports/teensy/hal_gpio.c b/ports/teensy/hal_gpio.c
index e65d03410e..f9e137602c 100644
--- a/ports/teensy/hal_gpio.c
+++ b/ports/teensy/hal_gpio.c
@@ -52,7 +52,7 @@ void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
*port_pcr |= PORT_PCR_DSE;
/* Configure the IO Speed */
- if (GPIO_Init->Speed > GPIO_SPEED_MEDIUM) {
+ if (GPIO_Init->Speed > GPIO_SPEED_FREQ_MEDIUM) {
*port_pcr &= ~PORT_PCR_SRE;
} else {
*port_pcr |= PORT_PCR_SRE;
diff --git a/ports/teensy/led.c b/ports/teensy/led.c
index add052fad2..cf59dbd0a3 100644
--- a/ports/teensy/led.c
+++ b/ports/teensy/led.c
@@ -33,7 +33,7 @@ void led_init(void) {
GPIO_InitTypeDef GPIO_InitStructure;
/* Configure I/O speed, mode, output type and pull */
- GPIO_InitStructure.Speed = GPIO_SPEED_LOW;
+ GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStructure.Mode = MICROPY_HW_LED_OTYPE;
GPIO_InitStructure.Pull = GPIO_NOPULL;
diff --git a/ports/teensy/teensy_hal.h b/ports/teensy/teensy_hal.h
index 162effa85c..aef38a2ad9 100644
--- a/ports/teensy/teensy_hal.h
+++ b/ports/teensy/teensy_hal.h
@@ -74,10 +74,10 @@ typedef struct {
#define IS_GPIO_PULL(PULL) (((PULL) == GPIO_NOPULL) || ((PULL) == GPIO_PULLUP) || \
((PULL) == GPIO_PULLDOWN))
-#define GPIO_SPEED_LOW ((uint32_t)0)
-#define GPIO_SPEED_MEDIUM ((uint32_t)1)
-#define GPIO_SPEED_FAST ((uint32_t)2)
-#define GPIO_SPEED_HIGH ((uint32_t)3)
+#define GPIO_SPEED_FREQ_LOW ((uint32_t)0)
+#define GPIO_SPEED_FREQ_MEDIUM ((uint32_t)1)
+#define GPIO_SPEED_FREQ_HIGH ((uint32_t)2)
+#define GPIO_SPEED_FREQ_VERY_HIGH ((uint32_t)3)
#define IS_GPIO_AF(af) ((af) >= 0 && (af) <= 7)