#include "MDSFxx_SFR.h"
#include "XSFR_GLOBAL.h"
#include "Allhex.h"

#define E_CAPCKS 	0x07
#define EOK_CLR 	0x08
#define CAPPINSEL 	0x00
#define E_CAP_OK 	0x40
#define E_CAP_EN 	0x80

uint16 CaptureTotal;
uint16 CaptureTotalTemp;

// #if (E_CAPTURE_MODE==1)
	void EXCAP_Init (void){
		SFR_PAGE = 0; // External 
		CAPCONT = 0x92;
		//CAPCONT = E_CAP_EN | CAPPINSEL | 0x03;
		//CAPCONT = E_CAP_EN | CAPPINSEL | EOK_CLR | E_CAPCKS;
	}
// #else
	void CAP_Init (void){
		SFR_PAGE = 1; // Internal 
		CAPCONT = 0x97;
		//CAPCONT = E_CAP_EN | CAPPINSEL | 0x07;
		//CAPCONT = E_CAP_EN | CAPPINSEL | EOK_CLR | E_CAPCKS;
	}
// #endif