GPIO: Use uintptr_t for gpio_irq_api context
The HAL gpio_irq_api stores object IDs, which serve as a form of context
for the dispatch of the interrupt handler in the drivers level
InterruptIn Class. The way this is achieved is that the InterruptIn
Class casts its address to uint32_t, which is stored as the ID.
This results in compilation failure when the size of an object pointer
is greater than uint32_t, for example when building on a PC for unit
testing.

In order to allow Unit Testing of the InterruptIn Class, we replace the
use of uint32_t with uintptr_t (type capable of holding a pointer),
which allows portability and expresses intentions more clearly.
In aid of this latter goal, we also replace the use of the name "id"
with "context", to improve clarity - these are addresses of the context
related to that callback.
ls
1 parent a580c41 commit f4e5359710e6332388cdea76ae51a208da901d84
@Hari Limaye Hari Limaye authored on 9 Dec 2021
Showing 43 changed files
View
drivers/include/drivers/InterruptIn.h
View
drivers/source/InterruptIn.cpp
View
hal/include/hal/gpio_irq_api.h
View
hal/tests/TESTS/mbed_hal_fpga_ci_test_shield/gpio_irq/main.cpp
View
targets/TARGET_ARM_FM/TARGET_FVP_MPS2/gpio_irq_api.c
View
targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/gpio_irq_api.c
View
targets/TARGET_ARM_SSG/TARGET_MPS2/gpio_irq_api.c
View
targets/TARGET_ARM_SSG/TARGET_MUSCA_B1/gpio_irq_api.c
View
targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/gpio_irq_api.c
View
targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device/gpio_irq_api.c
View
targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/api/gpio_irq_api.c
View
targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/gpio_irq_api.c
View
targets/TARGET_Cypress/TARGET_PSOC6/cy_gpio_irq_api.c
View
targets/TARGET_Freescale/TARGET_KLXX/TARGET_KL25Z/gpio_irq_api.c
View
targets/TARGET_Freescale/TARGET_KLXX/TARGET_KL46Z/gpio_irq_api.c
View
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/gpio_irq_api.c
View
targets/TARGET_GigaDevice/TARGET_GD32F30X/gpio_irq_api.c
View
targets/TARGET_GigaDevice/TARGET_GD32F4XX/gpio_irq_api.c
View
targets/TARGET_Maxim/TARGET_MAX32620C/gpio_irq_api.c
View
targets/TARGET_Maxim/TARGET_MAX32625/gpio_irq_api.c
View
targets/TARGET_Maxim/TARGET_MAX32630/gpio_irq_api.c
View
targets/TARGET_Maxim/TARGET_MAX32660/gpio_irq_api.c
View
targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/gpio_api.c
View
targets/TARGET_NUVOTON/TARGET_M2354/gpio_irq_api.c
View
targets/TARGET_NUVOTON/TARGET_M251/gpio_irq_api.c
View
targets/TARGET_NUVOTON/TARGET_M261/gpio_irq_api.c
View
targets/TARGET_NUVOTON/TARGET_M451/gpio_irq_api.c
View
targets/TARGET_NUVOTON/TARGET_M480/gpio_irq_api.c
View
targets/TARGET_NUVOTON/TARGET_NANO100/gpio_irq_api.c
View
targets/TARGET_NUVOTON/TARGET_NUC472/gpio_irq_api.c
View
targets/TARGET_NXP/TARGET_LPC11XX_11CXX/gpio_irq_api.c
View
targets/TARGET_NXP/TARGET_LPC176X/gpio_irq_api.c
View
targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX/gpio_irq_api.c
View
targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/gpio_irq_api.c
View
targets/TARGET_RENESAS/TARGET_RZ_A1XX/gpio_irq_api.c
View
targets/TARGET_RENESAS/TARGET_RZ_A2XX/gpio_irq_api.c
View
targets/TARGET_STM/gpio_irq_api.c
View
targets/TARGET_Samsung/TARGET_SIDK_S1SBP6A/gpio_irq_api.c
View
targets/TARGET_Samsung/TARGET_SIDK_S5JS100/gpio_irq_api.c
View
targets/TARGET_Silicon_Labs/TARGET_EFM32/gpio_irq_api.c
View
targets/TARGET_TOSHIBA/TARGET_TMPM46B/gpio_irq_api.c
View
targets/TARGET_TOSHIBA/TARGET_TMPM4G9/gpio_irq_api.c
View
targets/TARGET_TOSHIBA/TARGET_TMPM4KN/gpio_irq_api.c