The signature for the callbacks should be:The callbacks are not checking which GPIO number the event occurred on.
Also, here can be only one GPIO callback per core. If two callbacks are registered, only the second will take effect. So when an event happens on GPIO 18 or 19, it will cause 666 to be written to scratch[0] or 48,879 to be written to scratch[2], not depending on which GPIO the event occurred on but depending on the order in which the callbacks were registered.
Code:
void gpio_callback_pin1(uint gpio, uint32_t event_mask) {...}void gpio_callback_pin2(uint gpio, uint32_t event_mask) {...}
Also, here can be only one GPIO callback per core. If two callbacks are registered, only the second will take effect. So when an event happens on GPIO 18 or 19, it will cause 666 to be written to scratch[0] or 48,879 to be written to scratch[2], not depending on which GPIO the event occurred on but depending on the order in which the callbacks were registered.
Statistics: Posted by alastairpatrick — Fri Apr 05, 2024 7:10 am