@@ -305,7 +305,12 @@ static inline void touch_ll_set_init_charge_voltage(uint32_t touch_num, touch_in
305305{
306306 // Workaround: swap chan 8 and chan 9
307307 touch_num = TOUCH_LL_CHAN_SWAP (touch_num );
308- RTCIO .touch_pad [touch_num ].tie_opt = init_charge_volt ;
308+ if (init_charge_volt == TOUCH_INIT_CHARGE_VOLT_FLOAT ) {
309+ RTCIO .touch_pad [touch_num ].xpd = 0 ;
310+ } else {
311+ RTCIO .touch_pad [touch_num ].xpd = 1 ;
312+ RTCIO .touch_pad [touch_num ].tie_opt = init_charge_volt ;
313+ }
309314}
310315
311316/**
@@ -613,7 +618,12 @@ static inline void touch_ll_get_slope(touch_pad_t touch_num, touch_cnt_slope_t *
613618static inline void touch_ll_set_tie_option (touch_pad_t touch_num , touch_tie_opt_t opt )
614619{
615620 touch_pad_t touch_pad_wrap = touch_ll_num_wrap (touch_num );
616- RTCIO .touch_pad [touch_pad_wrap ].tie_opt = opt ;
621+ if (opt == TOUCH_PAD_TIE_OPT_FLOAT ) {
622+ RTCIO .touch_pad [touch_pad_wrap ].xpd = 0 ;
623+ } else {
624+ RTCIO .touch_pad [touch_pad_wrap ].xpd = 1 ;
625+ RTCIO .touch_pad [touch_pad_wrap ].tie_opt = opt ;
626+ }
617627}
618628
619629/**
@@ -625,7 +635,11 @@ static inline void touch_ll_set_tie_option(touch_pad_t touch_num, touch_tie_opt_
625635static inline void touch_ll_get_tie_option (touch_pad_t touch_num , touch_tie_opt_t * opt )
626636{
627637 touch_pad_t touch_pad_wrap = touch_ll_num_wrap (touch_num );
628- * opt = (touch_tie_opt_t )RTCIO .touch_pad [touch_pad_wrap ].tie_opt ;
638+ if (RTCIO .touch_pad [touch_pad_wrap ].xpd ) {
639+ * opt = (touch_tie_opt_t )RTCIO .touch_pad [touch_pad_wrap ].tie_opt ;
640+ } else {
641+ * opt = TOUCH_PAD_TIE_OPT_FLOAT ;
642+ }
629643}
630644
631645/**
0 commit comments