From codal-nrf52/inc/NRF52Pin.h#L315wasTouch has a default argument, so calling it without arguments defaults to capacitive mode:
int wasTouched( TouchMode touchMode = TouchMode::Capacitative );
On the other hand isTouched() (codal-nrf52/inc/NRF52Pin.h#L277-L300) does not have a default value, so calling it with arguments uses the pin touch mode state instead:
int NRF52Pin::isTouched() {
return isTouched(status & IO_STATUS_CAPACITATIVE_TOUCH ? TouchMode::Capacitative : TouchMode::Resistive);
}
int isTouched(TouchMode touchMode) { ... }
MakeCode & MicroPython do not keep track of the configured pin state, and they offer a "set touch mode" function, which only needs to call isTouched() with the right argument. After that calling isTouched() without arguments uses the last set mode, so we should do the same for wasTouched().
From codal-nrf52/inc/NRF52Pin.h#L315
wasTouch
has a default argument, so calling it without arguments defaults to capacitive mode:On the other hand
isTouched()
(codal-nrf52/inc/NRF52Pin.h#L277-L300) does not have a default value, so calling it with arguments uses the pin touch mode state instead:MakeCode & MicroPython do not keep track of the configured pin state, and they offer a "set touch mode" function, which only needs to call
isTouched()
with the right argument. After that callingisTouched()
without arguments uses the last set mode, so we should do the same forwasTouched()
.