本文整理汇总了C++中osKernelStart函数的典型用法代码示例。如果您正苦于以下问题:C++ osKernelStart函数的具体用法?C++ osKernelStart怎么用?C++ osKernelStart使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osKernelStart函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: osStartKernel
void osStartKernel(void)
{
//Check CMSIS-RTOS API version
#if (osCMSIS >= 0x10001)
//Start the kernel
osKernelStart();
#else
//Start the kernel
osKernelStart(NULL, NULL);
#endif
}
示例2: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* Enable the CPU Cache */
CPU_CACHE_Enable();
/* STM32F7xx HAL library initialization:
- Configure the Flash ART accelerator on ITCM interface
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Low Level Initialization
*/
HAL_Init();
/* Configure the system clock to 216 Mhz */
SystemClock_Config();
/* Initialize LEDs */
BSP_LED_Init(LED1);
/* Thread 1 definition */
osThreadDef(LED1, LED_Thread1, osPriorityNormal, 0, configMINIMAL_STACK_SIZE);
/* Start thread 1 */
LED1_ThreadId = osThreadCreate(osThread(LED1), NULL);
/* Start scheduler */
osKernelStart();
/* We should never get here as control is now taken by the scheduler */
for(;;);
}
示例3: main
int main(void)
{
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Initialize all configured peripherals */
MX_GPIO_Init();
/* Create the threads and semaphore */
osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 128);
defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
osThreadDef(blinkTask, BlinkTask, osPriorityNormal, 0, 128);
blinkTaskHandle = osThreadCreate(osThread(blinkTask), NULL);
osSemaphoreDef(sem);
semHandle = osSemaphoreCreate(osSemaphore(sem), 1);
osSemaphoreWait(semHandle, osWaitForever);
/* Start scheduler */
osKernelStart();
/* We should never get here as control is now taken by the scheduler */
/* Infinite loop */
while (1);
}
示例4: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* STM32F2xx HAL library initialization:
- Configure the Flash prefetch, instruction and Data caches
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Global MSP (MCU Support Package) initialization
*/
HAL_Init();
/* Configure the system clock to 120 MHz */
SystemClock_Config();
/* Start task */
osThreadDef(USER_Thread, StartThread, osPriorityNormal, 0, 8 * configMINIMAL_STACK_SIZE);
osThreadCreate(osThread(USER_Thread), NULL);
/* Create Application Queue */
osMessageQDef(osqueue, 1, uint16_t);
AppliEvent = osMessageCreate(osMessageQ(osqueue), NULL);
/* Start scheduler */
osKernelStart();
/* We should never get here as control is now taken by the scheduler */
for( ;; );
}
示例5: user_main
extern "C" void user_main() {
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_0, GPIO_PIN_SET);
osKernelInitialize();
osKernelStart();
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_0, GPIO_PIN_RESET);
key_event_init();
keymat_init();
keymat_callback = key_event_handler;
keymat_start();
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_0, GPIO_PIN_SET);
while (1) {
osEvent ose = osMailGet(key_events, osWaitForever);
if (ose.status == osEventMail) {
KeyEvent* e = (KeyEvent*)ose.value.p;
// NOTE: MIDI handling is hardcoded for now
buf[0] = (e->state ? 0x90 : 0x80); // use ch0
buf[1] = e->keycode;
buf[2] = 100; // use hard-coded velocity
osMailFree(key_events, e);
send_n(3); // blocking call
}
}
}
示例6: main
/*
* Application entry point.
*/
int main(void) {
/* HAL initialization, this also initializes the configured device drivers
and performs the board-specific initializations.*/
halInit();
/* The kernel is initialized but not started yet, this means that
main() is executing with absolute priority but interrupts are
already enabled.*/
osKernelInitialize();
/* Activates the serial driver 2 using the driver default configuration.
PA2(TX) and PA3(RX) are routed to USART2.*/
sdStart(&SD2, NULL);
palSetPadMode(GPIOA, 2, PAL_MODE_ALTERNATE(7));
palSetPadMode(GPIOA, 3, PAL_MODE_ALTERNATE(7));
/* Creates the example thread, it does not start immediately.*/
osThreadCreate(osThread(Thread1), NULL);
/* Kernel started, the main() thread has priority osPriorityNormal
by default.*/
osKernelStart();
/* In the ChibiOS/RT CMSIS RTOS implementation the main() is an
usable thread, here we just sleep in a loop printing a message.*/
while (true) {
sdWrite(&SD2, (uint8_t *)"Hello World!\r\n", 14);
osDelay(500);
}
}
示例7: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* STM32F4xx HAL library initialization:
- Configure the Flash prefetch, instruction and Data caches
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Global MSP (MCU Support Package) initialization
*/
HAL_Init();
/* Configure the system clock to 168 MHz */
SystemClock_Config();
/* Configure LED1 and LED2 */
BSP_LED_Init(LED1);
BSP_LED_Init(LED2);
/* Thread 1 definition */
osThreadDef(LED1, LED_Thread1, osPriorityNormal, 0, configMINIMAL_STACK_SIZE);
/* Thread 2 definition */
osThreadDef(LED2, LED_Thread2, osPriorityNormal, 0, configMINIMAL_STACK_SIZE);
/* Start thread 1 */
LEDThread1Handle = osThreadCreate(osThread(LED1), NULL);
/* Start thread 2 */
LEDThread2Handle = osThreadCreate(osThread(LED2), NULL);
/* Start scheduler */
osKernelStart();
/* We should never get here as control is now taken by the scheduler */
for(;;);
}
示例8: main
/*
* Main function: initializes all system values and components, then starts
* operation of the two threads.
*
* @author HP Truong, Jacob Barnett
*
* @param void
* @return void
*/
int main (void) {
CC2500_LowLevel_Init();
CC2500_Reset();
osKernelInitialize (); // initialize CMSIS-RTOS
// initialize peripherals here
/* LCD initiatization */
LCD_Init();
/* LCD Layer initiatization */
LCD_LayerInit();
/* Enable the LTDC controler */
LTDC_Cmd(ENABLE);
/* Set LCD foreground layer as the current layer */
LCD_SetLayer(LCD_FOREGROUND_LAYER);
LCD_SetFont(&Font16x24);
LCD_Clear(LCD_COLOR_WHITE);
receive_and_plot_thread = osThreadCreate(osThread(receive_and_plot), NULL);
print_lcd_debug_thread = osThreadCreate(osThread(print_lcd_debug), NULL);
osKernelStart (); // start thread execution
}
示例9: main
int main()
{
printf("main() started\n");
#if 0
runTests(0);
while (1);
#else
osThreadDef_t testRunnerThread = {&runTests, osPriorityNormal, 1, 0};
if (osKernelInitialize() != osOK
|| osKernelStart() != osOK
|| osThreadCreate(&testRunnerThread, 0) == NULL)
{
showError();
}
while (1)
{
osDelay(10000);
}
#endif
}
示例10: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* STM32F4xx HAL library initialization:
- Configure the Flash prefetch, instruction and Data caches
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Global MSP (MCU Support Package) initialization
*/
HAL_Init();
/* Configure the system clock to 180 MHz */
SystemClock_Config();
/* Init task */
#if defined(__GNUC__)
osThreadDef(Start, StartThread, osPriorityNormal, 0, configMINIMAL_STACK_SIZE * 5);
#else
osThreadDef(Start, StartThread, osPriorityNormal, 0, configMINIMAL_STACK_SIZE * 2);
#endif
osThreadCreate (osThread(Start), NULL);
/* Start scheduler */
osKernelStart();
/* We should never get here as control is now taken by the scheduler */
for( ;; );
}
示例11: main
int main()
{
InitGPIO();
InitBKP();
Set_System();
Set_USBClock();
USB_Interrupts_Config();
USB_Init();
rtc_init();
/*
RTC_t date;
date.year = 2015;
date.month = 10;
date.mday = 24;
date.hour = 23;
date.min = 20;
date.sec = 0;
rtc_settime(&date);
*/
// Start Task //
xTaskCreate(vLcdTask, "vLcdTask", configMINIMAL_STACK_SIZE * 1, NULL, tskIDLE_PRIORITY + 1, &xHandleLcdTask);
xTaskCreate(vDebugTask, "vDebugTask", configMINIMAL_STACK_SIZE * 1, NULL, tskIDLE_PRIORITY + 1, &xHandleDebugTask);
// Start scheduler //
osKernelStart(NULL, NULL);
}
示例12: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* Enable the CPU Cache */
CPU_CACHE_Enable();
/* STM32F7xx HAL library initialization:
- Configure the Flash ART accelerator on ITCM interface
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Global MSP (MCU Support Package) initialization
*/
HAL_Init();
/* Configure the system clock to 200 MHz */
SystemClock_Config();
/* Init task */
osThreadDef(Start, StartThread, osPriorityBelowNormal, 0, configMINIMAL_STACK_SIZE *2);
osThreadCreate (osThread(Start), NULL);
/* Start the scheduler */
osKernelStart();
/* We should never get here as control is now taken by the scheduler */
for( ;; );
}
示例13: main
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* STM32F446xx HAL library initialization */
HAL_Init();
/* Configure the system clock to 180 Mhz */
SystemClock_Config();
/* Initialize IO expander */
BSP_IO_Init();
/* Start task */
osThreadDef(USER_Thread, StartThread, osPriorityNormal, 0, 8 * configMINIMAL_STACK_SIZE);
osThreadCreate(osThread(USER_Thread), NULL);
/* Create Application Queue */
osMessageQDef(osqueue, 1, uint16_t);
AppliEvent = osMessageCreate(osMessageQ(osqueue), NULL);
/* Start scheduler */
osKernelStart();
/* We should never get here as control is now taken by the scheduler */
for( ;; );
}
示例14: thread_main
/*---------------------------------------------------------------------------
TITLE : thread_main
WORK :
ARG : void
RET : void
---------------------------------------------------------------------------*/
void thread_main(void)
{
Mutex_Loop = osMutexCreate( osMutex(MUTEX1) );
if( Mutex_Loop == NULL ) DEBUG_PRINT("Mutex Fail\r\n");
//-- Thread 1 definition
//
osThreadDef(TASK1, thread_mw , osPriorityNormal, 0, configMINIMAL_STACK_SIZE);
osThreadDef(TASK2, thread_menu, osPriorityNormal, 0, configMINIMAL_STACK_SIZE);
osThreadDef(TASK3, thread_lcd, osPriorityNormal, 0, configMINIMAL_STACK_SIZE);
//-- Start thread
//
Thread_Handle_mw = osThreadCreate(osThread(TASK1), NULL);
Thread_Handle_menu = osThreadCreate(osThread(TASK2), NULL);
Thread_Handle_lcd = osThreadCreate(osThread(TASK3), NULL);
//-- Start scheduler
//
osKernelStart(NULL, NULL);
while(1);
}
示例15: main
int main(int argc, char* argv[]) {
// Send a greeting to the trace device (skipped on Release).
trace_puts("Hello ARM World!");
// At this stage the system clock should have already been configured
// at high speed.
trace_printf("System clock: %uHz\n", SystemCoreClock);
/* Configure GPIO's to AN to reduce power consumption */
GPIO_ConfigAN();
/* Initialize LED1 */
BSP_LED_Init(LED1);
/* Create the queue used by the two threads */
osMessageQDef(osqueue, QUEUE_LENGTH, uint16_t);
osQueue = osMessageCreate (osMessageQ(osqueue), NULL);
/* Note the Tx has a lower priority than the Rx when the threads are
spawned. */
osThreadDef(RxThread, QueueReceiveThread, osPriorityNormal, 0, configMINIMAL_STACK_SIZE);
osThreadCreate(osThread(RxThread), NULL);
osThreadDef(TxThread, QueueSendThread, osPriorityBelowNormal, 0, configMINIMAL_STACK_SIZE);
osThreadCreate(osThread(TxThread), NULL);
/* Start scheduler */
osKernelStart (NULL, NULL);
/* We should never get here as control is now taken by the scheduler */
for(;;);
}