Browse Source

teensy: Update GPIO speed consts to align with changes in stm32 port.

pull/3609/merge
Damien George 7 years ago
parent
commit
e6235fe647
  1. 2
      ports/teensy/hal_gpio.c
  2. 2
      ports/teensy/led.c
  3. 8
      ports/teensy/teensy_hal.h

2
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;

2
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;

8
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)

Loading…
Cancel
Save