mkoval / hax

Hardware Abstraction for VEX is a C hardware abstraction layer for the VEX Robotics PIC18 and ARM Cortex M3 micrcontrollers. See the Wiki for a more detailed overview and for a guide to get started.
http://ieee.rutgers.edu/content/hax
6 stars 8 forks source link

Cross-Platform Pin Indexing #14

Closed mkoval closed 14 years ago

mkoval commented 14 years ago

Before supporting two-wire motors, we need to standardize cross-platform pin indexing. My suggestion is to always mimic the hardware's physical numbering, with exception of the PIC's dedicated interrupt pins. Those pins should be treated as as extra digital inputs. Thoughts?

codyps commented 14 years ago

sure. go for it. realize that this means fixing all functions that take a "pin index" (including the interrupt ones). It will also make interrupt_get useless (as the index spaces will be "the same")

mkoval commented 14 years ago

Good point about interrupt_get(). With this change, I will remove it and add a clarifying comment to digital_get().

mkoval commented 14 years ago

This should be complete in my develop branch. If it looks alright to you, I'll go ahead and merge it into master. Odds are there's a bug or two, though...

codyps commented 14 years ago

fixed a few bugs. see my branch for changes.

mkoval commented 14 years ago

Pulled and merged into master. Hopefully it's bug-free.

mkoval commented 14 years ago

Instead of attempting the impossible with cross-platform indexing, we should use internal unique indexes that are aliased by handy macros. I'll be working on this in my develop branch.

mkoval commented 14 years ago

Seems done in master, although it has not been tested on actual hardware.