mod6_cnt.c
来自「T TI公司28XDSP控制永磁同步电机PMSM」· C语言 代码 · 共 34 行
C
34 行
/*=====================================================================================
File name: MOD6_CNT.C (IQ version)
Originator: Digital Control Systems Group
Texas Instruments
Description: Modulo 6 counter module
=====================================================================================
History:
-------------------------------------------------------------------------------------
04-15-2005 Version 3.20
-------------------------------------------------------------------------------------*/
#include "IQmathLib.h" // Include header for IQmath library
// Don't forget to set a proper GLOBAL_Q in "IQmathLib.h" file
#include "dmctype.h"
#include "mod6_cnt.h"
void mod6cnt_calc(MOD6CNT *v)
{
if (v->TrigInput > 0)
{
if (v->Counter == 5) // Reset the counter when it is 5
v->Counter = 0;
else
v->Counter++; // Otherwise, increment by 1
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?