-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Added multi address slave #2403
base: master
Are you sure you want to change the base?
Conversation
|
According to this, stdbool.h was supported in C (not C++) since C99.
Better not use a macro, but just a
I'm not sure that a #warning actually triggers when a function is used, or when the function is defiend (e.g. when the preprocessor didnt' remove the #warning). In the latter case, perhaps the "deprecated" or "warning" function attribute may help, see https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html (note that "warning" is only mentioned at the top, but I suspect it works just like "deprecated"). |
I've added the gcc attribute warning that prints a warning only if the function is called somewhere in a microcontroller that doesn't have the TWAMR register. If you don't call it, it doesn't complain.
The
Is that really necessary? Doesn't the compiler automatically cast them to |
Also, if you call a function with an argument that exceeds the 8-bit limit, the |
I've committed any requested fix. Can you merge it? |
Sorry for the late reply @corna. After 1.6 release, your PR does not merge any more. Can you update it? We'll make the bot build a test IDE then, so to make others test your patch more easily. |
Now utility/twi.* is a pure AVR libc library, that can be used without Arduino
As reported here https://lists.nongnu.org/archive/html/avr-libc-commit/2005-11/msg00009.html <compat/twi.h> has been moved to <util/twi.h> in 2005
Added begin and setAddressAndMask warnings if called with mask on a uC without mask support
Rebased successfully
Is it correct? |
Warnings not being shown is a known issue, see #1728. |
@ArduinoBot build this please |
Build failed. |
Weird, I've built it successfully on my PC... Do you have the build log? |
An error in the job configuration. Fixed |
@ArduinoBot build this please |
Sorry it looks like I broke our bot |
@ArduinoBot build this please |
I don't have an Arduino at the moment, but I've previously tested it with an ATmega328P. The ATmega had an address mask of 0x08 (8 addresses) and it was able to manage each one independently. |
I've added a new preference "show all compiler warnings" that turns warnings on |
Sorry you've missed the news, but I don't work for arduino any more. See https://groups.google.com/a/arduino.cc/forum/#!msg/developers/YJLX6AZHem4/kpsLef7XBAAJ |
@ffissore Thx for the reply & good luck where you are now! |
@cmaglie Is there any chance to have this pull request integrated into mainline some time in the future? Thx a lot! |
|
I've removed the pullups enable in twi.c and I've moved it in Wire.cpp in order to make twi.h/twi.c usable in pure avr-libc projects
I've also added the multi address slave capability; the device can now respond multiple addresses (when configured as slave), and know which one was called thanks to twi_slaveAddress (in twi.c) or TwoWire::slaveAddress (in Wire.cpp). This feature is not supported on uCs without the TWAMR (two wire address mask register), like the ATMega8, and it is disabled with an #ifdef
These boards are: