7" HMI - Hard-code calibration constants

General discussion on mikroC PRO for FT90x.
Locked
Author
Message
signalflow
Posts: 6
Joined: 27 Jul 2017 00:17

7" HMI - Hard-code calibration constants

#1 Post by signalflow » 28 Jul 2017 17:44

I am trying to hard-code the calibration constants so it doesn't run the calibration routine every time it starts up.
I am using the supplied code that I found on this forum. It does print to the screen to each label. I was expecting each TransformA, TransformB, etc. to be 32 bits long. But I am not getting that.

Code: Select all
void refresh_coordinates()
{
FT812_TouchTransform_GetConfig(&CalibrateConstants);
LongWordToHex(CalibrateConstants.TransformA, txt_tmpA);
strcpy(LabelA.Caption, txt_tmpA);
LongWordToHex(CalibrateConstants.TransformB, txt_tmpB);
strcpy(LabelB.Caption, txt_tmpB);
LongWordToHex(CalibrateConstants.TransformC, txt_tmpC);
strcpy(LabelC.Caption, txt_tmpC);
LongWordToHex(CalibrateConstants.TransformD, txt_tmpD);
strcpy(LabelD.Caption, txt_tmpD);
LongWordToHex(CalibrateConstants.TransformE, txt_tmpE);
strcpy(LabelE.Caption, txt_tmpE);
LongWordToHex(CalibrateConstants.TransformF, txt_tmpF);
strcpy(LabelF.Caption, txt_tmpF);
DrawScreen(&Screen1);
}


Mine prints this to the screen. It is like F is tacked onto E so E is really EF. Then D is really DEF. Then C is CDEF, etc. How can txt_tmpA contain all of the other txt_tmpX where X = B, C, D, E and F?
00007FFFFFFFFb4FFFFF00007FFF65b52
FFFFFFFFB4FFFFF00007FFF65B52
FFFB4FFFFF00007FFF65B52
FFFFF00007FFF65B52
00007FFF65B52
FFF65B52

So now I am trying to load those constants back in on bootup. So I tried to split it up into this below, but it does not work. Any ideas?

void load_calibration_constants()
{
CalibrateConstants.TransformA=0x00007;
CalibrateConstants.TransformB=0xFFFFF;
CalibrateConstants.TransformC=0xFFFB4;
CalibrateConstants.TransformD=0xFFFFF;
CalibrateConstants.TransformE=0x00007;
CalibrateConstants.TransformF=0xFFF65B52;

FT812_TouchTransform_SetConfig(&CalibrateConstants);
}

User avatar
darko.ilijevski
Posts: 581
Joined: 21 Mar 2017 16:57

Re: 7" HMI - Hard-code calibration constants

#2 Post by darko.ilijevski » 31 Jul 2017 17:39

Hi,

I have answered you on the previous post about it, so since there's no need to have the same topic on two places, I'll close this one.

viewtopic.php?f=160&t=55428

Thanks for the understanding and best regards
BR,
Darko

Locked

Return to “mikroC PRO for FT90x General”