Last active
August 29, 2015 14:12
-
-
Save ChuckM/b56c25fb99764d48492f to your computer and use it in GitHub Desktop.
How to do a simple callback example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void | |
callback(void) { | |
... do what you need to do ...; | |
} | |
void notify_on_true(uint32_t gpio_bit, (void ()) *callme) { | |
if (read_gpio() & gpio_bit) != 0) { | |
*callme(); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment