本文整理汇总了C++中Main::runLoop方法的典型用法代码示例。如果您正苦于以下问题:C++ Main::runLoop方法的具体用法?C++ Main::runLoop怎么用?C++ Main::runLoop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main::runLoop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResetISR
/*
* Reset Interrupt handler
* This methods gets called by the MCU on soft and hard reset (eg. startup)
*/
extern "C" void ResetISR(void)
{
uint8_t *src, *dst, *end;
// Copy the data segment initializers from flash to SRAM
src = (uint8_t *) &_text_end;
dst = (uint8_t *) &_data_start;
end = (uint8_t *) &_data_end;
while (dst < end) {
*dst++ = *src++;
}
// Zero fill the bss segment
__asm(" ldr r0, =_bss_start\n"
" ldr r1, =_bss_end\n"
" mov r2, #0\n"
" .thumb_func\n"
"zero_loop:\n"
" cmp r0, r1\n"
" it lt\n"
" strlt r2, [r0], #4\n"
" blt zero_loop");
#ifndef TARGET_QEMU
// Enable FPU
MAP_FPUEnable();
MAP_FPULazyStackingEnable();
// Setup clock
#if MCU_CLOCK == CLK80
MAP_SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
#elif MCU_CLOCK == CLK66
MAP_SysCtlClockSet(SYSCTL_SYSDIV_3 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
#elif MCU_CLOCK == CLK50
MAP_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
#else
MAP_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
#endif
// Initialize the system tick timer
SystemTimer::initialize();
#endif
// Initialize the interrupt router helper
InterruptRouter::initialize();
// Start application
Main mainApp;
while(1) {
Runtime::runLoop();
mainApp.runLoop();
}
}