Skip to content

do hw reset when touch IC cannot communicate with MCU#999

Open
Jiyun-Yang wants to merge 1 commit into
coredevices:mainfrom
Jiyun-Yang:obelix_touch
Open

do hw reset when touch IC cannot communicate with MCU#999
Jiyun-Yang wants to merge 1 commit into
coredevices:mainfrom
Jiyun-Yang:obelix_touch

Conversation

@Jiyun-Yang
Copy link
Copy Markdown
Contributor

CST816 may hung up by ESD, so reset it when it cannot communicate with MCU.


static void prv_exti_cb(bool *should_context_switch);
static void cst816_hw_reset(void);
void touch_sensor_set_enabled(bool enabled);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not be needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is called before implementation, so declare it here.

if (!rv) {
PBL_LOG_ERR("Failed to read touch data, dropping event");
PBL_LOG_ERR("get touch data error, reset the hw");
touch_handle_update(0, TouchState_FingerUp, NULL, 0, current_time_ms);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if there was no down event before?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when it happens on touch down status, the upper layer may not know the hardware been reset with default FingerUp status, so force report the FingerUp event to upper layer.

Comment thread src/fw/drivers/touch/cst816/cst816.c Outdated
PBL_LOG_ERR("Failed to read touch data, dropping event");
PBL_LOG_ERR("get touch data error, reset the hw");
touch_handle_update(0, TouchState_FingerUp, NULL, 0, current_time_ms);
exti_disable(CST816->int_exti);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When do hw reset, don't know if the INT pin is stable or not, so force disable interrupt during reset cycle.

…mmunicate with MCU

CST816 may hung up by ESD, so reset it when it cannot communicate with MCU.

Signed-off-by: Yang Jiyun <yangjiyun@pro-well.tech>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

This pull request has been marked as stale because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 7 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions Bot added the stale label May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants