'class TwoWire' has no member named 'End'

keypunch
Posts: 67
Joined: Tue Aug 02, 2016 2:26 am

Re: 'class TwoWire' has no member named 'End'

Post by keypunch » Sun Jun 11, 2017 5:29 am

Roger,

Sorry I was not aware. Would you like me to delete these attachments.? I know when I have looked at posts here and many places elsewhere the links are dead, or very different content to context of post of time. Yes, the links are much better to look at. Mozilla keeps having a on/off success of PDFs of pages that look fine and then not. I was aware of the look of the PDFs prior to posting.

I will be happy to edit those posts and remove the attachments.

Regards,

John L. Males
Toronto, Ontario
Canada
11 June 2017 01:29 EDT
11 June 2017 01:30 EDT Minor messy typo corrections due to ongoing system buffer stresses. jlm

User avatar
RogerClark
Posts: 6911
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: 'class TwoWire' has no member named 'End'

Post by RogerClark » Sun Jun 11, 2017 5:42 am

Re: Teensy support for Wire.end()

Looks like it was added last year

https://github.com/PaulStoffregen/Wire/ ... 57b17982f6

(19 Mar 2016)

Code: Select all

+void TwoWire::end()
+{
+	NVIC_DISABLE_IRQ(IRQ_I2C0);
+	I2C0_C1 = 0;
+	CORE_PIN18_CONFIG = 0;
+	CORE_PIN19_CONFIG = 0;
+	SIM_SCGC4 &= ~SIM_SCGC4_I2C0; // TODO: use bitband
+}
Looks like Paul's code changes the pinMode, disables some interrupts and generally shuts down the I2C

as our default implementation is bitbanged, I think I''ll I'd need to do is to change the pinMode to INPUT. I don't think I should clear the pin variable

this->scl_pin=0;
this->sda_pin=0;

As this is only re-initialised in the constructor, and I presume that calling wire.begin() after wire.end() is acceptable

I've added the new function

User avatar
RogerClark
Posts: 6911
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: 'class TwoWire' has no member named 'End'

Post by RogerClark » Sun Jun 11, 2017 5:44 am

Hi John.

I can delete them. I don't know if you can fully delete them, the files may remain on the server and in this case it may be easier just to leave them than to break anything.

Re: Broken links

Yes, this can be a problem, but if Arduino.cc's website or Pauls or Github are no longer there, we probably have bigger problems than broken links

keypunch
Posts: 67
Joined: Tue Aug 02, 2016 2:26 am

Re: 'class TwoWire' has no member named 'End'

Post by keypunch » Sun Jun 11, 2017 5:50 am

Roger,

I checked the Teensy Core link of my post of the "Here is what I have found so far:". The PDFs were not meant to provide links. I provided those links in the posting. I did not provide the link to the Teensy Core github as the github link was in the postings of the Teensy Core link I provided and context of the issue raised in that Teensy Core link I provided. I provided the links to the github of the two Arduino related links because I did not find any links that referenced these Arduino github links in the searching I did that would provide context as the Teensy Core link did.


Regards,

John L. Males
Toronto, Ontario
Canada
11 June 2017 01:50

User avatar
RogerClark
Posts: 6911
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: 'class TwoWire' has no member named 'End'

Post by RogerClark » Sun Jun 11, 2017 5:54 am

John

Its not a big deal.

Leave the ones that are there.

Its just a note for the future ;-)

User avatar
RogerClark
Posts: 6911
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: 'class TwoWire' has no member named 'End'

Post by RogerClark » Sun Jun 11, 2017 5:56 am

I've now added end() to the Hardware I2C implementation

In this case I do the same thing that the destructor does, as it shuts down the IC2 device.

Again, if anyone has any code that uses end() please test it with the latest code from github

keypunch
Posts: 67
Joined: Tue Aug 02, 2016 2:26 am

Re: 'class TwoWire' has no member named 'End'

Post by keypunch » Sun Jun 11, 2017 6:03 am

Roger,

I will find the links that explains the reason for the use of wire.end() as related to some issues with I2C devices and/or how the Wire library handles these conditions. I think you will find the information more helpful for what this wire.end() is partly or all about. I also think it will answer your questions about wire.begin() as well as relates to wire.end(). I do not know anything about the core internals nor the trip ups I2C can have. I have had a few unrelated I2C trip ups already with "C" based code and I2C buses at the application level that make no sense. I suspect the OS low level fucntions changed when libraries and kernels were updated that had never been an issue prior to that specific OS update for the I2C bus at the most basic level and ease to test forlong ago that was fine. I will do this later Sunday my time or Monday. I want to try to see if I can be out in what will sadly be bit too warm and humid weather tomorrow if it is not mostly cloudy. I am trying to catch up on lost ground of things that this years weather has been very odd different that has hampered what I am trying to do that weather is a factor in.

Regards,

John L. Males
Toronto, Ontario
Canada
11 June 2017 02:03 EDT

keypunch
Posts: 67
Joined: Tue Aug 02, 2016 2:26 am

Re: 'class TwoWire' has no member named 'End'

Post by keypunch » Sun Jun 18, 2017 5:27 am

Roger,

I downloaded the updated Arduino_STM32-master.zip of last Sunday 12 June 2017 a few hours after you updated for wire.end(). Just as I was about install the updated Arduino_STM32-master.zip a power failure in my area occurred likely due to the heat stress on the hydro infrastructure of area.

I had a very busy week. As a result I was only able to test the wire.end() issue with the same code as I used initially a few minutes ago. Using Arduino_STM32-master.zip "Latest commit aef93f7 5 days ago" for "Moved encoderLookup LUT from flash to RAM to give 30% speed increase … " the code no longer has the

Code: Select all

579: error: 'class TwoWire' has no member named 'End'
       Wire.End () ;
            ^
as initially reported.

Sadly there is a new unrelated to wire.end(s) compile error. That error will be reported in a new topic.

Roger, thank you very much for the wire.end() fix.

I still need to look up the reason wire.end() is used as I discovered by chance when I implemented wire.end(s) in Spring 2017 with code using I2C. I think the URL will be helpful for you and others.

Regards,

John L. Males
Toronto, Ontario
Canada
18 June 2017 01:27 EDT

User avatar
RogerClark
Posts: 6911
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: 'class TwoWire' has no member named 'End'

Post by RogerClark » Sun Jun 18, 2017 5:32 am

John

Download it again.

My initial attempt had a typo (a missing ":" in the cpp file )

keypunch
Posts: 67
Joined: Tue Aug 02, 2016 2:26 am

Re: 'class TwoWire' has no member named 'End'

Post by keypunch » Sun Jun 18, 2017 5:36 am

Roger,

I will. I suspect the error I received is not related, but will download again and test. It will take about 10 minutes to when I will post if I still have what I believe is new unrelated error.

Regards,

John L. Males
Toronto, Ontario
Canada
18 June 2017 01:35 EDT

Post Reply