Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs in si2c twi_status() timeout and host uart/timer. #2389

Merged
merged 1 commit into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sming/Arch/Host/Components/driver/hw_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CTimerThread : public CThread
void attach_interrupt(hw_timer_source_type_t source_type, hw_timer_callback_t callback, void* arg)
{
stop();
source_type = source_type;
this->source_type = source_type;
this->callback.func = callback;
this->callback.arg = arg;
}
Expand Down
2 changes: 1 addition & 1 deletion Sming/Arch/Host/Components/driver/uart_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ void CUart::onNotify(smg_uart_t* uart, smg_uart_notify_code_t code)
break;

case UART_NOTIFY_AFTER_WRITE: {
if(uart != nullptr) {
if(this->uart != nullptr) {
// Kick the thread to send now
txsem.post();
} else {
Expand Down
2 changes: 1 addition & 1 deletion Sming/Core/si2c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ uint8_t twi_status()

int clockCount = 20;

while(SDA_READ() == 0 && clockCount > 0) { //if SDA low, read the bits slaves have to sent to a max
while(SDA_READ() == 0 && clockCount-- > 0) { //if SDA low, read the bits slaves have to sent to a max
twi_read_bit();
if(SCL_READ() == 0) {
return I2C_SCL_HELD_LOW_AFTER_READ; //I2C bus error. SCL held low beyond slave clock stretch time
Expand Down