Pages: [1]   Go Down
Author Topic: [Patch] cores/arduinowiring_digital.c  (Read 718 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good afternoon all,

I just started developing for the arduino, I must say it is a great way to get into embedded systems. I've been digging a little in the Arduino core to watch and learn and see if I could optimize anything. Although the libraries offer great functionality, speed is a bit of a concern in my next project.

Anyhow, I came across the following (see patch on pastebin).
It seems to me that this a little bit too much to call cli (and restoring) in every body of the if statement. with this patch my end-sketch is 10 bytes smaller. Ah well, I guess everything is welcome smiley-wink

Also for future references, where can I send patches to? I would assume there is some svn/git rep, but couldn't find anything on the homepage (unless I'm blind).

As last, I'm a bit concerned for the adc implementation. Ain't there a better way than spinning for the result?

Cheers, R

Patch:
http://pastebin.com/yxrZaXC4
Logged

Offline Offline
Edison Member
*
Karma: 19
Posts: 1041
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Without looking at the assembly, adding the cli() there probably at least doubles the number of clock cycles with interrupts disabled. There's a comparison or two and a branch.

http://code.google.com/p/arduino/issues/list
Logged

Pages: [1]   Go Up
Jump to: