signal11 / m-stack

Free USB Stack for PIC 16F, 18F, 24F, and 32MX Microcontrollers
http://www.signal11.us/oss/m-stack/
Other
182 stars 94 forks source link

Add support for compiling on vanilla mipsel GCC toolchain #15

Open etherealvisage opened 8 years ago

etherealvisage commented 8 years ago

As previously discussed in issue #14, I was working on supporting a vanilla mipsel GCC toolchain in m-stack. The changes I made are quite minor, but as they're in a working state now I feel it's probably appropriate to get some feedback here.

There are two main things to consider here:

  1. How do we detect a vanilla GCC as opposed to Microchip's modified XC32?
    • This may not be the best approach, but I decided to detect a 32-bit MIPS GCC-compatible compiler leave it at that. I haven't run exhaustive tests just yet, but putting these under the XC32 cases seems to work perfectly.
  2. How can we get access to C-like declarations of SFRs for M-stack to use?
    • Presumably, if one isn't using Microchip's XC32 compiler it may not be possible to have a standard header (xc.h) one can include to get access to useful SFR declarations, such as U1IR. However, there is already a standardized way to allow the user to configure things for the library, which is the file usb_config.h. As such, I assume now that if using a vanilla compiler, you must include a header file to provide SFR declarations.

Please let me know what you think! I'm happy to sign the ICLA and make any modifications you feel are necessary.

Thank you.