chipKIT® Development Platform

Inspired by Arduino™

Programming Hints

Posted 2013-02-16 13:42:25 by Majenko

Use defines

At the abstraction layer, everything is the same, at least we hope so. At the low level you will have to re-write it. You should NEVER include anything from the avr libraries i.e. #include <avr/io.h> for any project that does not use an AVR chip. From now on, you should be doing this:

/* For AVR */
#if defined(__AVR__)
    #include <avr/io.h>
#endif

/* For PIC32 */
#if defined(__PIC32MX__)
    #include <p32xxxx.h>    /* this gives all the CPU/hardware definitions */
    #include <plib.h>       /* this gives the i/o definitions */
#endif

There are also a few predefined macros which may be useful as arguments

Read more -->

1 ... 33 34 35 36