欢迎来到虫虫下载站 | 资源下载 资源专辑 关于我们
虫虫下载站

main.c

cap口例程
C
字号:
/*******************************************************************************
* Module    :   main.c
*
* Purpose   :   First bit of 'C' code that executes after startup (see boot.asm).
*				Starts up the operating system, uC/OS.
*
* Language  :   'c'
*
* Notes     :
*
* Unit Tested:
*上电的自检程序也可以写作任务,但属于只用一次的任务,用完正确就自己删除!
*或者可以写在main()里,也只执行一次,程序就相对简单点
而各个初始化程序一定是在osstart()启动之前就调用,而各个启动子程则是可放在osstart()之后
*******************************************************************************/
#include "DSP28_Device.h"

Uint16   f1,f2;
Uint16   CountFrq=0;
Uint16   firstcap=1;

/*******************************************************************************
*
* Routine	:   main
*
* Purpose   : 	Initialize further hardware.
*
* Inputs    :   None (void).
*
* Globals	:	None.
*
* Outputs (Returns):   None (void).
*
* Note(s)	:
*
*******************************************************************************/
void main(void)                 /*主函数*/
{
    InitSystem();              /*调用系统初始化函数*/ 
    // Wait for ADC interrupt
	for(;;)
	{ 
        if (CountFrq==1) 
           {
              if (firstcap==0) 
                 {
                     if  (f2>f1) EvbRegs.T3PR=(f2-f1)/32;
	                 else   EvbRegs.T3PR=(0xFFFF-f1+f2)/32;
	                 f1=f2;
	                 CountFrq=0;
	             }
	          else 
	             {   
	                 firstcap=0;
	                 CountFrq=0;
	             }
	       }
	}

}


//===========================================================================
// No more.
//===========================================================================

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -