• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ osKernelStart函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中osKernelStart函数的典型用法代码示例。如果您正苦于以下问题:C++ osKernelStart函数的具体用法?C++ osKernelStart怎么用?C++ osKernelStart使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了osKernelStart函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
}
开发者ID:frankzzcn,项目名称:M2_SE_RTOS_Project,代码行数:11,代码来源:os_port_cmsis_rtos.c


示例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(;;);
}
开发者ID:acrepina,项目名称:STM32F7_serverWEB,代码行数:36,代码来源:main.c


示例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);

}
开发者ID:samuelint,项目名称:FreeRTOS-STM32F4-Eclipse-Template,代码行数:27,代码来源:main.cpp


示例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( ;; );
}
开发者ID:PaxInstruments,项目名称:STM32CubeF2,代码行数:32,代码来源:main.c


示例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
        }
    }
}
开发者ID:summivox,项目名称:bayanette-firmware,代码行数:31,代码来源:user_main.cpp


示例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);
  }
}
开发者ID:1847123212,项目名称:ebike-controller,代码行数:34,代码来源:main.c


示例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(;;);
}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:40,代码来源:main.c


示例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 
}
开发者ID:hptruong93,项目名称:Microprocessor-Fall-2015,代码行数:36,代码来源:main.c


示例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
}
开发者ID:kaidokert,项目名称:weos,代码行数:26,代码来源:test_main.cpp


示例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( ;; );
}
开发者ID:451506709,项目名称:automated_machine,代码行数:33,代码来源:main.c


示例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);
}
开发者ID:IvanOrfanidi,项目名称:STM32-Tests-Project,代码行数:33,代码来源:main.c


示例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( ;; );
}
开发者ID:acrepina,项目名称:STM32F7_serverWEB,代码行数:31,代码来源:main.c


示例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( ;; );
}
开发者ID:PaxInstruments,项目名称:STM32CubeF4,代码行数:30,代码来源:main.c


示例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);
}
开发者ID:oroca,项目名称:SkyRover_Nano,代码行数:38,代码来源:thread_main.c


示例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(;;);
}
开发者ID:dessel,项目名称:stf12,代码行数:35,代码来源:main.c


示例16: 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();
  
  /* Configure LED1 and LED3 */
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED3);
  
  /* Create Timer */
  osTimerDef(LEDTimer, osTimerCallback);
  osTimerId osTimer = osTimerCreate (osTimer(LEDTimer), osTimerPeriodic, NULL);
  
  /* Start Timer */
  osTimerStart(osTimer, 200);
 
  /* Create LED Thread */
  osThreadDef(LEDThread, ToggleLEDsThread, osPriorityNormal, 0, configMINIMAL_STACK_SIZE);
  osThreadCreate (osThread(LEDThread), NULL);
  
  /* Start scheduler */
  osKernelStart();

  /* We should never get here as control is now taken by the scheduler */
  for(;;);
}
开发者ID:Lembed,项目名称:STM32CubeF4-mirrors,代码行数:39,代码来源:main.c


示例17: main

int main(void){
	//Set procesor speed
	setToMaxSpeed();
	//Initialize kernel
	osKernelInitialize();
	//Hardware initialize
	led_init();
	//Initialize encoder
	timer_3_encoder_init();
	//Initialize PWM
	short myPrescaler=47;//set Tick time to 1us (Fclk/(Prescaler+1))
	int myAutorreload=1000;//set cycle time to 1ms
	TIMER2_CH2_PWM_Init(myPrescaler,myAutorreload);
	//Initialize serial
	os_serial_init();
	os_usart2_init(9600);
	//Initialize adc
	adc_poll_init();
	//Start Thread switching
	osKernelStart();
	//User Application
	float adc_reading;
	os_usart2_puts("Hello, World\n");
	while(1){
		adc_reading = adc_poll_read()*(100.0/4095);
		encoder_position=TIM_GetCounter(TIM3);
		
		os_serial_printf(os_usart2_puts,">>%d\n",turns_counter);
		TIMER2_CH2_PWM_SetDutyCycle((unsigned int) adc_reading,myAutorreload);
		osDelay(200);
	}
}
开发者ID:upiitacode,项目名称:MA_P1_MotorController,代码行数:32,代码来源:main.c


示例18: main

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  /* STM32L0xx HAL library initialization:
       - Configure the Flash prefetch, Flash preread and Buffer caches
       - Systick timer is configured by default as source of time base, but user 
             can eventually implement his proper time base source (a general purpose 
             timer for example or other time source), keeping in mind that Time base 
             duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and 
             handled in milliseconds basis.
       - Low Level Initialization
     */
  HAL_Init();  
  
  /* Configure the System clock to 2 MHz */
  SystemClock_Config();
  
  /* Initialize LEDs */
  BSP_LED_Init(LED3);
  
  /* Thread 1 definition */
  osThreadDef(LED, LED_Thread, osPriorityNormal, 0, configMINIMAL_STACK_SIZE);
  
  /* Start thread */
  LED_ThreadId = osThreadCreate(osThread(LED), NULL);
  
  /* Start scheduler */
  osKernelStart();
  
  /* We should never get here as control is now taken by the scheduler */
  for(;;);
}
开发者ID:pengphei,项目名称:STM32Cube_L0,代码行数:36,代码来源:main.c


示例19: 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();
  
  /* Configure LED1 and LED3 */
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED3);  
  
  /*##-1- Start task #########################################################*/
  osThreadDef(RAMDiskThread, StartThread, osPriorityNormal, 0, 2 * configMINIMAL_STACK_SIZE);
  osThreadCreate(osThread(RAMDiskThread), NULL);
  
  /*##-2- Start scheduler ####################################################*/
  osKernelStart();
  
  /* We should never get here as control is now taken by the scheduler */
  for( ;; );
}
开发者ID:PaxInstruments,项目名称:STM32CubeF4,代码行数:32,代码来源:main.c


示例20: main

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
    /* STM32F3xx HAL library initialization:
         - Configure the Flash prefetch
         - 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 64 MHz */
    SystemClock_Config();

    /* Initialize LED */
    BSP_LED_Init(LED2);

    /* Create Timer */
    osTimerDef(LEDTimer, osTimerCallback);
    osTimerId osTimer = osTimerCreate(osTimer(LEDTimer), osTimerPeriodic, NULL);
    /* Start Timer */
    osTimerStart(osTimer, 200);


    /* Start scheduler */
    osKernelStart();

    /* We should never get here as control is now taken by the scheduler */
    for (;;);

}
开发者ID:PaxInstruments,项目名称:STM32CubeF3,代码行数:35,代码来源:main.c



注:本文中的osKernelStart函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ osMessageCreate函数代码示例发布时间:2022-05-30
下一篇:
C++ os函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap