cwbe coordinatez:
101
63533
64889
5110514

ABSOLUT
KYBERIA
permissions
you: r,
system: public
net: yes

neurons

stats|by_visit|by_K
source
tiamat
K|my_K|given_K
last
commanders
polls

total descendants::4
total children::1
show[ 2 | 3] flat


I just uploaded a copy of StandardFirmata using what I believe will be much better hardware abstraction.
http://www.pjrc.com/tmp/firmata/

The concept is use two sets of macros, IS_PIN_xxx() to test if any particular pin supports a feature, and PIN_TO_xxx() to translate firmata pin numbers (as used in the protocol) to actual numbers used by the hardware functions.

Often these macros are very simple. But when a translation is needed, they can. For example, on a standard Arduino, for digital pins the macros are:

#define IS_PIN_DIGITAL(p) (((p) >= 2 && (p) <= 13) || ((p) >= 16 && (p) <= 21))
#define PIN_TO_DIGITAL(p) (((p) < 16) ? (p) : (p) - 2)

Pins 14 and 15 are not implemented, and pins 0 and 1 are not available for digital I/O due to being used for Rx and Tx. The PIN_PIN_DIGITAL() macro lets StandardFirmata easily adapt. The PIN_TO_DIGITAL() macro is used whenever calling pinMode, digitalWrite, digitalRead (but optimized 8 bit port access has to be special coded). For a standard Arduino, when the analog pins are used as digital I/O, this macro makes sure pinMode gets called correctly. Even though it's pin 16 as presented by Firmata, Arduino's pinMode function expected 14 to map to the first analog input.

The core concept behind this abstraction layer is every "firmata pin" may support any number of features which are checked with IS_PIN_xxx(), and if the feature is available, PIN_TO_xxx() translates the "firmata pin" into a "hardware pin". Everything in StandardFirmata works based on "firmata pins" and then checks and translation into "hardware pins" are used when actually performing I/O.

This simplifies the StandardFirmata code in many places. In the long run, I believe this approach will be much more maintainable, since it tends to make the code more readable. As more pin features are added, this scheme is simple to extend.

As promised, I've done quite a bit more testing. I modified Pduino to work with more pins and did quite a lot of testing on Arduino Mega (on 0017, there is a known bug with analog inputs 8 to 15, so be sure to patch your wiring_analog.c file, if you haven't already). I haven't tested everything in every possible way, but this does seem to be working quite well.

I realize this is a pretty substantial change. I hope you'll consider it.




0000010100063533000648890511051405110541
gnd
 gnd      08.01.2010 - 13:33:07 , level: 1, UP   NEW
no a ako sa to prejavi v samotnom pd-cku ? imho bude treba stale glupo nstavovat piny na analog / digital / pwm / whatever ... si nikdy nepamatam co je co :)

000001010006353300064889051105140511054105110570
dxtr
 dxtr      08.01.2010 - 13:44:31 , level: 2, UP   NEW
:]tak si tam supni pduino, tiez som na to talentovany
toto by mohlo slapat aspon rychlejsie
neskusal som

ja sa vecsinou spoliham na Kubriela a jeho kod

00000101000635330006488905110514051105410511057005111290
gnd
 gnd      08.01.2010 - 19:12:41 , level: 3, UP   NEW
ja sa spolieham na pduino-example (alebo pduino-help) a stade si to vzdy vyripujem co potrebujem :))

0000010100063533000648890511051405110541051105700511129005111313
dxtr
 dxtr      08.01.2010 - 19:24:31 , level: 4, UP   NEW
no hej len pduino fici na firmate
a firmata je dost pomala pretoze ma kopu veci okolo co prave nepotrebujes