/*
** Stack limit and trap test
**
*/

#include <p24fj128ga010.h>


void  __attribute__(( interrupt, no_auto_psv))
    _StackError( void)
{
    while( 1);
}    


// a recursive function 
int call( int a)
{
    if ( a>1)
        return call(a-1)+1;
    else 
        return 1;
} // call
    
    int i = 40;

int main()
{
    //SPLIM-=6;
	TRISA = 0x0;
	PORTA = call(i);
	
	while(1);
	
} // main
