Is there any reason why MAGBUFFSIZEX is 14 instead of 12 as description?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Is there any reason why MAGBUFFSIZEX is 14 instead of 12 as description?

ソリューションへジャンプ
877件の閲覧回数
garyto
Contributor I

I was going through the fusion code and notice this in the magnetic.h file, line32-33

// magnetic calibration constants
#define MAGBUFFSIZEX 14                    // x dimension in magnetometer buffer (12x24 equals 288 elements)
#define MAGBUFFSIZEY (2 * MAGBUFFSIZEX)    // y dimension in magnetometer buffer (12x24 equals 288 elements)

The MAGBUFFSIZEX is set to 14 instead of 12 as described in the annotation. This affects the tanarray calculation in magnetic.c, line 61-68,

// initialize the array of (MAGBUFFSIZEX - 1) elements of 100 * tangents used for buffer indexing
    // entries cover the range 100 * tan(-PI/2 + PI/MAGBUFFSIZEX), 100 * tan(-PI/2 + 2*PI/MAGBUFFSIZEX) to
    // 100 * tan(-PI/2 + (MAGBUFFSIZEX - 1) * PI/MAGBUFFSIZEX).
    // for MAGBUFFSIZEX=12, the entries range in value from -373 to +373
    for (j = 0; j < (MAGBUFFSIZEX - 1); j++)
    {
        pthisMagBuffer->tanarray[j] = (int16) (100.0F * tanf(PI * (-0.5F + (float) (j + 1) / MAGBUFFSIZEX)));
    }

the tanarray will go from -438 to 438 instead of -373 to 373.

ラベル(1)
0 件の賞賛
返信
1 解決策
585件の閲覧回数
michaelestanley
NXP Employee
NXP Employee

No reason.  The comments are just out of date.

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
586件の閲覧回数
michaelestanley
NXP Employee
NXP Employee

No reason.  The comments are just out of date.

0 件の賞賛
返信