Skip to content

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

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

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

Conversation

@Jiyun-Yang
Copy link
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
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
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
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
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.

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
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
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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants