From a6f837297a1bbf00ff126257e67e813ed0ae2ee7 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 9 Sep 2024 12:28:01 +1000 Subject: [PATCH] codal_app/microbithal: Add microbit_hal_pin_touch_calibrate() function. Signed-off-by: Damien George --- src/codal_app/microbithal.cpp | 4 ++++ src/codal_app/microbithal.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/codal_app/microbithal.cpp b/src/codal_app/microbithal.cpp index 67ec283..c675108 100644 --- a/src/codal_app/microbithal.cpp +++ b/src/codal_app/microbithal.cpp @@ -213,6 +213,10 @@ void microbit_hal_pin_write_analog_u10(int pin, int value) { pin_obj[pin]->setAnalogValue(value); } +void microbit_hal_pin_touch_calibrate(int pin) { + pin_obj[pin]->touchCalibrate(); +} + int microbit_hal_pin_touch_state(int pin, int *was_touched, int *num_touches) { if (was_touched != NULL || num_touches != NULL) { int pin_state_index; diff --git a/src/codal_app/microbithal.h b/src/codal_app/microbithal.h index 2ebeaf0..114e67c 100644 --- a/src/codal_app/microbithal.h +++ b/src/codal_app/microbithal.h @@ -132,6 +132,7 @@ int microbit_hal_pin_read(int pin); void microbit_hal_pin_write(int pin, int value); int microbit_hal_pin_read_analog_u10(int pin); void microbit_hal_pin_write_analog_u10(int pin, int value); +void microbit_hal_pin_touch_calibrate(int pin); int microbit_hal_pin_touch_state(int pin, int *was_touched, int *num_touches); void microbit_hal_pin_write_ws2812(int pin, const uint8_t *buf, size_t len);