mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
hcsr04: Pass reference to current object to ISR.
This will allow users to call ackEdgeDetected() on the object passed into the function pointer, instead of requiring them to have a global reference to the object. Signed-off-by: JJ Robertson <jjrob13@gmail.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
758b49f51d
commit
287250b32d
@ -63,7 +63,7 @@ HCSR04::HCSR04 (uint8_t triggerPin, uint8_t echoPin, void (*fptr)(void *)) {
|
||||
}
|
||||
|
||||
mraa_gpio_dir(m_echoPinCtx, MRAA_GPIO_IN);
|
||||
mraa_gpio_isr(m_echoPinCtx, MRAA_GPIO_EDGE_BOTH, fptr, NULL);
|
||||
mraa_gpio_isr(m_echoPinCtx, MRAA_GPIO_EDGE_BOTH, fptr, (void*)this);
|
||||
}
|
||||
|
||||
HCSR04::~HCSR04 () {
|
||||
|
Loading…
x
Reference in New Issue
Block a user