//----------------------------------------------------------------------------
// C main line
//----------------------------------------------------------------------------
#include <m8c.h> // part specific constants and macros
#include "PSoCAPI.h" // PSoC API definitions for all User Modules
#pragma interrupt_handler Timer8_1ISR
#include "DigBuf_1.h"
BYTE Second;
void main(void)
{M8C_EnableGInt;
Timer8_1EnableInt();
Timer8_1Start();
void Timer8_1ISR()
{ int a,b,c,d,e,f,g,h;
for(a=0;a<=3;a++)
{ if(a=0)
{AMUX4_1InputSelect(O1h);
AMUX4_4InputSelect(0x00);
INSAMP_1Start(INSAMP_HIGHPOWER);
INSAMP_SetGain(INSAMP_G4_00);
CMPPRG_1SetRef(CMPPRG _REF0_021); // Set RefValue
CMPPRG_1Start(CMPPRG_MEDPOWER);
DigBuf_1EnableInt();
void DigBuf_1Start(void);
void DigBuf_1Stop(void);
}
if(a=1)
{AMUX4_1InputSelect(0x01);
AMUX4_4InputSelect(PORT0_0 0x01);
INSAMP_1Start(INSAMP_HIGHPOWER);
INSAMP_SetGain(INSAMP_G4_00);
CMPPRG_1SetRef(04h); // Set RefValue
CMPPRG_1Start(CMPPRG_MEDPOWER);
DigBuf_2EnableInt();
void DigBuf_2Start(void);
void DigBuf_2Stop(void);
}
if(a=2)
{AMUX4_1InputSelect(0x02);
AMUX4_4InputSelect(0x02);
INSAMP_1Start(INSAMP_HIGHPOWER);
INSAMP_SetGain(INSAMP_G4_00 30h);
CMPPRG_1SetRef(CMPPRG _REF0_021); // Set RefValue
CMPPRG_1Start(CMPPRG_MEDPOWER);
DigBuf_3EnableInt();
void DigBuf_3Start(void);
void DigBuf_3Stop(void);
}
if(a=3)
{AMUX4_1InputSelect(0x03);
AMUX4_4InputSelect(0x03);
INSAMP_1Start(INSAMP_HIGHPOWER);
INSAMP_SetGain(INSAMP_G4_00);
CMPPRG_1SetRef(CMPPRG _REF0_021); // Set RefValue
CMPPRG_1Start(CMPPRG_MEDPOWER);
DigBuf_1EnableInt();
void DigBuf_4Start(void);
void DigBuf_4Stop(void);
}