本文整理汇总了C++中CyExitCriticalSection函数的典型用法代码示例。如果您正苦于以下问题:C++ CyExitCriticalSection函数的具体用法?C++ CyExitCriticalSection怎么用?C++ CyExitCriticalSection使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CyExitCriticalSection函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: I2S_DisableRx
/*******************************************************************************
* Function Name: I2S_DisableRx
********************************************************************************
*
* Summary:
* Disables the Rx direction of the I2S interface.
*
* Parameters:
* None.
*
* Return:
* None.
*
*******************************************************************************/
void I2S_DisableRx(void)
{
uint8 enableInterrupts;
I2S_CONTROL_REG &= ((uint8) ~I2S_RX_EN);
enableInterrupts = CyEnterCriticalSection();
I2S_RX_STATUS_AUX_CONTROL_REG &= ((uint8) ~I2S_RX_INT_EN);
CyExitCriticalSection(enableInterrupts);
}
示例2: UART_SCB_IRQ_SetPriority
/*******************************************************************************
* Function Name: UART_SCB_IRQ_SetPriority
********************************************************************************
*
* Summary:
* Sets the Priority of the Interrupt.
*
* Note calling UART_SCB_IRQ_Start or UART_SCB_IRQ_StartEx will
* override any effect this API would have had. This API should only be called
* after UART_SCB_IRQ_Start or UART_SCB_IRQ_StartEx has been called.
* To set the initial priority for the component, use the Design-Wide Resources
* Interrupt Editor.
*
* Note This API has no effect on Non-maskable interrupt NMI).
*
* Parameters:
* priority: Priority of the interrupt, 0 being the highest priority
* PSoC 3 and PSoC 5LP: Priority is from 0 to 7.
* PSoC 4: Priority is from 0 to 3.
*
* Return:
* None
*
*******************************************************************************/
void UART_SCB_IRQ_SetPriority(uint8 priority)
{
uint8 interruptState;
uint32 priorityOffset = ((UART_SCB_IRQ__INTC_NUMBER % 4u) * 8u) + 6u;
interruptState = CyEnterCriticalSection();
*UART_SCB_IRQ_INTC_PRIOR = (*UART_SCB_IRQ_INTC_PRIOR & (uint32)(~UART_SCB_IRQ__INTC_PRIOR_MASK)) |
((uint32)priority << priorityOffset);
CyExitCriticalSection(interruptState);
}
示例3: I2S_EnableRx
/*******************************************************************************
* Function Name: I2S_EnableRx
********************************************************************************
*
* Summary:
* Enables the Rx direction of the I2S interface. At the next word
* select falling edge reception of data will begin.
*
* Parameters:
* None.
*
* Return:
* None.
*
*******************************************************************************/
void I2S_EnableRx(void)
{
uint8 enableInterrupts;
I2S_CONTROL_REG |= I2S_RX_EN;
enableInterrupts = CyEnterCriticalSection();
I2S_RX_STATUS_AUX_CONTROL_REG |= I2S_RX_INT_EN;
CyExitCriticalSection(enableInterrupts);
}
示例4: isr_Rx_1_SetPriority
/*******************************************************************************
* Function Name: isr_Rx_1_SetPriority
********************************************************************************
*
* Summary:
* Sets the Priority of the Interrupt.
*
* Note calling isr_Rx_1_Start or isr_Rx_1_StartEx will
* override any effect this API would have had. This API should only be called
* after isr_Rx_1_Start or isr_Rx_1_StartEx has been called.
* To set the initial priority for the component, use the Design-Wide Resources
* Interrupt Editor.
*
* Note This API has no effect on Non-maskable interrupt NMI).
*
* Parameters:
* priority: Priority of the interrupt, 0 being the highest priority
* PSoC 3 and PSoC 5LP: Priority is from 0 to 7.
* PSoC 4: Priority is from 0 to 3.
*
* Return:
* None
*
*******************************************************************************/
void isr_Rx_1_SetPriority(uint8 priority)
{
uint8 interruptState;
uint32 priorityOffset = ((isr_Rx_1__INTC_NUMBER % 4u) * 8u) + 6u;
interruptState = CyEnterCriticalSection();
*isr_Rx_1_INTC_PRIOR = (*isr_Rx_1_INTC_PRIOR & (uint32)(~isr_Rx_1__INTC_PRIOR_MASK)) |
((uint32)priority << priorityOffset);
CyExitCriticalSection(interruptState);
}
示例5: I2S_Enable
/*******************************************************************************
* Function Name: I2S_Enable
********************************************************************************
*
* Summary:
* Enables I2S interface.
*
* Parameters:
* None.
*
* Return:
* None.
*
*******************************************************************************/
void I2S_Enable(void)
{
uint8 enableInterrupts;
enableInterrupts = CyEnterCriticalSection();
I2S_AUX_CONTROL_REG |= I2S_CNTR7_EN;
CyExitCriticalSection(enableInterrupts);
I2S_CONTROL_REG |= I2S_EN;
}
示例6: start_int_SetPriority
/*******************************************************************************
* Function Name: start_int_SetPriority
********************************************************************************
*
* Summary:
* Sets the Priority of the Interrupt.
*
* Note calling start_int_Start or start_int_StartEx will
* override any effect this API would have had. This API should only be called
* after start_int_Start or start_int_StartEx has been called.
* To set the initial priority for the component, use the Design-Wide Resources
* Interrupt Editor.
*
* Note This API has no effect on Non-maskable interrupt NMI).
*
* Parameters:
* priority: Priority of the interrupt, 0 being the highest priority
* PSoC 3 and PSoC 5LP: Priority is from 0 to 7.
* PSoC 4: Priority is from 0 to 3.
*
* Return:
* None
*
*******************************************************************************/
void start_int_SetPriority(uint8 priority)
{
uint8 interruptState;
uint32 priorityOffset = ((start_int__INTC_NUMBER % 4u) * 8u) + 6u;
interruptState = CyEnterCriticalSection();
*start_int_INTC_PRIOR = (*start_int_INTC_PRIOR & (uint32)(~start_int__INTC_PRIOR_MASK)) |
((uint32)priority << priorityOffset);
CyExitCriticalSection(interruptState);
}
示例7: Filter_Reset_ISR_SetPriority
/*******************************************************************************
* Function Name: Filter_Reset_ISR_SetPriority
********************************************************************************
*
* Summary:
* Sets the Priority of the Interrupt.
*
* Note calling Filter_Reset_ISR_Start or Filter_Reset_ISR_StartEx will
* override any effect this API would have had. This API should only be called
* after Filter_Reset_ISR_Start or Filter_Reset_ISR_StartEx has been called.
* To set the initial priority for the component, use the Design-Wide Resources
* Interrupt Editor.
*
* Note This API has no effect on Non-maskable interrupt NMI).
*
* Parameters:
* priority: Priority of the interrupt, 0 being the highest priority
* PSoC 3 and PSoC 5LP: Priority is from 0 to 7.
* PSoC 4: Priority is from 0 to 3.
*
* Return:
* None
*
*******************************************************************************/
void Filter_Reset_ISR_SetPriority(uint8 priority)
{
uint8 interruptState;
uint32 priorityOffset = ((Filter_Reset_ISR__INTC_NUMBER % 4u) * 8u) + 6u;
interruptState = CyEnterCriticalSection();
*Filter_Reset_ISR_INTC_PRIOR = (*Filter_Reset_ISR_INTC_PRIOR & (uint32)(~Filter_Reset_ISR__INTC_PRIOR_MASK)) |
((uint32)priority << priorityOffset);
CyExitCriticalSection(interruptState);
}
示例8: Count7_Stop
/*******************************************************************************
* Function Name: Count7_Stop
********************************************************************************
*
* Summary:
* Disables the software enable of the counter.
*
* Parameters:
* None
*
* Return:
* None
*
*******************************************************************************/
void Count7_Stop(void)
{
uint8 interruptState;
interruptState = CyEnterCriticalSection();
/* Clear the counter start bit in auxiliary control. */
Count7_AUX_CONTROL_REG &= (uint8) ~((uint8) Count7_COUNTER_START);
CyExitCriticalSection(interruptState);
}
示例9: BLE_1_bless_isr_SetPriority
/*******************************************************************************
* Function Name: BLE_1_bless_isr_SetPriority
********************************************************************************
*
* Summary:
* Sets the Priority of the Interrupt.
*
* Note calling BLE_1_bless_isr_Start or BLE_1_bless_isr_StartEx will
* override any effect this API would have had. This API should only be called
* after BLE_1_bless_isr_Start or BLE_1_bless_isr_StartEx has been called.
* To set the initial priority for the component, use the Design-Wide Resources
* Interrupt Editor.
*
* Note This API has no effect on Non-maskable interrupt NMI).
*
* Parameters:
* priority: Priority of the interrupt, 0 being the highest priority
* PSoC 3 and PSoC 5LP: Priority is from 0 to 7.
* PSoC 4: Priority is from 0 to 3.
*
* Return:
* None
*
*******************************************************************************/
void BLE_1_bless_isr_SetPriority(uint8 priority)
{
uint8 interruptState;
uint32 priorityOffset = ((BLE_1_bless_isr__INTC_NUMBER % 4u) * 8u) + 6u;
interruptState = CyEnterCriticalSection();
*BLE_1_bless_isr_INTC_PRIOR = (*BLE_1_bless_isr_INTC_PRIOR & (uint32)(~BLE_1_bless_isr__INTC_PRIOR_MASK)) |
((uint32)priority << priorityOffset);
CyExitCriticalSection(interruptState);
}
示例10: XBEE_RX_INT_SetPriority
/*******************************************************************************
* Function Name: XBEE_RX_INT_SetPriority
********************************************************************************
*
* Summary:
* Sets the Priority of the Interrupt.
*
* Note calling XBEE_RX_INT_Start or XBEE_RX_INT_StartEx will
* override any effect this API would have had. This API should only be called
* after XBEE_RX_INT_Start or XBEE_RX_INT_StartEx has been called.
* To set the initial priority for the component, use the Design-Wide Resources
* Interrupt Editor.
*
* Note This API has no effect on Non-maskable interrupt NMI).
*
* Parameters:
* priority: Priority of the interrupt, 0 being the highest priority
* PSoC 3 and PSoC 5LP: Priority is from 0 to 7.
* PSoC 4: Priority is from 0 to 3.
*
* Return:
* None
*
*******************************************************************************/
void XBEE_RX_INT_SetPriority(uint8 priority)
{
uint8 interruptState;
uint32 priorityOffset = ((XBEE_RX_INT__INTC_NUMBER % 4u) * 8u) + 6u;
interruptState = CyEnterCriticalSection();
*XBEE_RX_INT_INTC_PRIOR = (*XBEE_RX_INT_INTC_PRIOR & (uint32)(~XBEE_RX_INT__INTC_PRIOR_MASK)) |
((uint32)priority << priorityOffset);
CyExitCriticalSection(interruptState);
}
示例11: Tuner_RunTuner
void Tuner_RunTuner(void)
{
uint8 interruptState;
uint8 suspended = 0;
uint16 command;
uint16 previousCompleteBit; /* COMPLETE_BIT in tunerCmd at time of last send to tuner host */
Tuner_SendBuffer();
/* Handle suspend command to avoid deadlock later in CapSense_RunTuner */
do
{
Tuner_RefreshBuffer();
interruptState = CyEnterCriticalSection(); /* Avoid ints between read and modify tunerCmd */
command = CapSense_dsRam.tunerCmd;
switch (command)
{
case CapSense_TU_CMD_SUSPEND_E:
suspended = 1;
CapSense_dsRam.tunerCmd |= CapSense_TU_CMD_COMPLETE_BIT;
CyExitCriticalSection(interruptState); /* Enable ints during SendBuffer */
Tuner_SendBuffer(); /* Send buffer with updated COMPLETE_BIT to tuner host */
interruptState = CyEnterCriticalSection();
break;
case CapSense_TU_CMD_RESUME_E:
case CapSense_TU_CMD_RESTART_E:
case CapSense_TU_CMD_RUN_SNR_TEST_E:
suspended = 0;
break;
default:
break;
}
CyExitCriticalSection(interruptState);
} while (suspended);
previousCompleteBit = CapSense_dsRam.tunerCmd & CapSense_TU_CMD_COMPLETE_BIT;
CapSense_RunTuner();
if ( previousCompleteBit != (CapSense_dsRam.tunerCmd & CapSense_TU_CMD_COMPLETE_BIT) )
Tuner_SendBuffer(); /* Send buffer with updated COMPLETE_BIT to tuner host */
}
示例12: TimerDelay_Interrupt_SetPriority
/*******************************************************************************
* Function Name: TimerDelay_Interrupt_SetPriority
********************************************************************************
*
* Summary:
* Sets the Priority of the Interrupt.
*
* Note calling TimerDelay_Interrupt_Start or TimerDelay_Interrupt_StartEx will
* override any effect this API would have had. This API should only be called
* after TimerDelay_Interrupt_Start or TimerDelay_Interrupt_StartEx has been called.
* To set the initial priority for the component, use the Design-Wide Resources
* Interrupt Editor.
*
* Note This API has no effect on Non-maskable interrupt NMI).
*
* Parameters:
* priority: Priority of the interrupt, 0 being the highest priority
* PSoC 3 and PSoC 5LP: Priority is from 0 to 7.
* PSoC 4: Priority is from 0 to 3.
*
* Return:
* None
*
*******************************************************************************/
void TimerDelay_Interrupt_SetPriority(uint8 priority)
{
uint8 interruptState;
uint32 priorityOffset = ((TimerDelay_Interrupt__INTC_NUMBER % 4u) * 8u) + 6u;
interruptState = CyEnterCriticalSection();
*TimerDelay_Interrupt_INTC_PRIOR = (*TimerDelay_Interrupt_INTC_PRIOR & (uint32)(~TimerDelay_Interrupt__INTC_PRIOR_MASK)) |
((uint32)priority << priorityOffset);
CyExitCriticalSection(interruptState);
}
示例13: main
int main()
{
uint8 interruptState;
CyGlobalIntEnable; /* Enable global interrupts */
EZI2C_Start(); /* Start EZI2C component */
/*
* Set up communication and initialize data buffer to CapSense data structure
* to use Tuner application
*/
EZI2C_EzI2CSetBuffer1(sizeof(CapSense_dsRam), sizeof(CapSense_dsRam),
(uint8 *)&CapSense_dsRam);
CapSense_Start(); /* Initialize component */
BleHandler_Init();
Tuner_Init(BleHandler_RefreshBuffer, BleHandler_SendBuffer);
CapSense_ScanAllWidgets(); /* Scan all widgets */
for(;;)
{
/* Do this only when a scan is done */
interruptState = CyEnterCriticalSection();
if(CapSense_NOT_BUSY == CapSense_IsBusy())
{
CyExitCriticalSection(interruptState);
CapSense_ProcessAllWidgets(); /* Process all widgets */
Tuner_RunTuner();
if (CapSense_IsAnyWidgetActive()) /* Scan result verification */
{
/* add custom tasks to execute when touch detected */
}
CapSense_ScanAllWidgets(); /* Start next scan */
}
CySysPmSleep(); /* Sleep until scan is finished */
CyExitCriticalSection(interruptState);
}
}
示例14: TILT_SetCounterMode
/*******************************************************************************
* Function Name: TILT_SetCounterMode
********************************************************************************
*
* Summary:
* Sets the counter mode. Applicable to all modes except Quadrature Decoder
* and PWM with pseudo random output.
*
* Parameters:
* counterMode: Enumerated couner type values
* Values:
* - TILT_COUNT_UP - Counts up
* - TILT_COUNT_DOWN - Counts down
* - TILT_COUNT_UPDOWN0 - Counts up and down. Terminal count
* generated when counter reaches 0
* - TILT_COUNT_UPDOWN1 - Counts up and down. Terminal count
* generated both when counter reaches 0
* and period
*
* Return:
* None
*
*******************************************************************************/
void TILT_SetCounterMode(uint32 counterMode)
{
uint8 enableInterrupts;
enableInterrupts = CyEnterCriticalSection();
TILT_CONTROL_REG &= (uint32)~TILT_UPDOWN_MASK;
TILT_CONTROL_REG |= counterMode;
CyExitCriticalSection(enableInterrupts);
}
示例15: TILT_SetCompareSwap
/*******************************************************************************
* Function Name: TILT_SetCompareSwap
********************************************************************************
*
* Summary:
* Writes the register that controls whether the compare registers are
* swapped. When enabled in Timer/Counter mode(without capture) the swap occurs
* at a TC event. In PWM mode the swap occurs at the next TC event following
* a hardware switch event.
*
* Parameters:
* swapEnable
* Values:
* - 0 - Disable swap
* - 1 - Enable swap
*
* Return:
* None
*
*******************************************************************************/
void TILT_SetCompareSwap(uint32 swapEnable)
{
uint8 enableInterrupts;
enableInterrupts = CyEnterCriticalSection();
TILT_CONTROL_REG &= (uint32)~TILT_RELOAD_CC_MASK;
TILT_CONTROL_REG |= (swapEnable & TILT_1BIT_MASK);
CyExitCriticalSection(enableInterrupts);
}