Skip to content

Commit e6235fe

Browse files
committed
teensy: Update GPIO speed consts to align with changes in stm32 port.
1 parent fa13e0d commit e6235fe

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

ports/teensy/hal_gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
5252
*port_pcr |= PORT_PCR_DSE;
5353

5454
/* Configure the IO Speed */
55-
if (GPIO_Init->Speed > GPIO_SPEED_MEDIUM) {
55+
if (GPIO_Init->Speed > GPIO_SPEED_FREQ_MEDIUM) {
5656
*port_pcr &= ~PORT_PCR_SRE;
5757
} else {
5858
*port_pcr |= PORT_PCR_SRE;

ports/teensy/led.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void led_init(void) {
3333
GPIO_InitTypeDef GPIO_InitStructure;
3434

3535
/* Configure I/O speed, mode, output type and pull */
36-
GPIO_InitStructure.Speed = GPIO_SPEED_LOW;
36+
GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_LOW;
3737
GPIO_InitStructure.Mode = MICROPY_HW_LED_OTYPE;
3838
GPIO_InitStructure.Pull = GPIO_NOPULL;
3939

ports/teensy/teensy_hal.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ typedef struct {
7474
#define IS_GPIO_PULL(PULL) (((PULL) == GPIO_NOPULL) || ((PULL) == GPIO_PULLUP) || \
7575
((PULL) == GPIO_PULLDOWN))
7676

77-
#define GPIO_SPEED_LOW ((uint32_t)0)
78-
#define GPIO_SPEED_MEDIUM ((uint32_t)1)
79-
#define GPIO_SPEED_FAST ((uint32_t)2)
80-
#define GPIO_SPEED_HIGH ((uint32_t)3)
77+
#define GPIO_SPEED_FREQ_LOW ((uint32_t)0)
78+
#define GPIO_SPEED_FREQ_MEDIUM ((uint32_t)1)
79+
#define GPIO_SPEED_FREQ_HIGH ((uint32_t)2)
80+
#define GPIO_SPEED_FREQ_VERY_HIGH ((uint32_t)3)
8181

8282
#define IS_GPIO_AF(af) ((af) >= 0 && (af) <= 7)
8383

0 commit comments

Comments
 (0)