te0
te0
DIIDevHeads IoT Integration Server
Created by Sterling on 7/30/2024 in #firmware-and-baremetal
How to optimize handling of multiple inputs efficiently on STM32F4 using GCC?
EXTI_enable_pins();

void gpio_isr(void* pvArg)
{
gpio_t pin_num = (gpio_t) pvArg;
xEventGroupSetBitsFromISR( xEventGroup,1 << pin_num);
}

void gpio_task(void* Arg)
{
while(1)
{
xEventGroupWaitBits(xEventGroup,xEventAnyBit , pdTRUE, pdFALSE, portMAX_DELAY);
process_gpio();
}

vTaskDelete(NULL);
}
EXTI_enable_pins();

void gpio_isr(void* pvArg)
{
gpio_t pin_num = (gpio_t) pvArg;
xEventGroupSetBitsFromISR( xEventGroup,1 << pin_num);
}

void gpio_task(void* Arg)
{
while(1)
{
xEventGroupWaitBits(xEventGroup,xEventAnyBit , pdTRUE, pdFALSE, portMAX_DELAY);
process_gpio();
}

vTaskDelete(NULL);
}
5 replies