fix(touch): fixed tie option take no effect

This commit is contained in:
laokaiyao
2025-03-20 15:08:32 +08:00
committed by Kevin (Lao Kaiyao)
parent fe73a61b2b
commit 37cbd1e555
7 changed files with 63 additions and 18 deletions

View File

@@ -299,7 +299,12 @@ static inline void touch_ll_set_charge_voltage_low_limit(touch_volt_lim_l_t low_
*/
static inline void touch_ll_set_init_charge_voltage(uint32_t touch_num, touch_init_charge_volt_t init_charge_volt)
{
RTCIO.touch_pad[touch_num].tie_opt = init_charge_volt;
if (init_charge_volt == TOUCH_INIT_CHARGE_VOLT_FLOAT) {
RTCIO.touch_pad[touch_num].xpd = 0;
} else {
RTCIO.touch_pad[touch_num].xpd = 1;
RTCIO.touch_pad[touch_num].tie_opt = init_charge_volt;
}
}
/**
@@ -974,7 +979,12 @@ static inline void touch_ll_get_slope(touch_pad_t touch_num, touch_cnt_slope_t *
*/
static inline void touch_ll_set_tie_option(touch_pad_t touch_num, touch_tie_opt_t opt)
{
RTCIO.touch_pad[touch_num].tie_opt = opt;
if (opt == TOUCH_PAD_TIE_OPT_FLOAT) {
RTCIO.touch_pad[touch_num].xpd = 0;
} else {
RTCIO.touch_pad[touch_num].xpd = 1;
RTCIO.touch_pad[touch_num].tie_opt = opt;
}
}
/**
@@ -985,7 +995,11 @@ static inline void touch_ll_set_tie_option(touch_pad_t touch_num, touch_tie_opt_
*/
static inline void touch_ll_get_tie_option(touch_pad_t touch_num, touch_tie_opt_t *opt)
{
*opt = (touch_tie_opt_t)RTCIO.touch_pad[touch_num].tie_opt;
if (RTCIO.touch_pad[touch_num].xpd) {
*opt = (touch_tie_opt_t)RTCIO.touch_pad[touch_num].tie_opt;
} else {
*opt = TOUCH_PAD_TIE_OPT_FLOAT;
}
}
/**