Skip to content

Conversation

@baruch
Copy link

@baruch baruch commented Mar 25, 2017

On the ESP8266 Arduino framework the constructor causes a crash, a simple workaround is to eliminate the need for it. The patches I created are an option for that.

I have to admit I didn't fully test the error handling, it's mainly a basis for consideration.

@stefandz
Copy link
Contributor

Hi - thanks for this. We don't actually have an ESP8266 platform to test this with - are you using a particular board / setup that we could duplicate? I agree that using a ctor probably isn't that smart and that the alternative overload method you use is neater (although code as written won't work due to address assignment at line 108 of MPR121.cpp - but I can easily fix that). I don't understand the inversion of the NOT_INITED_BIT though - since it sits in a packed byte of active-high error flags - inverting it seems counterintuitive.

@stefandz
Copy link
Contributor

Hi @baruch did you see the last comment on this?

@stefandz
Copy link
Contributor

Hi again

I can't accept this pull request without being able to test at this end - if you're able to describe your test setup so that I can duplicate and test at this end I can work on approving the request - otherwise, sadly, I shall have to close this PR without merging.

Please let me know how you want to proceed.

@euphi
Copy link

euphi commented Dec 20, 2017

Just for information: I started to experiment with this library on ESP8266 in February and never had problems with the constructor?!

@stefandz
Copy link
Contributor

Thanks for this, @euphi - in your opinion does the library work on the ESP8266 platform?

@euphi
Copy link

euphi commented Dec 21, 2017

I wanted to say "yes, no problems", however, when thinking about this, I remember two strange issues:

  • A call to Wire.begin(SDA, SCL) later (e.g. in setup()) results in a reset BEFORE setup() is even called. So the Wire.begin() in the constructor may be the problem. (I don't had the time to investigate this further, maybe the later call has some impact which Wire.begin() is used by the linker?!?!). If Wire.begin(SDA, SCL) is not called in setup(), everything is fine.

  • I can't get I2C to run at all on a Wemos D1 Mini

For an example, see the (quite complex) project https://github.com/euphi/ESP-Touch/tree/Display_WS2812 :

  • in src/main.cpp lines 68 and 69 must be commented out otherwise there is a reset loop
  • I2C does not work on a Wemos D1_Mini (but on a ESP-12F or a ESP-ADC)

Note: The ESP-Touch project now uses my fork of MPR121 (see PR #8), but the sources are unchanged. During development I used the original library, the fork is only for platformio and travis-ci integration.

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.

3 participants