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

Make Wire library error safe #2489

Closed
wants to merge 10 commits into from
Closed

Conversation

MauroMombelli
Copy link

by adding timeout into twi and giving the user a way to use them.

Full retrocompatible.

with the magic of timeout.

Also bus is put in "error" state, so you have to call init() to reset it.
leaved infinite timeout function for retrocompatibility.
sometimes switching between langauges has its fallout
Also updated some examples
@ffissore
Copy link
Contributor

ffissore commented Dec 9, 2014

@ArduinoBot build this please

@cmaglie cmaglie added feature request A request to make an enhancement (not a bug fix) Library: Wire The Wire Arduino library Architecture: AVR Applies only to the AVR microcontrollers (Uno, etc.) labels Apr 15, 2015
@MauroMombelli
Copy link
Author

is this still needed? i can fix to merge

@Jim4Beam
Copy link

I tried the Code with RTC DS3231 and DS3232RTC Lib from http://github.com/JChristensen/DS3232RTC under IDE 1.6.6 Ubuntu 14.04, it compiles, but dos NOT give correct readings from the RTC and Code still hangs if power of RTC is disconnected while communication is in progress (SDA, SCL still connected!).

Serial output (should be: hh:mm:ss dd.mm.yy Temp [°C])
01:18:09 11.10.41 655,1C
01:18:09 10.08.42 655,1C
01:18:09 29.08.43 0,0C

back with original wire.cpp/.h and twi.c/.h files it look like this - seems the RTC got reset, but at least Temp is fine:
01:28:05 01.01.00 23,7C
01:28:07 01.01.00 23,7C

after resetting RTC to correct time (all back good, but still hang problem if power is disc.):
16:05:03 25.11.15 23,7C
16:05:05 25.11.15 23,7C

@MauroMombelli
Copy link
Author

can you send me the code and the "raw" communication with the sensor?

@Jim4Beam
Copy link

Yes I will, but how can I record the raw I2C communication with the sensor? Thx

-----Original Message-----
From: Mauro Mombelli [email protected]
To: arduino/Arduino [email protected]
Cc: Jim4Beam [email protected]
Sent: Mi., 25 Nov 2015 16:58
Subject: Re: [Arduino] Make Wire library error safe (#2489)

can you send me the code and the "raw" communication with the sensor?


Reply to this email directly or view it on GitHub:
#2489 (comment)

@MauroMombelli
Copy link
Author

just send back the data that come to i2c by serial, in hex format :)

@mjeveritt
Copy link

Any chance of fixing the conflicts for a review? @MauroMombelli ?

@MauroMombelli
Copy link
Author

@mjeveritt not unless the devs show some interest

@mjeveritt
Copy link

@mjeveritt not unless the devs show some interest

I suspect flying elephants will occur first ... 🤣

@cmaglie
Copy link
Member

cmaglie commented Feb 2, 2021

@MauroMombelli @mjeveritt

you missed the news: the timeout is now implemented in AVR Wire
https://github.com/arduino/ArduinoCore-avr/blob/9f8d27f09f3bbd1da1374b5549a82bda55d45d44/libraries/Wire/src/Wire.h#L58

We closed all the issues related to the I2C/Wire timeout, but we missed this one.

Since you're interested in this discussion you may want to join the party here:
arduino/ArduinoCore-avr#42

@cmaglie cmaglie closed this Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture: AVR Applies only to the AVR microcontrollers (Uno, etc.) feature request A request to make an enhancement (not a bug fix) Library: Wire The Wire Arduino library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants