Closed gogi640 closed 2 years ago
Hello Goran, thanks for the info and your suggestion to support the missing MCP.
There is another approach to support the missing device. It would be completely transparent to any user programs that don't need to access the second MCP. If you look at branch v0.9.5, in the src/drivers/rtc_pcf85063.cpp
at the beginning of the RTC::setup()
method, the following lines appear:
wire.begin_transmission(rtc_address);
present = wire.end_transmission() == ESP_OK;
if (!present) return false;
I think that a similar approach can be used to verify the presence of the second MCP (in fact, it would verify the presence of any MCP). An added method like bool RTC::is_present()
would then allow the code to check the presence. No need to modify the user's code then.
Please comment, Cheers! Guy
Thinking again about this issue, my proposal is the one to implement as the EPUB-Inkplate application would only require an update to the current version. It would not require implementing specific releases for the missing MCP as the code will automatically detect its presence or not.
I will push a new branch (v0.9.6) with the automatic detection of the second MCP. Would it be possible for you to check if it works as all my devices (Inkplate-10 and 6PLUS) do have the second MCP?
Branch v0.9.6 is now available. Please comment.
As the MCP detection code is working. I'm closing the PR.
New Inkplates are shipped without second MCP I/O expander because of chip shortage. If Inkplate without second MCP I/O expander is programmed using this library, it will hang out on function that is setting it's pins to LOW state, so in this commit is added part of code which stops it.