From: David A. M. <da...@me...> - 2012-06-23 15:01:26
|
I think they're just missing for the Leonardo. A patch to include them would be great. David On Sat, Jun 23, 2012 at 9:40 AM, Jeff Hoefs <sou...@gm...> wrote: > In the pins_arduino.h interface for the standard arduino variant > (hardware/arduino/variants/standard/) the following are defined: > > NUM_DIGITAL_PINS 20 > NUM_ANALOG_INPUTS 6 > analogInputToDigitalPin(p) ((p < 6) ? (p) + 14 : -1) > digitalPinHasPWM(p) ((p) == 3 || (p) == 5 || ... > ... > static const uint8_t LED_BUILTIN = 13 > > I don't see an equivalent to these in the Leonardo pins_arduino.h variant. > Are they defined elsewhere for Leonardo? Any board with a pins_arduino.h > variant will need to include these macros (and perhaps a couple of others > TBD) if we want to maintain scalability in Firmata by moving away from the > Boards.h interface in the Firmata library. > > I can submit a patch once any decisions have been made. For now however I'm > trying to raise a discussion on this list about the best way to move > forward. > > -jeff > > On Fri, Jun 22, 2012 at 11:06 PM, David A. Mellis <da...@me...> wrote: >> >> You can provide custom, per-variant pins_arduino.h files along with >> additional boards.txt files, so other ATmega32U4-based boards should >> be able to supply the necessary constants and other configuration. >> Let me know if there are other things we need to add to the >> pins_arduino.h files. Patches are even better. :) >> >> On Fri, Jun 22, 2012 at 9:06 PM, Jeff Hoefs <sou...@gm...> >> wrote: >> > I'm starting think about how to add Leonardo support to Firmata. The >> > immediate challenge is that both the Leonardo and Teensy 2.0 use the >> > same >> > AVR but have different pin mappings. So how to add Leonardo to boards.h >> > without affecting Teensy 2.0? My initial thought is to check if SDA >> > and/or >> > SCL is defined and mapped to pins 2 and 3. This will indicate a Leonardo >> > board (on Teensy 2.0 they are mapped to digital pins 5 and 6). So: >> > >> > // in Boards.h >> > >> > #elif defined(__AVR_ATmega32U4__) >> > #if defined(SDA) && SDA == 2 >> > // Leonardo definitions... >> > #else >> > // Teensy 2.0 definitions... >> > #endif >> > >> > >> > The more challenging, but perhaps better option (in terms of >> > scalability) >> > would be to try to replace most (if not all) of Boards.h with the >> > functionality now included in the variant definitions in the Arduino >> > core. >> > This would however remove functionality of boards currently in boards.h >> > that >> > do not have a variant in the Arduino core. Another thing I haven't >> > looked >> > into yet are the different pin mappings other Arduino-compatible boards >> > using the ATmega32U4 may have and how they could be supported by >> > Firmata. >> > Hello fragmentation :( >> > >> > Any thoughts any other ideas? >> > >> > -jeff >> > >> > >> > ------------------------------------------------------------------------------ >> > Live Security Virtual Conference >> > Exclusive live event will cover all the ways today's security and >> > threat landscape has changed and how IT managers can respond. >> > Discussions >> > will include endpoint security, mobile security and the latest in >> > malware >> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> > _______________________________________________ >> > Firmata-devel mailing list >> > Fir...@li... >> > https://lists.sourceforge.net/lists/listinfo/firmata-devel >> > > > |