'class TwoWire' has no member named 'End'

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

'class TwoWire' has no member named 'End'

Post by keypunch » Sat Jun 10, 2017 2:59 am

I tried to compile a sketch I coded for Arduino during long and extended months I waited for orders to arrived for targets Maple Mini and Generic STM32F103C. Both failed with:

Code: Select all

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

1) Arduino Linux64 V1.8.2
2) Arduino_STM32-master.zip 29 May 2017.

Same sketch compiles fine for Arduino Zero, M0, and Due.

Able to compile Blink sketch for any Arduino board, Maple Mini, Maple RET6, and any of the Generic STM32F103 boards.

Regards,

John L. Males
Toronto, Ontario
Canada
09 June 2017 22:58 EDT

User avatar
Rick Kimball
Posts: 1057
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

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

Post by Rick Kimball » Sat Jun 10, 2017 3:09 am

isn't it endTransmission()?
https://www.arduino.cc/en/reference/wire
-rick

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

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

Post by keypunch » Sat Jun 10, 2017 3:25 am

Rick,

The link you posted is interesting for two reasons. I happened to end up with wire.end() from actual Arduino Arduino shell code I pulled and then wrote much of the code I did. The wire.end() came from base DS3231 code that I then enhanced quite a bit. Interesting as when I compile for any Arduino target including M0, Due and Zero those compiles never complain about wire.end() and the sketch has been working just fine for few months with the wire.end().

I will try the endTransmission() and see if sketch will compile for Arduino targets and also the STM32 Maple Mini and Generic STM32F103C target. I may not get to this evening. If weather is good tomorrow I want to be out to do some things I was not able to in the excellent weather of past few days as much as I tried. I have a very commited upcoming week, so all the more reason I wish to try to be out for tomorrow if the weather is good or a certain bad I also like.

Thanks again for your point Rick.


Regards,

John L. Males
Toronto, Ontario
Canada
09 June 2017 23:25 EDT

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

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

Post by RogerClark » Sat Jun 10, 2017 9:00 am


danieleff
Posts: 336
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

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

Post by danieleff » Sat Jun 10, 2017 2:53 pm

RogerClark wrote:https://www.arduino.cc/en/Reference/Wire

Does not have end()
I think the documentation is wrong, because there is Wire.end() in Arduino.

User avatar
Rick Kimball
Posts: 1057
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

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

Post by Rick Kimball » Sat Jun 10, 2017 2:58 pm

There seems to be a define to let you know if it has "end()"

https://github.com/arduino/Arduino/blob ... Wire.h#L31

// WIRE_HAS_END means Wire has end()
#define WIRE_HAS_END 1
-rick

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

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

Post by RogerClark » Sat Jun 10, 2017 8:59 pm

There are loads of functions that are not documented in the public API

My guess is that the docs show what is supposed to be the piblic API but as legacy code uses all the undocumented features, its too late to make them provate member functions



https://github.com/arduino/Arduino/blob ... re.cpp#L78

I also womder after callinb end() how to re-enable the bus. But I presume that begin() must somehow do this, just not explicitly have an enable() function

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 4:44 am

I have been wondering why there was never a problem compiling the code I wrote about 3-4 months ago for an Arduino as I was stalled, and still am, due to 150+ day parts delivery.

Here is what I have found so far:

Arduino - Implement Wire.end() for AVR core #3724
Arduino - Implement Wire.end() for SAM core #3894
Teensy Core - Why is Wire.end() not implemented ?

When I wrote the code for the Arduino application that uses as part of the application a DS3231 I stumbled onto a posting of code that handled certain conditions of the I2C bus and Wire Library and other unique conditions. Part of this includes a wire.end() call. I did not look up the Arduino Wire Library as someone had been using the code that used wire.end(). When I used that sequence of code that included wire.end() there was never an error in compiling the sketch concering the wire.end() call. It was not until I decided to compile this code I wrote using a Maple Mini target did I receive an error about the use of wire.end(). I tried the STM32F103C target just in case there might be a different compile result using the wire.end() function in the code. There was not. The same error.

I looked at the Arduino WireEndTransmission just in case there might be some mention or reference to wire.end(). There is no mention, nor reference, to wire.end(). That said there is a need and has been a need for wire.end() for while it appears. Why wire.end() is not documented in https://www.arduino.cc/en/Reference/Wire is anyone's guess. Perhaps the links I provided in "Here is what I have found so far:" will shed some light on why and what wire.end() is about.

The key personal project I will be writing code for will use a DS3231 and a few other I2C devices. Perhaps it might be a consideration to implement wire.end() in Arduino_STM32 notwithstanding I cannot find any documentation so far for the wire.end() except by way of code changes made to libraries to implement. Perhaps secondary changes may bear out the reason for the wire.end() API call.


Regards,

John L. Males
Toronto, Ontario
Canada
11 June 2017 00:44 EDT
11 June 2017 01:02 - 01:17 EDT Minor typo errors corrected due to System Buffers Stresses Ongoing. jlm

P.S. The PDFs I have attached are for later historical reference should the current referenced items change address and/or content with respect to current findings as of this post. jlm
Attachments
forum.pjrc.com_threads_33485-Why-is-Wire-end()-not-implemented-20170610.html.pdf
(159.82 KiB) Downloaded 9 times
github.com_arduino_Arduino_pull_3894_files-20170610.html.pdf
(244.32 KiB) Downloaded 5 times
github.com_arduino_Arduino_pull_3724_files-20170610.html.pdf
(188.16 KiB) Downloaded 5 times
Last edited by keypunch on Sun Jun 11, 2017 5:17 am, edited 6 times in total.

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 4:58 am

There appears to be a limit of 3 attachments per post.

The attachments of this post are the balance of the historical references I wanted to include in my prior post.

Regards,

John L. Males
Toronto, Ontario
Canada
11 June 2017 00:58 EDT
Attachments
www.arduino.cc_en_Reference_WireEndTransmission-20170610.html.pdf
(73.98 KiB) Downloaded 28 times
playground.arduino.cc_Main_WireLibraryDetailedReference-20170610.html.pdf
(178.8 KiB) Downloaded 7 times

User avatar
RogerClark
Posts: 7459
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:21 am

John

Sorry to be a pain, but I'd rather you posted links to those pages rather than PDF printouts.

Those PDF's don't look as good as the original pages.
The pages are publically accessible so don't need to be copied by printing to PDF
Links in the PDF eg to the PJRC forum don't work, so I can't look at the changes to his code in github

I had to google the partial link in your PDF to find the actual code https://forum.pjrc.com/threads/33485-Wh ... mplemented

These attachment files cause my backup burden to increase, and its already beyond what my hosting company do for free, hence I have to manually backup the attachments on the board.

Thanks

Roger

Post Reply