本文整理汇总了C++中InitTimers函数的典型用法代码示例。如果您正苦于以下问题:C++ InitTimers函数的具体用法?C++ InitTimers怎么用?C++ InitTimers使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了InitTimers函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
void main()
{
InitSystemClock();
InitPortsIO();
InitTimers();
EnableInterrupts();
while (1)
{
GENSendPacketIR(0x00,0xF7,0x20,0xDF); //Led "Game"
GENDelay100Us(500);
GENSendPacketIR(0x00,0xF7,0xA0,0x5E); //Led "TV"
GENDelay100Us(500);
GENSendPacketIR(0x00,0xFC,0xA1,0x5E); //Led "DVD"
GENDelay100Us(500);
/*GENSendPacketIR(0x03,0xFC,0x51,0xAE); //Led "CD/MP3"
GENDelay100Us(500);
GENSendPacketIR(0x03,0xFC,0x11,0xEE); //Led "Game"
GENDelay100Us(500);
GENSendPacketIR(0x03,0xFC,0xB1,0x4E); //Led "TV"
GENDelay100Us(500);
GENSendPacketIR(0x03,0xFC,0xA1,0x5E); //Led "DVD"
GENDelay100Us(500);
GENSendPacketIR(0x03,0xFC,0xB1,0x4E); //Led "TV"
GENDelay100Us(500);
GENSendPacketIR(0x03,0xFC,0x11,0xEE); //Led "Game"
GENDelay100Us(500); */
}
}
示例2: ParMETIS_V3_PartGeom
/***********************************************************************************
* This function is the entry point of the parallel ordering algorithm.
* This function assumes that the graph is already nice partitioned among the
* processors and then proceeds to perform recursive bisection.
************************************************************************************/
void ParMETIS_V3_PartGeom(idxtype *vtxdist, int *ndims, float *xyz, idxtype *part, MPI_Comm *comm)
{
int i, npes, mype, nvtxs, firstvtx, dbglvl;
idxtype *xadj, *adjncy;
CtrlType ctrl;
WorkSpaceType wspace;
GraphType *graph;
int zeroflg = 0;
MPI_Comm_size(*comm, &npes);
MPI_Comm_rank(*comm, &mype);
if (npes == 1) {
idxset(vtxdist[mype+1]-vtxdist[mype], 0, part);
return;
}
/* Setup a fake graph to allow the rest of the code to work unchanged */
dbglvl = 0;
nvtxs = vtxdist[mype+1]-vtxdist[mype];
firstvtx = vtxdist[mype];
xadj = idxmalloc(nvtxs+1, "ParMETIS_PartGeom: xadj");
adjncy = idxmalloc(nvtxs, "ParMETIS_PartGeom: adjncy");
for (i=0; i<nvtxs; i++) {
xadj[i] = i;
adjncy[i] = firstvtx + (i+1)%nvtxs;
}
xadj[nvtxs] = nvtxs;
/* Proceed with the rest of the code */
SetUpCtrl(&ctrl, npes, dbglvl, *comm);
ctrl.seed = mype;
ctrl.CoarsenTo = amin(vtxdist[npes]+1, 25*npes);
graph = Moc_SetUpGraph(&ctrl, 1, vtxdist, xadj, NULL, adjncy, NULL, &zeroflg);
PreAllocateMemory(&ctrl, graph, &wspace);
/*=======================================================
* Compute the initial geometric partitioning
=======================================================*/
IFSET(ctrl.dbglvl, DBG_TIME, InitTimers(&ctrl));
IFSET(ctrl.dbglvl, DBG_TIME, MPI_Barrier(ctrl.gcomm));
IFSET(ctrl.dbglvl, DBG_TIME, starttimer(ctrl.TotalTmr));
Coordinate_Partition(&ctrl, graph, *ndims, xyz, 0, &wspace);
idxcopy(graph->nvtxs, graph->where, part);
IFSET(ctrl.dbglvl, DBG_TIME, MPI_Barrier(ctrl.gcomm));
IFSET(ctrl.dbglvl, DBG_TIME, stoptimer(ctrl.TotalTmr));
IFSET(ctrl.dbglvl, DBG_TIME, PrintTimingInfo(&ctrl));
FreeInitialGraphAndRemap(graph, 0);
FreeWSpace(&wspace);
FreeCtrl(&ctrl);
GKfree((void **)&xadj, (void **)&adjncy, LTERM);
}
示例3: METIS_WPartGraphRecursive
/*************************************************************************
* This function is the entry point for PWMETIS that accepts exact weights
* for the target partitions
**************************************************************************/
void METIS_WPartGraphRecursive(int *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
idxtype *adjwgt, int *wgtflag, int *numflag, int *nparts,
floattype *tpwgts, int *options, int *edgecut, idxtype *part)
{
int i, j;
GraphType graph;
CtrlType ctrl;
floattype *mytpwgts;
if (*numflag == 1)
Change2CNumbering(*nvtxs, xadj, adjncy);
SetUpGraph(&graph, OP_PMETIS, *nvtxs, 1, xadj, adjncy, vwgt, adjwgt, *wgtflag);
if (options[0] == 0) { /* Use the default parameters */
ctrl.CType = PMETIS_CTYPE;
ctrl.IType = PMETIS_ITYPE;
ctrl.RType = PMETIS_RTYPE;
ctrl.dbglvl = PMETIS_DBGLVL;
}
else {
ctrl.CType = options[OPTION_CTYPE];
ctrl.IType = options[OPTION_ITYPE];
ctrl.RType = options[OPTION_RTYPE];
ctrl.dbglvl = options[OPTION_DBGLVL];
}
ctrl.optype = OP_PMETIS;
ctrl.CoarsenTo = 20;
ctrl.maxvwgt = 1.5*(idxsum(*nvtxs, graph.vwgt)/ctrl.CoarsenTo);
mytpwgts = fmalloc(*nparts, "PWMETIS: mytpwgts");
for (i=0; i<*nparts; i++)
mytpwgts[i] = tpwgts[i];
InitRandom(-1);
AllocateWorkSpace(&ctrl, &graph, *nparts);
IFSET(ctrl.dbglvl, DBG_TIME, InitTimers(&ctrl));
IFSET(ctrl.dbglvl, DBG_TIME, starttimer(ctrl.TotalTmr));
*edgecut = MlevelRecursiveBisection(&ctrl, &graph, *nparts, part, mytpwgts, 1.000, 0);
IFSET(ctrl.dbglvl, DBG_TIME, stoptimer(ctrl.TotalTmr));
IFSET(ctrl.dbglvl, DBG_TIME, PrintTimers(&ctrl));
FreeWorkSpace(&ctrl, &graph);
free(mytpwgts);
if (*numflag == 1)
Change2FNumbering(*nvtxs, xadj, adjncy, part);
}
示例4: METIS_EdgeND
/*************************************************************************
* This function is the entry point for OEMETIS
**************************************************************************/
void METIS_EdgeND(int *nvtxs, idxtype *xadj, idxtype *adjncy, int *numflag, int *options,
idxtype *perm, idxtype *iperm)
{
int i, j;
GraphType graph;
CtrlType ctrl;
if (*numflag == 1)
Change2CNumbering(*nvtxs, xadj, adjncy);
SetUpGraph(&graph, OP_OEMETIS, *nvtxs, 1, xadj, adjncy, NULL, NULL, 0);
if (options[0] == 0) { /* Use the default parameters */
ctrl.CType = OEMETIS_CTYPE;
ctrl.IType = OEMETIS_ITYPE;
ctrl.RType = OEMETIS_RTYPE;
ctrl.dbglvl = OEMETIS_DBGLVL;
}
else {
ctrl.CType = options[OPTION_CTYPE];
ctrl.IType = options[OPTION_ITYPE];
ctrl.RType = options[OPTION_RTYPE];
ctrl.dbglvl = options[OPTION_DBGLVL];
}
ctrl.oflags = 0;
ctrl.pfactor = -1;
ctrl.nseps = 1;
ctrl.optype = OP_OEMETIS;
ctrl.CoarsenTo = 20;
ctrl.maxvwgt = 1.5*(idxsum(*nvtxs, graph.vwgt)/ctrl.CoarsenTo);
InitRandom(-1);
AllocateWorkSpace(&ctrl, &graph, 2);
IFSET(ctrl.dbglvl, DBG_TIME, InitTimers(&ctrl));
IFSET(ctrl.dbglvl, DBG_TIME, starttimer(ctrl.TotalTmr));
MlevelNestedDissection(&ctrl, &graph, iperm, ORDER_UNBALANCE_FRACTION, *nvtxs);
IFSET(ctrl.dbglvl, DBG_TIME, stoptimer(ctrl.TotalTmr));
IFSET(ctrl.dbglvl, DBG_TIME, PrintTimers(&ctrl));
for (i=0; i<*nvtxs; i++)
perm[iperm[i]] = i;
FreeWorkSpace(&ctrl, &graph);
if (*numflag == 1)
Change2FNumberingOrder(*nvtxs, xadj, adjncy, perm, iperm);
}
示例5: MCUInit
/**
* @fn void MCUInit()
*
* @brief Sets the microcontroller to a predetermined state. Handles initialization
* for all categories of peripherals: Analog, Architecture, Communication,
* Data Converters, GPIO, LCD, Special Modules, Timers.
*
*/
void MCUInit()
{
#if defined(__MCU_MSP430_SERIES)
InitAnalog(); // Initialize the Analog modules
InitArchitecture(); // Initialize the Architecture modules
InitCommunication(); // Initialize the Communication modules
InitDataConverters(); // Initialize the Data Converter modules
InitGPIO(); // Initialize the GPIO modules
InitLCD(); // Initialize the LCD modules
InitSpecialModules(); // Initialize the Special modules
InitTimers(); // Initialize the Timers modules
#endif
}
示例6: InitBoard
/*
* Initialize the board
* Timers, Communication, etc
* Note : Should only be called once at the begginning of the main
*/
void InitBoard(void)
{
// Initialize clock
SYSTEMConfigPerformance(GetSystemClock());
SYSTEMConfig(GetSystemClock(), SYS_CFG_PCACHE);
SYSTEMConfig(GetSystemClock(), SYS_CFG_PB_BUS);
SYSTEMConfigPB(GetSystemClock());
INTEnableSystemMultiVectoredInt();
//Disable JTAG port
DDPCONbits.JTAGEN = 0;
// Initialize LEDs
LED1_TRIS = 0;
LED2_TRIS = 0;
// Initialize Timers
InitTimers();
// Initialize CAN bus
CRX1_TRIS = 1;
CTX1_TRIS = 0;
netv_init_can_driver(GetBoardID(),CAN1);
// Initialize digital IOs as inputs
DIO_TRIS |= DIO_MASK;
// Initialize Relays (low)
RELAY1_TRIS = 0;
RELAY2_TRIS = 0;
RELAY1 = 0;
RELAY2 = 0;
// Initialize SPI pins as inputs
SPICLK_TRIS = 1;
SPISDO_TRIS = 1;
SPI_CS_TRIS = 1;
SPISDI_TRIS = 1;
//TODO: Init unused pins as inputs
// Read the board ID
m_unBoardId = (DIO_PORT & DIO_MASK) ^ DIO_MASK;
// Read the parameters previously saved in flash
loadDataFromMemory();
//Enables the core to handle any pending interrupt requests
asm volatile ("ei");
}
示例7: METIS_mCPartGraphKway
/*************************************************************************
* This function is the entry point for KWMETIS
**************************************************************************/
void METIS_mCPartGraphKway(int *nvtxs, int *ncon, idxtype *xadj, idxtype *adjncy,
idxtype *vwgt, idxtype *adjwgt, int *wgtflag, int *numflag,
int *nparts, floattype *rubvec, int *options, int *edgecut,
idxtype *part)
{
int i, j;
GraphType graph;
CtrlType ctrl;
if (*numflag == 1)
Change2CNumbering(*nvtxs, xadj, adjncy);
SetUpGraph(&graph, OP_KMETIS, *nvtxs, *ncon, xadj, adjncy, vwgt, adjwgt, *wgtflag);
if (options[0] == 0) { /* Use the default parameters */
ctrl.CType = McKMETIS_CTYPE;
ctrl.IType = McKMETIS_ITYPE;
ctrl.RType = McKMETIS_RTYPE;
ctrl.dbglvl = McKMETIS_DBGLVL;
}
else {
ctrl.CType = options[OPTION_CTYPE];
ctrl.IType = options[OPTION_ITYPE];
ctrl.RType = options[OPTION_RTYPE];
ctrl.dbglvl = options[OPTION_DBGLVL];
}
ctrl.optype = OP_KMETIS;
ctrl.CoarsenTo = amax((*nvtxs)/(20*log2Int(*nparts)), 30*(*nparts));
ctrl.nmaxvwgt = 1.5/(1.0*ctrl.CoarsenTo);
InitRandom(-1);
AllocateWorkSpace(&ctrl, &graph, *nparts);
IFSET(ctrl.dbglvl, DBG_TIME, InitTimers(&ctrl));
IFSET(ctrl.dbglvl, DBG_TIME, starttimer(ctrl.TotalTmr));
ASSERT(CheckGraph(&graph));
*edgecut = MCMlevelKWayPartitioning(&ctrl, &graph, *nparts, part, rubvec);
IFSET(ctrl.dbglvl, DBG_TIME, stoptimer(ctrl.TotalTmr));
IFSET(ctrl.dbglvl, DBG_TIME, PrintTimers(&ctrl));
FreeWorkSpace(&ctrl, &graph);
if (*numflag == 1)
Change2FNumbering(*nvtxs, xadj, adjncy, part);
}
示例8: main
void main ()
{
// Initializing PIC16LF1827
InitPorts();
InitTimers();
InitInterrupts();
while(1)
{
}
}
示例9: main
/***********LED Blinky Example**********************************************************************/
int main()
{
LPC_GPIO0->FIODIR |= (1 << 22); // set P0.22 to output
LPC_GPIO0->FIOPIN &= ~(1 << 22); //and turn the LED off.
InitTimers(); //initialize the timer;
can_init(125000);
//CAN_Init(LPC_CAN2, 125000);
OLCB_NodeID *id = new OLCB_NodeID(1,2,3,4,5,6);
while(1)
{
LPC_GPIO0->FIOPIN ^= (1 << 22); // Toggle P1.29
delay(500);
}
return 0;
}
示例10: METIS_WPartGraphKway2
/*************************************************************************
* This function is the entry point for KWMETIS with seed specification
* in options[7]
**************************************************************************/
void METIS_WPartGraphKway2(idxtype *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *nparts,
float *tpwgts, idxtype *options, idxtype *edgecut, idxtype *part)
{
idxtype i, j;
GraphType graph;
CtrlType ctrl;
if (*numflag == 1)
Change2CNumbering(*nvtxs, xadj, adjncy);
SetUpGraph(&graph, OP_KMETIS, *nvtxs, 1, xadj, adjncy, vwgt, adjwgt, *wgtflag);
if (options[0] == 0) { /* Use the default parameters */
ctrl.CType = KMETIS_CTYPE;
ctrl.IType = KMETIS_ITYPE;
ctrl.RType = KMETIS_RTYPE;
ctrl.dbglvl = KMETIS_DBGLVL;
}
else {
ctrl.CType = options[OPTION_CTYPE];
ctrl.IType = options[OPTION_ITYPE];
ctrl.RType = options[OPTION_RTYPE];
ctrl.dbglvl = options[OPTION_DBGLVL];
}
ctrl.optype = OP_KMETIS;
ctrl.CoarsenTo = 20*(*nparts);
ctrl.maxvwgt = 1.5*((graph.vwgt ? idxsum(*nvtxs, graph.vwgt, 1) : (*nvtxs))/ctrl.CoarsenTo);
InitRandom(options[7]);
AllocateWorkSpace(&ctrl, &graph, *nparts);
IFSET(ctrl.dbglvl, DBG_TIME, InitTimers(&ctrl));
IFSET(ctrl.dbglvl, DBG_TIME, gk_startcputimer(ctrl.TotalTmr));
*edgecut = MlevelKWayPartitioning(&ctrl, &graph, *nparts, part, tpwgts, 1.03);
IFSET(ctrl.dbglvl, DBG_TIME, gk_stopcputimer(ctrl.TotalTmr));
IFSET(ctrl.dbglvl, DBG_TIME, PrintTimers(&ctrl));
FreeWorkSpace(&ctrl, &graph);
if (*numflag == 1)
Change2FNumbering(*nvtxs, xadj, adjncy, part);
}
示例11: ClassicLadder_InitAllDatas
void ClassicLadder_InitAllDatas( void )
{
InitVars();
#ifdef OLD_TIMERS_MONOS_SUPPORT
InitTimers();
InitMonostables();
#endif
InitCounters();
InitTimersIEC();
InitArithmExpr();
InitRungs();
InitSections( );
#ifdef SEQUENTIAL_SUPPORT
InitSequential( );
#endif
InitSymbols( );
}
示例12: ParMETIS_FusedElementGraph
/***********************************************************************************
* This function creates the fused-element-graph and returns the partition
************************************************************************************/
void ParMETIS_FusedElementGraph(idxtype *vtxdist, idxtype *xadj, realtype *vvol,
realtype *vsurf, idxtype *adjncy, idxtype *vwgt, realtype *adjwgt,
int *wgtflag, int *numflag, int *nparts, int *options,
idxtype *part, MPI_Comm *comm)
{
int npes, mype, nvtxs;
CtrlType ctrl;
WorkSpaceType wspace;
GraphType *graph;
MPI_Comm_size(*comm, &npes);
MPI_Comm_rank(*comm, &mype);
nvtxs = vtxdist[mype+1]-vtxdist[mype];
/* IFSET(options[OPTION_DBGLVL], DBG_TRACK, printf("%d ParMETIS_FEG npes=%d\n",mype, npes)); */
SetUpCtrl(&ctrl, *nparts, options, *comm);
ctrl.CoarsenTo = amin(vtxdist[npes]+1, 25*amax(npes, *nparts));
graph = SetUpGraph(&ctrl, vtxdist, xadj, vwgt, adjncy, adjwgt, *wgtflag);
graph->where = part;
PreAllocateMemory(&ctrl, graph, &wspace);
IFSET(ctrl.dbglvl, DBG_TIME, InitTimers(&ctrl));
IFSET(ctrl.dbglvl, DBG_TIME, MPI_Barrier(ctrl.gcomm));
IFSET(ctrl.dbglvl, DBG_TIME, starttimer(ctrl.TotalTmr));
CreateFusedElementGraph(&ctrl, graph, &wspace, numflag);
idxcopy(nvtxs, graph->where, part);
IFSET(ctrl.dbglvl, DBG_TIME, MPI_Barrier(ctrl.gcomm));
IFSET(ctrl.dbglvl, DBG_TIME, stoptimer(ctrl.TotalTmr));
if (((*wgtflag)&2) == 0)
IMfree((void**)&graph->vwgt, LTERM);
IMfree((void**)&graph->lperm, &graph->peind, &graph->pexadj, &graph->peadjncy,
&graph->peadjloc, &graph->recvptr, &graph->recvind, &graph->sendptr,
&graph->imap, &graph->sendind, &graph, LTERM);
FreeWSpace(&wspace);
FreeCtrl(&ctrl);
}
示例13: SetOnClock
void CIA6526::DoInit() {
// initialize base class
Chip::DoInit();
// set function to call at each clock
SetOnClock((pfn)OnClock);
SetBusy();
// initialize components
Reset.Init("Reset", this);
Reset.SetOnHigh((pfn)OnReset);
Reset.SetOnLow((pfn)OnReset);
InitPorts();
InitTimers();
InitTOD();
InitSDR();
InitControl();
// reset components
OnReset();
};
示例14: InitHardware
//=========================================================================
//----- (00000C48) --------------------------------------------------------
__myevic__ void InitHardware()
{
SYS_UnlockReg();
// 32.768kHz external crystal
if ( dfStatus.x32off )
{
CLK_DisableXtalRC( CLK_PWRCTL_LXTEN_Msk );
}
else
{
SYS->GPF_MFPL &= ~(SYS_GPF_MFPL_PF0MFP_Msk|SYS_GPF_MFPL_PF1MFP_Msk);
SYS->GPF_MFPL |= (SYS_GPF_MFPL_PF0MFP_X32_OUT|SYS_GPF_MFPL_PF1MFP_X32_IN);
CLK_EnableXtalRC( CLK_PWRCTL_LXTEN_Msk );
CLK_WaitClockReady( CLK_STATUS_LXTSTB_Msk );
}
SetPWMClock();
SYS_LockReg();
#if (ENABLE_UART)
InitUART0();
#endif
InitGPIO();
if ( !PD3 )
{
gFlags.noclock = 1;
}
InitSPI0();
InitEADC();
InitPWM();
InitTimers();
InitUSB();
}
示例15: main
/*********************************************************************
* Function: main
*********************************************************************/
void main(void) {
u32 ResponseCount;
void *pExitCriticalArg;
u32 i; //loop variable
// initialize the EZ-Kit
ezInit(1);
// initialize the flag manager because the LEDs and buttons connect via flags
// Since callbacks are not being used memory does not to be given to the service
ezErrorCheck(adi_flag_Init(NULL, 0, &ResponseCount, NULL));
//***CODE SNIPPED****//
InitTimers();
while (1) {
//***CODE SNIPPED****//
}
} // END WHILE