Adding extra pins to Mega2560 Definintion

Hi all.

I have built a board, wired PE6, PE7 out to headers. I want to try and edit my pins_arduino.c file to add Arduino pin numbers to these pins.

I want to use them with attachInterrupt and digitalRead functions as if they were pins 70-71.

I've had a read of pins_arduino.c and its just a bit to forign to me to start changing stuff. Can anyone provide a clue as to How I do it? Just add an extra two lines of :

const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { 
 // PIN IN PORT
    // -------------------------------------------
    _BV( 0 )    , // PE 0 ** 0 ** USART0_RX
    _BV( 1 )    , // PE 1 ** 1 ** USART0_TX
    _BV( 4 )    , // PE 4 ** 2 ** PWM2  
....

and

const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
    // PORTLIST
    // -------------------------------------------
    PE  , // PE 0 ** 0 ** USART0_RX
    PE  , // PE 1 ** 1 ** USART0_TX
    PE  , // PE 4 ** 2 ** PWM2
    PE  , // PE 5 ** 3 ** PWM3

But what about this stuff? :

const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
    // TIMERS
    // -------------------------------------------
    NOT_ON_TIMER    , // PE 0 ** 0 ** USART0_RX
    NOT_ON_TIMER    , // PE 1 ** 1 ** USART0_TX
    TIMER3B , // PE 4 ** 2 ** PWM2
    TIMER3C , // PE 5 ** 3 ** PWM3
    TIMER0B , // PG 5 ** 4 ** PWM4

etc etc...

Hope thats clear enough on what I'm trying to achieve..

Cheers

Matt

You're looking at the right places.

Stick the PEs where you want them to show - at the end if you want them as the next Digital pins.

_BV( 4 ) change these to the port pins you want

NOT_ON_TIMER , add these in next section if they not Timer pins, otherwise add TIMER0B , corresponding to the timer they are.

Make sure to get them in the same place in all three sections.