readdcoc2pwm.c
来自「基於 c51/8051 的 nand Flash Memory HY27US08」· C语言 代码 · 共 29 行
C
29 行
#if defined(__PIC24F__)
#include <p24Fxxxx.h>
#endif
#include <outcompare.h>
#ifdef _OCMP2
/***********************************************************************
* Function Name: ReadDCOC2PWM *
* Description: This routine reads duty cycle from Secondary *
* register in PWM mode *
* Parameters: None *
* Return Value: unsigned int: duty cycle from Secondary register *
***********************************************************************/
unsigned int ReadDCOC2PWM()
{
/* check if OC is in PWM Mode */
if((OC2CONbits.OCM & 0x06) == 0x06)
{
return OC2RS; /* Output Compare Secondary Register */
}
else
return -1;
}
#else
#warning "Does not build on this target"
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?