do hw reset when touch IC cannot communicate with MCU#999
Open
Jiyun-Yang wants to merge 1 commit intocoredevices:mainfrom
Open
do hw reset when touch IC cannot communicate with MCU#999Jiyun-Yang wants to merge 1 commit intocoredevices:mainfrom
Jiyun-Yang wants to merge 1 commit intocoredevices:mainfrom
Conversation
2a6211e to
d5ff703
Compare
gmarull
reviewed
Mar 20, 2026
|
|
||
| static void prv_exti_cb(bool *should_context_switch); | ||
| static void cst816_hw_reset(void); | ||
| void touch_sensor_set_enabled(bool enabled); |
Contributor
Author
There was a problem hiding this comment.
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); |
Member
There was a problem hiding this comment.
what if there was no down event before?
Contributor
Author
There was a problem hiding this comment.
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); |
Contributor
Author
There was a problem hiding this comment.
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]>
d5ff703 to
ba21af7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CST816 may hung up by ESD, so reset it when it cannot communicate with MCU.