24 lines
565 B
C
24 lines
565 B
C
|
#include "IQmathLib.h" // Include header for IQmath library
|
||
|
#include "abc_to_alphabeta.h"
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
/////////////////////////////////////////////////
|
||
|
|
||
|
|
||
|
#pragma CODE_SECTION(abc_to_alphabeta_calc,".fast_run");
|
||
|
void abc_to_alphabeta_calc(ABC_TO_ALPHABETA *v)
|
||
|
{
|
||
|
static _iq iq_1_sqrt3 = _IQ(0.57735026918962576450914878050196); // = 1/sqrt(3)
|
||
|
static _iq iq_2_sqrt3 = _IQ(1.1547005383792515290182975610039); // =2/sqrt(3)
|
||
|
|
||
|
v->Ualpha = v->Ua;
|
||
|
v->Ubeta = _IQmpy(iq_1_sqrt3,v->Ua) + _IQmpy(iq_2_sqrt3,v->Ub);
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
/////////////////////////////////////////////////
|