本文整理汇总了C++中osThread函数的典型用法代码示例。如果您正苦于以下问题:C++ osThread函数的具体用法?C++ osThread怎么用?C++ osThread使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osThread函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Init_ThreadADC2
int Init_ThreadADC2 (void) {
tid_ADC2 = osThreadCreate (osThread(Thread_ADC2), NULL);
if (!tid_ADC2) return(-1);
return(0);
}
开发者ID:buczio,项目名称:sterowanieADC,代码行数:7,代码来源:ADC2_Thread.c
示例2: 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 LED3 */
BSP_LED_Init(LED1);
BSP_LED_Init(LED3);
/*##-1- Start task #########################################################*/
osThreadDef(USER_Thread, StartThread, osPriorityNormal, 0, 8 * configMINIMAL_STACK_SIZE);
osThreadCreate(osThread(USER_Thread), NULL);
/*##-2- Create Application Queue ###########################################*/
osMessageQDef(osqueue, 1, uint16_t);
AppliEvent = osMessageCreate(osMessageQ(osqueue), NULL);
/*##-3- Start scheduler ####################################################*/
osKernelStart();
/* We should never get here as control is now taken by the scheduler */
for( ;; );
}
开发者ID:451506709,项目名称:automated_machine,代码行数:36,代码来源:main.c
示例3: start_Thread_Temperature
/**
* @brief Start temperature monitoring thread
* @param none
* @retval none
*/
int start_Thread_Temperature(void) {
ADC1_Config(); /* configure temperature ADC */
tid_Thread_Temperature = osThreadCreate(osThread(Thread_Temperature), NULL);
if (!tid_Thread_Temperature) return -1;
return 0;
}
开发者ID:felixdube,项目名称:microprocessor-systems,代码行数:12,代码来源:Thread_Temp.c
示例4: MX_FREERTOS_Init
void MX_FREERTOS_Init(void) {
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* USER CODE BEGIN RTOS_MUTEX */
/* add mutexes, ... */
/* USER CODE END RTOS_MUTEX */
/* USER CODE BEGIN RTOS_SEMAPHORES */
/* add semaphores, ... */
/* USER CODE END RTOS_SEMAPHORES */
/* USER CODE BEGIN RTOS_TIMERS */
/* start timers, add new ones, ... */
/* USER CODE END RTOS_TIMERS */
/* Create the thread(s) */
/* definition and creation of defaultTask */
osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 128);
defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
/* USER CODE BEGIN RTOS_THREADS */
/* add threads, ... */
/* USER CODE END RTOS_THREADS */
/* USER CODE BEGIN RTOS_QUEUES */
/* add queues, ... */
/* USER CODE END RTOS_QUEUES */
}
开发者ID:shorai,项目名称:stackoverflow,代码行数:30,代码来源:freertos.c
示例5: 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 have a frequency of 200 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:acrepina,项目名称:STM32F7_serverWEB,代码行数:35,代码来源:main.c
示例6: k_StorageInit
/**
* @brief Storage drives initialization
* @param None
* @retval None
*/
void k_StorageInit(void)
{
/* Link the USB Host disk I/O driver */
FATFS_LinkDriver(&USBH_Driver, USBDISK_Drive);
/* Link the micro SD disk I/O driver */
FATFS_LinkDriver(&SD_Driver, mSDDISK_Drive);
/* Create USB background task */
osThreadDef(STORAGE_Thread, StorageThread, osPriorityBelowNormal, 0, 2 * configMINIMAL_STACK_SIZE);
osThreadCreate (osThread(STORAGE_Thread), NULL);
/* Create Storage Message Queue */
osMessageQDef(osqueue, 10, uint16_t);
StorageEvent = osMessageCreate (osMessageQ(osqueue), NULL);
/* Init Host Library */
USBH_Init(&hUSB_Host, USBH_UserProcess, 0);
/* Add Supported Class */
USBH_RegisterClass(&hUSB_Host, USBH_MSC_CLASS);
/* Start Host Process */
USBH_Start(&hUSB_Host);
/* Enable SD Interrupt mode */
BSP_SD_Init();
BSP_SD_ITConfig();
if(BSP_SD_IsDetected())
{
osMessagePut ( StorageEvent, MSDDISK_CONNECTION_EVENT, 0);
}
}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:39,代码来源:k_storage.c
示例7: 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:eemei,项目名称:library-stm32f4,代码行数:30,代码来源:main.c
示例8: main
/**@brief Function for application main entry.
*/
int main(void)
{
uint32_t err_code;
bool erase_bonds;
// Initialize.
timers_init();
buttons_leds_init(&erase_bonds);
ble_stack_init();
device_manager_init(erase_bonds);
gap_params_init();
advertising_init();
services_init();
sensor_simulator_init();
conn_params_init();
ble_evt_pool = osPoolCreate(osPool(ble_evt_pool));
ble_stack_msg_box = osMessageCreate(osMessageQ(ble_stack_msg_box), NULL);
// Start execution.
ble_stack_thread_id = osThreadCreate(osThread(ble_stack_thread), NULL);
UNUSED_VARIABLE(ble_stack_thread_id);
application_timers_start();
err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
APP_ERROR_CHECK(err_code);
// Enter main loop.
for (;; )
{
UNUSED_VARIABLE(osDelay(1000));
}
}
开发者ID:IOIOI,项目名称:nRF51,代码行数:34,代码来源:main.c
示例9: 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();
/* Initialize LED1 and buttons */
BSP_LED_Init(LED1);
BSP_PB_Init(BUTTON_TAMPER, BUTTON_MODE_EXTI);
/* Define used semaphore */
osSemaphoreDef(SEM);
/* Create the semaphore used by the two threads. */
osSemaphore = osSemaphoreCreate(osSemaphore(SEM) , 1);
/* Create the Thread that toggle LED1 */
osThreadDef(SEM_Thread, SemaphoreTest, osPriorityNormal, 0, semtstSTACK_SIZE);
osThreadCreate(osThread(SEM_Thread), (void *) osSemaphore);
/* Start scheduler */
osKernelStart (NULL, NULL);
/* We should never get here as control is now taken by the scheduler */
for(;;);
}
开发者ID:ClintHaerinck,项目名称:STM32Cube_FW_F4,代码行数:38,代码来源:main.c
示例10: HCBoxInit
void HCBoxInit( void )
{
// switch ( Configure.HeaterType )
// {
// default:
// case enumHeaterNone: MsgBox( "未安装恒温箱", vbOKOnly ); break;
// case enumHCBoxOnly: Configure_HCBox(); break;
// case enumHeaterOnly: Configure_Heater(); break;
// case enumHCBoxHeater: MsgBox( "硬件不能支持", vbOKOnly ); break;
// }
// set_HCBoxTemp( Configure.HCBox_SetTemp * 0.1f, Configure.HCBox_SetMode );
switch ( Configure.HeaterType )
{
default:
case enumHeaterNone:
break; // MsgBox( "未安装恒温箱", vbOKOnly ); break;
case enumHCBoxOnly:
set_HCBoxTemp( Configure.HCBox_SetTemp * 0.1f, Configure.HCBox_SetMode );
Set_HCBox_Temp( Configure.HCBox_SetTemp * 0.1f, Configure.HCBox_SetMode );
osThreadCreate( osThread( _task_HCBox ), NULL );
break;
case enumHeaterOnly:
set_HeaterTemp( Configure.Heater_SetTemp * 0.1f);
break;
case enumHCBoxHeater:
set_HCBoxTemp( Configure.HCBox_SetTemp * 0.1f, Configure.HCBox_SetMode );
set_HeaterTemp( Configure.Heater_SetTemp*0.1f);
break;
}
}
开发者ID:github188,项目名称:J-KB6120E_V2x,代码行数:31,代码来源:HCBox.c
示例11: 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 LED2 */
BSP_LED_Init(LED1);
BSP_LED_Init(LED2);
/* 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:nidhiyanandh,项目名称:STM32Cube_FW_F4_V1.5.0_GCC_Makefile,代码行数:39,代码来源:main.c
示例12: init_myThread
int init_myThread(void) {
tid_myThread = osThreadCreate(osThread(myThread), NULL);
if(!tid_myThread) return(-1);
return(0);
}
开发者ID:STM32F0Examples,项目名称:OS_01_blinkingLeds,代码行数:7,代码来源:main.c
示例13: main
int main()
{
static char *argv[] =
{ "client", "-h", CYASSL_CALLEE_IP, "-p", CYASSL_CALLEE_PORT,
"-v", CYASSL_SSL_VER, CYASSL_HTTP_GET } ;
static func_args args =
{ 7 + CYASSL_HTTP_GET_COUNT, argv } ;
init_filesystem ();
net_initialize() ;
osThreadCreate (osThread (tcp_poll), NULL);
osDelay(50000) ; /* wait for DHCP */
#if defined(DEBUG_CYASSL)
printf("Turning ON Debug message\n") ;
CyaSSL_Debugging_ON() ;
#endif
if(args.argc == 7)
printf("Simple SSL/TLS, ") ;
else
printf("HTTP GET, ") ;
printf("Callee IP: %s, Port: %s, Version:%s\n", argv[2], argv[4], argv[6]) ;
while(1) {
client_test(&args) ;
printf("Enter any key to iterate.\n") ;
getchar() ;
}
}
开发者ID:agnov8,项目名称:wolfssl,代码行数:30,代码来源:main.c
示例14: 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 216 MHz */
SystemClock_Config();
/* Configure LED1 */
BSP_LED_Init(LED1);
/*##-1- Start task #########################################################*/
osThreadDef(uSDThread, StartThread, osPriorityNormal, 0, 8 * configMINIMAL_STACK_SIZE);
osThreadCreate(osThread(uSDThread), NULL);
/*##-2- Start scheduler ####################################################*/
osKernelStart();
/* We should never get here as control is now taken by the scheduler */
for( ;; );
}
开发者ID:MrZANE42,项目名称:verisure1512,代码行数:34,代码来源:main.c
示例15: cpufreq_init
void cpufreq_init(void)
{
dfs_ddrc_calc();
//dfs_to_max();
memset(&g_cpufreq, 0x0, sizeof(T_CPUFREQ_ST));
/* 初始化记录的上一次需要调的频率值 */
g_cpufreq.maxprof = CPUFREQ_MAX_PROFILE;
g_cpufreq.minprof = CPUFREQ_MIN_PROFILE;
g_cpufreq.curprof = cpufreq_get_cur_profile();
M3_CUR_CPUFREQ_PROFILE = g_cpufreq.curprof;
M3_MAX_CPUFREQ_PROFILE = g_cpufreq.maxprof;
M3_MIN_CPUFREQ_PROFILE = g_cpufreq.minprof;
M3_CPUFREQ_DOWN_FLAG(0) = 0;
M3_CPUFREQ_DOWN_FLAG(1) = 0;
cpufreq_mail = osMailCreate(osMailQ(cpufreq_mail), NULL);
thread_cpufreq_id = osThreadCreate (osThread (thread_cpufreq), NULL);
if (thread_cpufreq_id == NULL)
{
M3CPUFREQ_PRINT(" thread create error\n");
}
/* icc channel */
cpufreq_icc_init();
}
开发者ID:magnusjjj,项目名称:android_kernel_huawei_rle,代码行数:27,代码来源:m3_cpufreq.c
示例16: 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
示例17: StartThread
/**
* @brief Start Thread
* @param argument not used
* @retval None
*/
static void StartThread(void const * argument)
{
/* Initialize LCD and LEDs */
BSP_Config();
/* Create tcp_ip stack thread */
tcpip_init(NULL, NULL);
/* Initialize the LwIP stack */
Netif_Config();
/* Initialize tcp echo server */
tcpecho_init();
/* Initialize udp echo server */
udpecho_init();
/* Notify user about the network interface config */
User_notification(&gnetif);
/* Start toogleLed4 task : Toggle LED4 every 250ms */
osThreadDef(LED4, ToggleLed4, osPriorityLow, 0, configMINIMAL_STACK_SIZE);
osThreadCreate(osThread(LED4), NULL);
for( ;; )
{
/* Delete the Init Thread*/
osThreadTerminate(NULL);
}
}
开发者ID:z80,项目名称:stm32f429,代码行数:35,代码来源:main.c
示例18: main
/**@brief Function for application main entry.
*/
int main(void)
{
uint32_t err_code;
// Initialize.
ble_stack_init();
timers_init();
APP_GPIOTE_INIT(1);
err_code = bsp_init(BSP_INIT_LED | BSP_INIT_BUTTONS, APP_TIMER_TICKS(100, APP_TIMER_PRESCALER), NULL);
APP_ERROR_CHECK(err_code);
device_manager_init();
gap_params_init();
advertising_init();
services_init();
sensor_simulator_init();
conn_params_init();
ble_evt_pool = osPoolCreate(osPool(ble_evt_pool));
ble_stack_msg_box = osMessageCreate(osMessageQ(ble_stack_msg_box), NULL);
// Start execution.
ble_stack_thread_id = osThreadCreate(osThread(ble_stack_thread), NULL);
UNUSED_VARIABLE(ble_stack_thread_id);
application_timers_start();
advertising_start();
// Enter main loop.
for (;; )
{
UNUSED_VARIABLE(osDelay(1000));
}
}
开发者ID:dhruvkakadiya,项目名称:OpenSJ_Bluz,代码行数:33,代码来源: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();
/* Initialize IO expander */
BSP_IO_Init();
/* Configure LED1, LED2, LED3 and LED4 */
BSP_LED_Init(LED1);
BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
BSP_LED_Init(LED4);
/* Creates the mutex */
osMutexDef(osMutex);
osMutex = osMutexCreate(osMutex(osMutex));
if(osMutex != NULL)
{
/* Define and create the high priority thread */
osThreadDef(MutHigh, MutexHighPriorityThread, osPriorityBelowNormal, 0, configMINIMAL_STACK_SIZE);
osHighPriorityThreadHandle = osThreadCreate(osThread(MutHigh), NULL);
/* Define and create the medium priority thread */
osThreadDef(MutMedium, MutexMeduimPriorityThread, osPriorityLow, 0, configMINIMAL_STACK_SIZE);
osMediumPriorityThreadHandle = osThreadCreate(osThread(MutMedium), NULL);
/* Define and create the low priority thread */
osThreadDef(MutLow, MutexLowPriorityThread, osPriorityIdle, 0, configMINIMAL_STACK_SIZE);
osThreadCreate(osThread(MutLow), NULL);
}
/* Start scheduler */
osKernelStart();
/* We should never get here as control is now taken by the scheduler */
for(;;);
}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:52,代码来源:main.c
示例20: 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();
/* Configure LED1, LED2, LED3 and LED4 */
BSP_LED_Init(LED1);
BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
BSP_LED_Init(LED4);
/* Creates the mutex */
osMutexDef(osMutex);
osMutex = osMutexCreate(osMutex(osMutex));
if(osMutex != NULL)
{
/* Define and create the high priority thread */
osThreadDef(MutHigh, MutexHighPriorityThread, osPriorityBelowNormal, 0, configMINIMAL_STACK_SIZE);
osHighPriorityThreadHandle = osThreadCreate(osThread(MutHigh), NULL);
/* Define and create the medium priority thread */
osThreadDef(MutMedium, MutexMeduimPriorityThread, osPriorityLow, 0, configMINIMAL_STACK_SIZE);
osMediumPriorityThreadHandle = osThreadCreate(osThread(MutMedium), NULL);
/* Define and create the low priority thread */
osThreadDef(MutLow, MutexLowPriorityThread, osPriorityIdle, 0, configMINIMAL_STACK_SIZE);
osThreadCreate(osThread(MutLow), NULL);
}
/* Start scheduler */
osKernelStart();
/* We should never get here as control is now taken by the scheduler */
for(;;);
}
开发者ID:RadMie,项目名称:STM32F7DiscoveryBase,代码行数:52,代码来源:main.c
注:本文中的osThread函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论