Other Software Development
Topic: [Patch] cores/arduinowiring_digital.c
(Read 789 times)
Jul 03, 2012, 05:48 pm
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
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?
Re: [Patch] cores/arduinowiring_digital.c
Jul 04, 2012, 06:37 am
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.