Go Down

Topic: suggestion to add TOGGLE in digitalWrite() (Read 5 times) previous topic - next topic

BenF

Quote
The code should read

No, it should not! Go and look it up.

deSilva

#6
Aug 19, 2010, 10:32 pm Last Edit: Aug 20, 2010, 11:40 am by mpeuser Reason: 1
:o

I see....
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1266933248/3#3
---
And it works for the 168 and 328 only, not with old mega8

westfw

Ah.  Using the PINx magic toggle port, and a variation of the FastDigitalWrite macro that has been floating around, it should be possible to create a "digitalToggle()" function (macro) that takes up no space unless it is used, and operates in a single cycle if all the arguments are constant, and IT DOESN'T HAVE TO BE BACKWARD COMPATIBLE WITH ANYTHING!
:-)

cr0sh

Quote
Well, changing the "any non-zero value causes a 1 to be written" behavior may screw up any number of existing sketches...


I don't necessarily think this is "one of those times", but sometimes you have to decide to say "fsck backwards compatibility" and make a change "for the better".

Deprecate and move on...

;)
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Osgeld

coughheaderspacingcough (although its way too late for that)

now what were you saying?


Go Up