The BSP provides three functions to allow for waiting on events:
chbsp_event_wait_setup()
chbsp_event_wait()
chbsp_event_notify()
During the initial programming int shasta_detect_and_program() they are used so that the application can wait on the sensor reset.
Before programming, chbsp_event_wait_setup() is called to clear any pending events and chdrv_int_interrupt_enable() to enable the interrupts.
After programming and reset, event_wait is called to wait for the interrupt.
The problem is now that the called function event_wait() again calls chbsp_event_wait_setup() and chdrv_int_interrupt_enable().
This clears any potentially arrived events.
The BSP provides three functions to allow for waiting on events:
During the initial programming int shasta_detect_and_program() they are used so that the application can wait on the sensor reset.
Before programming, chbsp_event_wait_setup() is called to clear any pending events and chdrv_int_interrupt_enable() to enable the interrupts. After programming and reset, event_wait is called to wait for the interrupt.
The problem is now that the called function event_wait() again calls chbsp_event_wait_setup() and chdrv_int_interrupt_enable(). This clears any potentially arrived events.
https://github.com/tdk-invn-oss/ultrasonic.soniclib/blob/a6514c1fe5b01ebe18f75fd2a627f08864bf757b/invn/soniclib/ch_driver.c#L659-L671
I would suggest to remove the calls to
@tdk-invn-oss/ultrasonic-maintainers