您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ vPortEnterCritical函数代码示例

51自学网 2021-06-03 09:30:44
  C++
这篇教程C++ vPortEnterCritical函数代码示例写得很实用,希望能帮到您。

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

在下文中一共展示了vPortEnterCritical函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: rboot_set_config

// write the rboot config// preserves the contents of the rest of the sector,// so the rest of the sector can be used to store user data// updates checksum automatically (if enabled)bool ICACHE_FLASH_ATTR rboot_set_config(rboot_config *conf) {	uint8 *buffer;	buffer = (uint8*)os_malloc(SECTOR_SIZE);	if (!buffer) {		//os_printf("No ram!/r/n");		return false;	}	#ifdef BOOT_CONFIG_CHKSUM	conf->chksum = calc_chksum((uint8*)conf, (uint8*)&conf->chksum);#endif		spi_flash_read(BOOT_CONFIG_SECTOR * SECTOR_SIZE, (uint32*)((void*)buffer), SECTOR_SIZE);	memcpy(buffer, conf, sizeof(rboot_config));	vPortEnterCritical();	spi_flash_erase_sector(BOOT_CONFIG_SECTOR);	vPortExitCritical();	taskYIELD();	vPortEnterCritical();	//spi_flash_write(BOOT_CONFIG_SECTOR * SECTOR_SIZE, (uint32*)((void*)buffer), SECTOR_SIZE);	spi_flash_write(BOOT_CONFIG_SECTOR * SECTOR_SIZE, (uint32*)((void*)buffer), SECTOR_SIZE);	vPortExitCritical();		os_free(buffer);	return true;}
开发者ID:Paasmer,项目名称:esp-open-rtos,代码行数:29,


示例2: sio_close

err_tsio_close( serdev_t * dev ){    int             i;    err_t           error = ERR_VAL;    for( i = 0; i < UART_DEVICES_MAX; i++ )    {        if( &devices[i] == dev )        {            break;        }    }    if( i < UART_DEVICES_MAX )    {        vPortEnterCritical(  );        error = sio_close_low_level( i, dev );        vPortExitCritical(  );        if( dev->tx_sem != ( xSemaphoreHandle ) 0 )        {            vQueueDelete( dev->tx_sem );        }        if( dev->rx_sem != ( xSemaphoreHandle ) 0 )        {            vQueueDelete( dev->tx_sem );        }        SIO_RESET_STATE( dev );    }    return error;}
开发者ID:alexrayne,项目名称:freemodbus,代码行数:32,


示例3: PendSV

void PendSV( char req ){char tmp=0;if(ClosedLv1Isr == 0){	vPortEnterCritical();	tmp = 1;}	if(req ==1)	{		SWReq = 1;	}	else		HdlMacSig= 1;#if 0	GPIO_REG_WRITE(GPIO_STATUS_W1TS_ADDRESS, 0x40);	#else	if(PendSvIsPosted == 0)	{		PendSvIsPosted = 1;		xthal_set_intset(1<<ETS_SOFT_INUM);	}#endif	if(tmp == 1)		vPortExitCritical();}
开发者ID:liqinliqin,项目名称:drcom-dialer-esp8266,代码行数:26,


示例4: rtc_get_jiffies

uint32_t rtc_get_jiffies(void){    vPortEnterCritical();    static unsigned last, count;    unsigned  divh, divl;    do {        divh = RTC->DIVH & 0x0F;        divl = RTC->DIVL;    } while (divh != (RTC->DIVH & 0x0F));    unsigned ticks = RTC_PRESCALER - (divh << 16) - divl;    count += ticks - last;    if (ticks < last)        count += RTC_PRESCALER;    last = ticks;    vPortExitCritical();    return count;}
开发者ID:pl4nkton,项目名称:drquad32,代码行数:25,


示例5: _gettimeofday

int _gettimeofday(struct timeval *tp, void *tzvp){    if (tp) {        unsigned divh, divl, cnth, cntl;        vPortEnterCritical();        do {            divh = RTC->DIVH & 0x0F;            divl = RTC->DIVL;            cnth = RTC->CNTH;            cntl = RTC->CNTL;        } while (divh != (RTC->DIVH & 0x0F));        vPortExitCritical();        tp->tv_sec  = (cnth << 16) + cntl;        tp->tv_usec = RTC_JIFFIES_TO_US( RTC_PRESCALER - (divh << 16) - divl );    }    struct timezone *tzp = tzvp;    if (tzp)  {        tzp->tz_minuteswest = 0;        tzp->tz_dsttime = 0;    }    return 0;}
开发者ID:pl4nkton,项目名称:drquad32,代码行数:26,


示例6: WriteScriptPage

void WriteScriptPage(Serial *serial, unsigned int argc, char **argv){	if (argc < 2){		put_commandError(serial, ERROR_CODE_INVALID_PARAM);		return;	}	unsigned int page = modp_atoi(argv[1]);	char *scriptPage = "";	if (argc >= 3) scriptPage = argv[2];	if (page >=0 && page < SCRIPT_PAGES){		if (argc >= 2) unescape(scriptPage);		lockLua();		vPortEnterCritical();		pr_info_int(strlen(scriptPage));		pr_info("=");		pr_info(scriptPage);		pr_info("/r/n");		int result = flashScriptPage(page, scriptPage);		vPortExitCritical();		unlockLua();		if (result == 0){			put_commandOK(serial);		}		else{			put_commandError(serial, result);		}	}	else{		put_commandError(serial, ERROR_CODE_INVALID_PARAM);	}}
开发者ID:smig23,项目名称:RaceCapture-Pro_firmware,代码行数:32,


示例7: sio_write

u32_tsio_write( sio_fd_t fd, u8_t * buf, u32_t size ){    u32_t           ch_left;    volatile serdev_t *dev = fd;    if( dev->ready )    {        ch_left = size;        while( ch_left > 0 )        {            vPortEnterCritical(  );            while( ( dev->tx_buf_cnt < DEFAULT_TX_BUFSIZE ) && ( ch_left > 0 ) )            {                dev->tx_buf[dev->tx_buf_wrpos] = *buf++;                dev->tx_buf_wrpos = ( dev->tx_buf_wrpos + 1 ) % DEFAULT_TX_BUFSIZE;                dev->tx_buf_cnt++;                ch_left--;            }            /* Enable transmit FIFO empty interrupts and block. */            UART_ItConfig( dev->UARTx, UART_TxHalfEmpty, ENABLE );            vPortExitCritical(  );            /* Not all characters sent within one write. Block on a semaphore             * which is triggered when the buffer is empty again.             */            if( ch_left != 0 )            {                while( xSemaphoreTake( dev->tx_sem, portMAX_DELAY ) != pdTRUE );            }        }    }    return size;}
开发者ID:alexrayne,项目名称:freemodbus,代码行数:35,


示例8: SWWriteSPI

unsigned char SWWriteSPI(unsigned char cData){    unsigned char i;    unsigned char send;    vPortEnterCritical();        SmartDelay_spi(5);    send = cData&0xff;    for (i = 0; i < 8; i++)     {        SPICLK2(0);        if (send & 0x80)	SPIDO2(1);        else				SPIDO2(0);        send <<= 1;		         SmartDelay_spi(2);        SPICLK2(1);		         SmartDelay_spi(5);    }    //SPICLK(0);    //SPIDO(0);    vPortExitCritical();    return 0;}
开发者ID:saiyn,项目名称:web,代码行数:26,


示例9: EEPROM_Write

uint8_t EEPROM_Write(uint16_t AddressToWrite, void* DataArray, uint16_t BytesToWrite){	IAP_Result[0] = 0;	//TODO: check to make sure the address is valid#ifdef USE_EEPROM_LIB	IAP_Command[0] = EELIB_IAP_COMMAND_EEPROM_WRITE;	//EEPROM library write command#else	IAP_Command[0] = IAP_EEPROM_WRITE;					//IAP EEPROM write command#endif	IAP_Command[1] = (uint32_t)AddressToWrite;			//EEPROM address to write to	IAP_Command[2] = (uint32_t)DataArray;				//RAM address of the data to write	IAP_Command[3] = (uint32_t)BytesToWrite;			//Number of bytes to write	IAP_Command[4] = SystemCoreClock/1000;				//System clock frequency in kHz#ifdef USE_EEPROM_LIB	EELIB_entry(IAP_Command, IAP_Result);#else	vPortEnterCritical();	iap_entry(IAP_Command, IAP_Result);	vPortExitCritical();#endif	return (uint8_t)IAP_Result[0];}
开发者ID:ilikecake,项目名称:network-analyzer,代码行数:26,


示例10: sys_sem_new

/* Creates and returns a new semaphore. The "count" argument specifies * the initial state of the semaphore. */sys_sem_tsys_sem_new( u8_t count ){    xSemaphoreHandle xSemaphore;    vSemaphoreCreateBinary( xSemaphore );    if( xSemaphore != SYS_SEM_NULL )    {        if( count == 0 )        {            xSemaphoreTake( xSemaphore, 1 );        }#ifdef SYS_STATS        vPortEnterCritical(  );        lwip_stats.sys.sem.used++;        if( lwip_stats.sys.sem.used > lwip_stats.sys.sem.max )        {            lwip_stats.sys.sem.max = lwip_stats.sys.sem.used;        }        vPortExitCritical(  );#endif    }    else    {        LWIP_ASSERT( "sys_sem_new: xSemaphore == SYS_SEM_NULL", xSemaphore != SYS_SEM_NULL );    }    return xSemaphore;}
开发者ID:darknesmonk,项目名称:freertos-5.1.2-lpc23xx,代码行数:32,


示例11: PendSV

void PendSV( char req ){	char tmp=0;//ETS_INTR_LOCK();	if( NMIIrqIsOn == 0 )	{		vPortEnterCritical();		//PortDisableInt_NoNest();		tmp = 1;	}	if(req ==1)	{		SWReq = 1;	}	else if(req ==2)		HdlMacSig= 1;#if 0	GPIO_REG_WRITE(GPIO_STATUS_W1TS_ADDRESS, 0x40);	#else	if(PendSvIsPosted == 0)	{		PendSvIsPosted = 1;		xthal_set_intset(1<<ETS_SOFT_INUM);	}#endif	if(tmp == 1)		vPortExitCritical();}
开发者ID:Zulu340,项目名称:ESPWebFramework,代码行数:30,


示例12: sys_arch_thread_new

/* * Starts a new thread with priority "prio" that will begin its execution in the * function "thread()". The "arg" argument will be passed as an argument to the * thread() function. The argument "ssize" is the requested stack size for the * new thread. The id of the new thread is returned. Both the id and the  * priority are system dependent. */sys_thread_tsys_arch_thread_new( void ( *thread ) ( void *arg ), void *arg, int prio, size_t ssize ){    sys_thread_t    thread_hdl = SYS_THREAD_NULL;    int             i;    sys_tcb_t      *p;    char            thread_name[ configMAX_TASK_NAME_LEN ];    /* We disable the FreeRTOS scheduler because it might be the case that the new     * tasks gets scheduled inside the xTaskCreate function. To prevent this we     * disable the scheduling. Note that this can happen although we have interrupts     * disabled because xTaskCreate contains a call to taskYIELD( ).     */    vPortEnterCritical(  );    p = tasks;    i = 0;    /* We are called the first time. Initialize it. */    if( p == NULL )    {        p = pvPortMalloc( sizeof( sys_tcb_t ) );        if( p != NULL )        {            tasks = p;        }    }    else    {        /* First task already counter. */        i++;        /* Cycle to the end of the list. */        while( p->next != NULL )        {            i++;            p = p->next;        }        p->next = pvPortMalloc( sizeof( sys_tcb_t ) );        p = p->next;    }    if( p != NULL )    {        /* Memory allocated. Initialize the data structure. */        THREAD_INIT( p );        ( void )snprintf( thread_name, configMAX_TASK_NAME_LEN, "lwIP%d", i );        /* Now q points to a free element in the list. */        if( xTaskCreate( thread, thread_name, ssize, arg, prio, &p->pid ) == pdPASS )        {            thread_hdl = p;        }        else        {            vPortFree( p );        }    }    vPortExitCritical(  );    return thread_hdl;}
开发者ID:darknesmonk,项目名称:freertos-5.1.2-lpc23xx,代码行数:67,


示例13: thread

/*  Starts a new thread with priority "prio" that will begin its execution in the  function "thread()". The "arg" argument will be passed as an argument to the  thread() function. The id of the new thread is returned. Both the id and  the priority are system dependent.*/sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread , void *arg, int stacksize, int prio){xTaskHandle CreatedTask;int result;   if ( s_nextthread < SYS_THREAD_MAX )   {	   vPortEnterCritical();       result = xTaskCreate( thread, ( signed portCHAR * ) name, stacksize, arg, prio, &CreatedTask );	   // For each task created, store the task handle (pid) in the timers array.	   // This scheme doesn't allow for threads to be deleted	   s_timeoutlist[s_nextthread++].pid = CreatedTask;       vPortExitCritical();	   	   if(result == pdPASS)	   {		   return CreatedTask;	   }	   else	   {		   return NULL;	   }   }   else   {      return NULL;   }}
开发者ID:alex1818,项目名称:rtk-8711af,代码行数:35,


示例14: SWReadSPI

 unsigned char SWReadSPI(void) {     unsigned char i;     unsigned char ReceivedByte;      vPortEnterCritical();      SmartDelay_spi(5);     ReceivedByte = 0;     for (i = 0; i < 8; i++)      {                SPICLK2(0);         //SmartDelay_spi(5);                  ReceivedByte <<= 1;         if (SPIDI2())             ReceivedByte |= 0x01;         SmartDelay_spi(2);         SPICLK2(1);         SmartDelay_spi(5);        }     //SPICLK(0);      vPortExitCritical();      return (ReceivedByte); }
开发者ID:saiyn,项目名称:web,代码行数:26,


示例15: vPortFree

voidvPortFree(void *p){	vPortEnterCritical();	msheap_free(p);	vPortExitCritical();}
开发者ID:PhilippePetit,项目名称:openpilot,代码行数:7,


示例16: SendReseive

bool SendReseive()    {    //  vTaskDelay(50);	GPIO_SetBits(GPIOB, GPIO_Pin_14);   // AT91F_PIO_SetOutput(AT91C_BASE_PIOA, LED_485);    vTaskDelay(5);    processBuffer8to7(rs485buf,rs485size);    uart3Write ((uint8*) rs485buf, rs485size);    vTaskDelay(20);    //AT91F_PIO_ClearOutput(AT91C_BASE_PIOA, LED_485);    GPIO_ResetBits(GPIOB, GPIO_Pin_14);    vPortEnterCritical();    vTaskDelay(1500);    rs485size = uart3Read((uint8*) rs485buf, 256/*, 3000*/);    vPortExitCritical();    if (rs485size == 0)	return false;    processBuffer7to8(rs485buf,rs485size);    vTaskDelay(50);  //  AT91F_PIO_SetOutput(AT91C_BASE_PIOA, LED_485);    vTaskDelay(100);    return true;    }
开发者ID:FlameN,项目名称:STM32RUNO,代码行数:26,


示例17: vPortEnterCritical

bool  scheduler_task::addSharedObject(const char *name, void *obj_ptr){    bool duplicate = false;    vPortEnterCritical();    do {        if (!mpNamePtrPair) {            mpNamePtrPair = new VECTOR<PtrNamePairType>;        }        /* Disallow adding duplicate items by name */        for(unsigned int i=0; i < mpNamePtrPair->size(); i++) {            if (0 == strcmp(mpNamePtrPair->at(i).name, name)) {                duplicate = true;                break;            }        }        /* Push back to vector */        PtrNamePairType item;        item.ptr  = obj_ptr;        item.name = name;        mpNamePtrPair->push_back(item);    } while(0);    vPortExitCritical();    return !duplicate;}
开发者ID:kotoran,项目名称:RedhotAlarm,代码行数:28,


示例18: BKP_storeWord

void BKP_storeWord(uint16_t bkpidx,uint16_t value){	if (bkpidx >= BKP_DR_NUMBER)		return;	vPortEnterCritical();	BKP_WriteBackupRegister(BKPDataReg[bkpidx],value);	vPortExitCritical();}
开发者ID:pandc,项目名称:unitek,代码行数:8,


示例19: sys_assert

/* * Prints an assertion messages and aborts execution. */voidsys_assert( const char *msg ){	fputs( msg, stderr );	fputs( "/n/r", stderr );    vPortEnterCritical(  );    for( ;; );}
开发者ID:darknesmonk,项目名称:freertos-5.1.2-lpc23xx,代码行数:11,


示例20: add_thread_signal_map

static void add_thread_signal_map (osThreadId thread_id, EventGroupHandle_t signals){    int dummy;//    uint32_t i;    ThreadSignalRec *prec_entity;    if (inHandlerMode()) {        dummy = portSET_INTERRUPT_MASK_FROM_ISR();    }    else {        vPortEnterCritical();    }    prec_entity = (ThreadSignalRec*) malloc(sizeof(ThreadSignalRec));    if (prec_entity != NULL) {        prec_entity->thread_id = thread_id;        prec_entity->signals = signals;        prec_entity->pnext = NULL;        if (pThreadSignalMapHead == NULL) {            pThreadSignalMapHead = prec_entity;            pThreadSignalMapTail = prec_entity;        }        else {            pThreadSignalMapTail->pnext = prec_entity;            pThreadSignalMapTail = prec_entity;        }    }    else {        CMSIS_OS_ERR("No Free Thread-Signal entity/n");    }#if 0        for (i=0;i<THREAD_SIGNAL_MAP_SIZE;i++)    {        if (!ThreadSignalMapTable[i].is_in_use) {            ThreadSignalMapTable[i].is_in_use = 1;            ThreadSignalMapTable[i].thread_id = thread_id;            ThreadSignalMapTable[i].signals = signals;            break;        }    }    if (i >= THREAD_SIGNAL_MAP_SIZE) {        // No free Thread-Signals map entity        CMSIS_OS_ERR("No Free Thread-Signal entity/n");    }#endif    if (inHandlerMode()) {        portCLEAR_INTERRUPT_MASK_FROM_ISR(dummy);    }    else {        vPortExitCritical();    }}
开发者ID:geliang201201,项目名称:RTL_Ameba,代码行数:58,


示例21: CAN_tx

bool CAN_tx (can_t can, can_msg_t *pCanMsg, uint32_t timeout_ms){    volatile LPC_CAN_TypeDef *CANx = CAN_ENUM_TO_REGS(can);    const uint8_t cidx = CAN_INDEX(can);    bool ok = false;    if (!CANx || !pCanMsg) {        return false;    }    /* Try transmitting to one of the available buffers */    vPortEnterCritical();    {        ok = CAN_tx_now(CANx, pCanMsg);    }    vPortExitCritical();    /* If all three buffers are busy, just queue the message */    if (!ok) {        if (taskSCHEDULER_RUNNING == xTaskGetSchedulerState()) {            ok = xQueueSend(g_can_tx_qs[cidx], pCanMsg, OS_MS(timeout_ms));        }        else {            ok = xQueueSendFromISR(g_can_tx_qs[cidx], pCanMsg, NULL);        }        /* There is possibility that before we queued the message, we got interrupted         * and all hw buffers were emptied meanwhile, and our queued message will now         * sit in the queue forever until another Tx interrupt takes place.         * So we dequeue it here if all are empty and send it over.         */        vPortEnterCritical();        {            can_msg_t msg;            if (tx_all_avail == (CANx->SR & tx_all_avail) &&                xQueueReceiveFromISR(g_can_tx_qs[cidx], &msg, NULL)            ) {                ok = CAN_tx_now(CANx, &msg);            }        }        vPortExitCritical();    }    return ok;}
开发者ID:Bento007,项目名称:SJSU-Superway-2014,代码行数:45,


示例22: BKP_storeDWord

void BKP_storeDWord(uint16_t bkpidx,uint32_t value){	if (bkpidx >= (BKP_DR_NUMBER-1))		return;	vPortEnterCritical();	BKP_WriteBackupRegister(BKPDataReg[bkpidx],(uint16_t)(value >> 16));	BKP_WriteBackupRegister(BKPDataReg[bkpidx+1],(uint16_t)value);	vPortExitCritical();}
开发者ID:pandc,项目名称:unitek,代码行数:9,


示例23: fatal_handler_prelude

/* Prelude ensures exceptions/NMI off and flash is mapped, allowing   calls to non-IRAM functions.*/static void IRAM fatal_handler_prelude(void) {    if (!sdk_NMIIrqIsOn) {        vPortEnterCritical();        do {            DPORT.DPORT0 &= 0xffffffe0;        } while (DPORT.DPORT0 & 0x00000001);    }    Cache_Read_Disable();    Cache_Read_Enable(0, 0, 1);}
开发者ID:BorgesJVT,项目名称:esp-open-rtos,代码行数:13,


示例24: sys_assert

/* * Prints an assertion messages and aborts execution. */voidsys_assert( const char *msg ){    extern sio_fd_t stdio_fd;    ( void )sio_write_noisr( stdio_fd, ( u8_t * ) msg, ( u32_t ) strlen( msg ) );    ( void )sio_write_noisr( stdio_fd, "/n/r", 2 );    vPortEnterCritical(  );    for( ;; );}
开发者ID:BackupTheBerlios,项目名称:freemodbus,代码行数:13,


示例25: mad_synth_frame

//extern unsigned char set__;void mad_synth_frame(struct mad_synth *synth, struct mad_frame /*const*/ *frame){  unsigned int nch, ns;  static int samplerate=0;  void (*synth_frame)(struct mad_synth *, struct mad_frame /*const*/ *,		      unsigned int, unsigned int);  nch = MAD_NCHANNELS(&frame->header);  ns  = MAD_NSBSAMPLES(&frame->header);  synth->pcm.samplerate = frame->header.samplerate;    //--set_dac_sample_rate(synth->pcm.samplerate);  //while(g_ulFlags!=7);    //if(set__)  {    vPortEnterCritical( );    SoundSetFormat(frame->header.samplerate,16,1);    //set__=0;    vPortExitCritical( );  }    synth->pcm.channels   = nch;  synth->pcm.length     = 32 * ns;  samplerate = synth->pcm.samplerate;  synth_frame = synth_full;  if (frame->options & MAD_OPTION_HALFSAMPLERATE) {    synth->pcm.samplerate /= 2;    synth->pcm.length     /= 2;    //--set_dac_sample_rate(synth->pcm.samplerate);    vPortEnterCritical( );    SoundSetFormat(frame->header.samplerate,16,1);    vPortExitCritical( );    synth_frame = synth_half;  }  synth_frame(synth, frame, nch, ns);  synth->phase = (synth->phase + ns) % 16;}
开发者ID:KYHuang,项目名称:arm-mp3-player,代码行数:43,


示例26: sys_assert

/* * Prints an assertion messages and aborts execution. */void sys_assert( const char *msg ){		( void ) msg;	/*FSL:only needed for debugging	printf(msg);	printf("/n/r");	*/    vPortEnterCritical(  );    for(;;)    ;}
开发者ID:Andrey307,项目名称:CleverCNC,代码行数:14,


示例27: sys_arch_protect

/** * Enters a critical section. * * @return the previous protection level */sys_prot_tsys_arch_protect(void){#if RTOS_SAFERTOS  vPortEnterCritical();#elif RTOS_FREERTOS  taskENTER_CRITICAL();#endif  return 1;}
开发者ID:hakkinen86,项目名称:Luminary-Micro-Library,代码行数:16,


示例28: sys_arch_thread_current

/* * Returns the thread control block for the currently active task. In case * of an error the functions returns NULL. */sys_thread_tsys_arch_thread_current( void ){    sys_tcb_t      *p = tasks;    xTaskHandle     pid = xTaskGetCurrentTaskHandle(  );    vPortEnterCritical(  );    while( ( p != NULL ) && ( p->pid != pid ) )    {        p = p->next;    }    vPortExitCritical(  );    return p;}
开发者ID:darknesmonk,项目名称:freertos-5.1.2-lpc23xx,代码行数:18,


示例29: sys_sem_free

/* Deallocates a semaphore */voidsys_sem_free( sys_sem_t sem ){    LWIP_ASSERT( "sys_sem_free: sem != SYS_SEM_NULL", sem != SYS_SEM_NULL );    if( sem != SYS_SEM_NULL )    {#ifdef SYS_STATS        vPortEnterCritical(  );        lwip_stats.sys.sem.used--;        vPortExitCritical(  );#endif        vQueueDelete( sem );    }}
开发者ID:darknesmonk,项目名称:freertos-5.1.2-lpc23xx,代码行数:15,


示例30: PendSV

/* PendSV is called in place of vPortYield() to request a supervisor   call.   The portYIELD macro calls pendSV if it's a software request.   The libpp and libudhcp libraries also call this function, assuming   always with arg==2 (but maybe sometimes with arg==1?)   In the original esp_iot_rtos_sdk implementation, arg was a char. Using an   enum is ABI-compatible, though.*/void IRAM PendSV(enum SVC_ReqType req){	vPortEnterCritical();	if(req == SVC_Software)	{		pending_soft_sv = 1;	}	else if(req == SVC_MACLayer)		pending_maclayer_sv= 1;	xthal_set_intset(BIT(INUM_SOFT));	vPortExitCritical();}
开发者ID:lucasmfontan,项目名称:esp-open-rtos,代码行数:25,



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


C++ vPortExitCritical函数代码示例
C++ vParTestSetLED函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。