Updating library from arduino 10 to 13-15

I wrote a library for automating inputs to an Xbox 360 or other video game console using arduino release 10. It works fine using that release & a diecimila.

The latest arduino board I bought happened to be a Dumilanove with an atmega 328, because apparently the diecimila is no longer available. I'm trying to update the library to work with some release in 13 through 15 in order to be able to upload to the atmega 328.

After resolving the apparently common "include/stdlib.h:111: error: expected unqualified-id before 'int'" issue by including only WProgram.h instead of WConstants.h . . . the code will compile, and upload . . . but the timing code no longer works at all. The library is using low-level port manipulation for output and interrupts for timing, but the only relevant item I saw in the release notes since 10 was "* Added interrupts() and noInterrupts() functions", which I wouldnt expect to remove functionality.

I know its not an issue with the dumilanove board, I can successfully use a test script on a older diecimila with release 10; the exact same script and diecimila board with release 13 or 15 fails.

Current library code is at

http://code.google.com/p/vf-inputs/source/browse/trunk/hardware/libraries/?r=18#libraries/VF-13

test script is as simple as

#include <VF.h>

void setup() {
}

void loop() {
move(U);
frames(60):
move(D);
frames(60);
}

This results in port 13 being stuck (Up direction, onboard led on) and the rest of the loop never running. Replacing frames(60) with delay(1000) results in the expected behavior, alternate movement up and down, onboard led blinking on and off.

Any suggestions would be appreciated . . . heck at this point, any tips on where to buy a diecimila with an atmega 168 would be appreciated.

I might be wrong but I thing I've read something about

// interrupt handler
ISR(TIMER1_COMPA_vect) 
{
  frame_count++;
}

is replaced by something like

// interrupt handler
SIGNAL(TIMER1_COMPA_vect)
{
  frame_count++;
}

...but I am unfortunantly just guessing.

  while( is_waiting ) {
    ;
  }

Grrr . . . spinning works fine in arduino 10, not so much in 15

  while( is_waiting ) {
    delayMicroseconds(1);
  }

problem solved.