本文整理汇总了C++中InitializeSystem函数的典型用法代码示例。如果您正苦于以下问题:C++ InitializeSystem函数的具体用法?C++ InitializeSystem怎么用?C++ InitializeSystem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了InitializeSystem函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
/*******************************************************************************
* Function Name: main
********************************************************************************
*
* Summary:
* Main function.
*
* Parameters:
* None
*
* Return:
* None
*
*******************************************************************************/
int main()
{
/* Setup the system initially */
InitializeSystem();
/* Three simple APIs that showcases dynamic ADV payload update */
for(;;)
{
/* Single API call to service all the BLE stack events. Must be
* called at least once in a BLE connection interval */
CyBle_ProcessEvents();
/* Configure the system in lowest possible power modes during and between BLE ADV events */
EnterLowPowerMode();
/*
LOW_POWER_NOTE - If you like to measure the current consumed by this project, following changes are to be
done to achieve lowest possible current number:
1. Set the "Debug Select" option under Dynamic Broadcaster.cydwr -> System -> Programming/Debugging to GPIO
2. Comment out Advertising_LED_Write(LED_ON); line of code in StackEventHandler routine
*/
#if ENABLE_DYNAMIC_ADV
DynamicADVPayloadUpdate();
#endif
}
}
示例2: main
void main(void) {
InitializeSystem();
while (1) {
// Comprueba el terminal que indica la conexión USB al inicio o al reset
if (PORTBbits.RB4 == 1) {
// Si no se ha activado el USB, lo activa
if ((USBGetDeviceState() == DETACHED_STATE)) {
USBDeviceAttach();
} else {
// Si ya se ha activado, realiza las tareas USB
// USB Tasks
blinkUSBStatus();
processUSBData();
}
} else {
// Si no está conectado el terminal USB, entra en modo de bajo consumo
USBDeviceDetach();
LATCbits.LATC0 = 0;
OSCCONbits.IDLEN = 0;
Sleep();
Nop();
}
}//end while
}//end main
示例3: Main
void Main() {
// Initialize the system:
sys_init();
InitializeSystem();
// Initialize the output:
TurnOnLCD();
Set8Led(0);
// Initialize the data:
InitializeGame();
// Initialize the input:
SetOnKeyboardDown(OnKeyboardDown);
InitializeKeyboardInterrupts();
SetOnButtonDown(OnButtonDown);
SetOnButtonUp(OnButtonUp);
InitializeButtonsInterrupts();
// Initialize the timers:
SimpleInitializeTimerInterrupts(TIMER_ID0, MAX_TIME_COUNT, (unsigned)UpdateOnTimer);
// Initialize the UART1:
InitializeUART(BAUDS_115200);
//ActivateInterruptsUART1((unsigned)OnReceiveUART);
// Call the main loop:
MainLoopWithPolling();
}
示例4: main
int main()
{
// Do some basic initialization tasks
InitializeSystem();
// Initialize pins for LEDs
InitializeLEDs();
// Enable printf via trace macrocell (get output with 'make trace')
EnableDebugOutput(DEBUG_ITM);
//printf("step\n %d");
//Turn on all LEDs
_Bool isOn = 0;
int val = 1 | 2 | 4 | 8;
while (1) {
if (isOn == 0) {
val = (val<<1) | (val<0);
SetLEDs(val);
isOn = 1;
} else {
SetLEDs(0 | 0 | 0 | 0);
isOn = 0;
iprintf("test\r\n");
}
Delay( 10 );
}
}
示例5: ResetParameters
CPSSpawnEffect::CPSSpawnEffect(int maxParticles, const Vector &origin, float scale, float scaledelta, float radius, float radiusdelta, float velocity, int sprindex, int r_mode, byte r, byte g, byte b, float a, float adelta, float timetolive)
{
index = 0;// the only good place for this
removenow = false;
ResetParameters();
if (!InitTexture(sprindex))
{
removenow = true;
return;
}
m_iMaxParticles = maxParticles;
VectorCopy(origin, m_vecOrigin);
m_fScale = scale;
m_fScaleDelta = scaledelta;
m_fRadius = radius;
m_fRadiusDelta = radiusdelta;
m_color.r = r;
m_color.g = g;
m_color.b = b;
m_fBrightness = a;
m_fBrightnessDelta = adelta;
m_iRenderMode = r_mode;
if (timetolive <= 0.0f)
m_fDieTime = -1.0f;
else
m_fDieTime = gEngfuncs.GetClientTime() + timetolive;
InitializeSystem();
m_iNumParticles = m_iMaxParticles;// all particles are present at start
for (int i = 0; i < m_iNumParticles; ++i)
InitializeParticle(i);
}
示例6: ResetParameters
CPSBubbles::CPSBubbles(int maxParticles, const Vector &origin, const Vector &direction, const Vector &spread, float partvelocity, float size, int sprindex, int frame, float PartEmitterLife)
{
index = 0;
removenow = false;
ResetParameters();
if (!InitTexture(sprindex))
{
removenow = true;
return;
}
m_iMaxParticles = maxParticles;
VectorCopy(origin, m_vecOrigin);
if (VectorCompare(origin, direction))
{
VectorClear(m_vecDirection);
m_flRandomDir = true;
}
else
{
VectorCopy(direction, m_vecDirection);
m_flRandomDir = false;
}
VectorCopy(spread, m_vecSpread);
m_fParticleVelocity = partvelocity;
m_iRenderMode = kRenderTransAdd;
m_iFrame = frame;
m_fScale = size;
if (PartEmitterLife <= 0)
m_fDieTime = -1;
else
m_fDieTime = gEngfuncs.GetClientTime() + PartEmitterLife;
InitializeSystem();
}
示例7: main
int main(void)
#endif
{
InitializeSystem();
#if defined(USB_INTERRUPT)
USBDeviceAttach();
#endif
while(1)
{
#if defined(USB_POLLING)
// Check bus status and service USB interrupts.
USBDeviceTasks(); // Interrupt or polling method. If using polling, must call
// this function periodically. This function will take care
// of processing and responding to SETUP transactions
// (such as during the enumeration process when you first
// plug in). USB hosts require that USB devices should accept
// and process SETUP packets in a timely fashion. Therefore,
// when using polling, this function should be called
// frequently (such as once about every 100 microseconds) at any
// time that a SETUP packet might reasonably be expected to
// be sent by the host to your device. In most cases, the
// USBDeviceTasks() function does not take very long to
// execute (~50 instruction cycles) before it returns.
#endif
// Application-specific tasks.
// Application related code may be added here, or in the ProcessIO() function.
ProcessIO();
}//end while
}//end main
示例8: main
int main ( void )
{
// Initialize the processor and peripherals.
if ( InitializeSystem() != TRUE )
{
UART2PrintString( "\r\n\r\nCould not initialize USB Custom Demo App - system. Halting.\r\n\r\n" );
while (1);
}
if ( USBHostInit(0) == TRUE )
{
UART2PrintString( "\r\n\r\n***** USB Custom Demo App Initialized *****\r\n\r\n" );
}
else
{
UART2PrintString( "\r\n\r\nCould not initialize USB Custom Demo App - USB. Halting.\r\n\r\n" );
while (1);
}
// Main Processing Loop
while (1)
{
// This demo does not check for overcurrent conditions. See the
// USB Host - Data Logger for an example of overcurrent detection
// with the PIC24F and the USB PICtail Plus.
// Maintain USB Host State
USBHostTasks();
// Maintain Demo Application State
ManageDemoState();
}
return 0;
} // main
示例9: main
/******************************************************************************
* Function: void main(void)
*
* PreCondition: None
*
* Input: None
*
* Output: None
*
* Side Effects: None
*
* Overview: Main program entry point.
*
* Note: None
*****************************************************************************/
int main(void)
{
InitializeSystem();
#if defined(USB_INTERRUPT)
USBDeviceAttach();
#endif
while(1)
{
#if defined(USB_POLLING)
// Check bus status and service USB interrupts.
USBDeviceTasks(); // Interrupt or polling method. If using polling, must call
// this function periodically. This function will take care
// of processing and responding to SETUP transactions
// (such as during the enumeration process when you first
// plug in). USB hosts require that USB devices should accept
// and process SETUP packets in a timely fashion. Therefore,
// when using polling, this function should be called
// regularly (such as once every 1.8ms or faster** [see
// inline code comments in usb_device.c for explanation when
// "or faster" applies]) In most cases, the USBDeviceTasks()
// function does not take very long to execute (ex: <100
// instruction cycles) before it returns.
#endif
// Application-specific tasks.
// Application related code may be added here, or in the ProcessIO() function.
ProcessIO();
}//end while
}//end main
示例10: main
int main(void) {
InitializeSystem();
// Wait for reset button to be released
while (_PORT(PIO_BTN1) == HIGH) { }
//ADCInitialize();
PWMInitialize();
PWMEnable();
USBDeviceInit();
//ADCStartCapture();
_LAT(PIO_LED1) = HIGH;
ColourEngine::Initialize();
//ColourEngine::PowerOn(1000); // Fade in
ColourEngine::SetPower(power, 0);
//_LAT(PIO_LED2) = HIGH;
while (1) {
USBDeviceTasks();
USBUserProcess();
}
return 0;
}
示例11: main
int main(void) {
InitializeSystem();
initADCDMA();
#if defined(USB_INTERRUPT)
if(USB_BUS_SENSE && (USBGetDeviceState() == DETACHED_STATE))
{
USBDeviceAttach();
}
#endif
#if defined(USB_POLLING)
// Check bus status and service USB interrupts.
USBDeviceTasks();
#endif
while(1)
{
if (!ADC_DATA_READY)
continue;
ADC_DATA_READY = 0;
RunFFT();
putrsUSBUSART((char*)&fftOut[0].real);
ProcessIO();
}
return (EXIT_SUCCESS);
}
示例12: BootMain
void BootMain(void)
#endif
{
//NOTE: The c018.o file is not included in the linker script for this project.
//The C initialization code in the c018.c (comes with C18 compiler in the src directory)
//file is instead modified and included here manually. This is done so as to provide
//a more convenient entry method into the bootloader firmware. Ordinarily the _entry_scn
//program code section starts at 0x00 and is created by the code of c018.o. However,
//the linker will not work if there is more than one section of code trying to occupy 0x00.
//Therefore, must not use the c018.o code, must instead manually include the useful code
//here instead.
//Make sure interrupts are disabled for this code (could still be on,
//if the application firmware jumped into the bootloader via software methods)
INTCON = 0x00;
//Initialize the C stack pointer, and other compiler managed items as
//normally done in the c018.c file (applicable when using C18 compiler)
#ifndef __XC8__
_asm
lfsr 1, _stack
lfsr 2, _stack
clrf TBLPTRU, 0
_endasm
#endif
//Clear the stack pointer, in case the user application jumped into
//bootloader mode with excessive junk on the call stack
STKPTR = 0x00;
// End of the important parts of the C initializer. This bootloader firmware does not use
// any C initialized user variables (idata memory sections). Therefore, the above is all
// the initialization that is required.
//Call other initialization code and (re)enable the USB module
InitializeSystem(); //Some USB, I/O pins, and other initialization
//Execute main loop
while(1)
{
ClrWdt();
//Need to call USBDeviceTasks() periodically. This function takes care of
//processing non-USB application related USB packets (ex: "Chapter 9"
//packets associated with USB enumeration)
USBDeviceTasks();
BlinkUSBStatus(); //When enabled, blinks LEDs on the board, based on USB bus state
LowVoltageCheck(); //Regularly monitor voltage to make sure it is sufficient
//for safe operation at full frequency and for erase/write
//operations.
ProcessIO(); //This is where all the actual bootloader related data transfer/self programming takes
//place see ProcessIO() function in the BootPIC[xxxx].c file.
}//end while
}
示例13: main
int main(void)
{
InitializeSystem();
USBDeviceAttach();
while(1)
{
}
}
示例14: main
/********************************************************************
* メイン関数
********************************************************************
*/
void main(void)
{
InitializeSystem();
while(1){
USBtask();
// LED2_blink();
}
}
示例15: main
/******************************************************************************
* Function: void main(void)
*
* PreCondition: None
*
* Input: None
*
* Output: None
*
* Side Effects: None
*
* Overview: Main program entry point.
*
* Note: None
*****************************************************************************/
void main(void)
{
InitializeSystem();
while(1)
{
USBTasks(); // USB Tasks
ProcessIO(); // See user\user.c & .h
}//end while
}//end main