

#include	<cfxbios.h>		// Persistor BIOS and I/O Definitions
#include	<cfxpico.h>		// Persistor PicoDOS Definitions
#include <stdio.h>
#include "accel.h"
#include "pta.h"

ulong pulse_isr(int chan)
{
//ulong counts;
//counts = 65536*TPU.PRAM[chan][4] + TPU.PRAM[chan][5];

/* Clear MSB of counter */
//TPU.PRAM[chan][4] = 0;



//printf("Chan = %d, Counts = %ld \n",chan,counts);

/* Clear interrupt. */
//TPU.CISR &= ~(1 << chan);
pta_stop(chan);  // Disable PTA, Makes Accel read One Shot


//return counts;
return 65536*TPU.PRAM[chan][4] + TPU.PRAM[chan][5];

}










