#ifndef __SOFTTIMER_H
#define __SOFTTIMER_H

#include <stdint.h>
#include "main.h"

#ifndef SOFTTIMERNUMS
#define SOFTTIMERNUMS 4 // random value
#endif

// NOTES:
// Please #define SOFTTIMERNUMS aNum before including this!

extern volatile uint16_t timer1_acc;
extern uint16_t softtimer_last[SOFTTIMERNUMS];


void softtimer_reset(uint8_t timernum);
uint8_t softtimer(uint8_t timernum, uint16_t interval);

// SOFTTIMER( <YOUR TIMER NUM>, <YOUR INTERVAL>);
#define SOFTTIMER(n,a) if(softtimer((n),(a*4)))


#endif
