Jump to content

Dial widget example compiled  error


Alan Chang

Recommended Posts

Hello,

When I compiled the Dial widget example(win32_dial), I got those errors.

..\dial.c(127): error:  #167: argument of type "point (*)[4]" is incompatible with parameter of type "point *"
..\dial.c(127): error:  #167: argument of type "point (*)[4]" is incompatible with parameter of type "const point *"

What can I do to fix them?

I use freeRTOS and STM32F429-disco board.

 

Thanks.

Link to comment
Share on other sites

Hello Alan,

Yes, you can of course use an image for the needle. The example is really just that: An example. It's a custom widget and you can customize it to fit your needs.
However, the current version of the µGFX library doesn't provide any high-level API for image rotation so you'd have to handle the image rotation yourself. But looking at your image it doesn't look like this needs to be an image anyway. I see two polygons and a circle :) 

Link to comment
Share on other sites

Hi Joel,

 

I just ran this dial widget example on my STM32F429 board.

Icons are showed correctly on LCD except the needle.

Needle is never displayed.

 

So I went back to run the gdisp polygons demo.

I found polygon could be draw by only using MATRIXFIXED2D API.

I do not know the reason why MATRIXFLOAT2D API could not.:(

 

If I use MATRIXFIXED2D API to draw needle in the dial widget example, will the result be same?

 

Hope you can give some advice.

Thanks.

Link to comment
Share on other sites

Hello Alan,

The gdispFillConvexPoly() function can only operate on integer points because the points represent pixel coordinates. There is no such thing as half a pixel. When rendering a shape to the framebuffer. Of course you can use float matrix operations prior to that - that's no problem.

 

1 hour ago, Alan Chang said:

Icons are showed correctly on LCD except the needle.

Needle is never displayed.

I assume that you enabled the convex polygon support as you wouldn't be able to compile otherwise? Did the /demos/modules/gdisp/polygons demo work on your hardware?

Link to comment
Share on other sites

The most likely reason the fixed2d calls work but the float3d calls don't would be that there is something wrong with the compiler or c library support for floating point for your cpu.

This could be as simple as not setting the compiler options correctly for your cpu.

The fixed2d routines will invariably be much faster anyway than floating point operations (albiet slightly less accurate ).

Link to comment
Share on other sites

Hello,

 

Thanks for your quite reply.

I remember I could run the  demos\modules\gdisp\streaming successfully before.

The note mentioned the demo uses floating point operations.

Also there is FPU inside STMF429.

 

Maybe there is setting issue in compiler or library  .   

I will check them soon.

 

Thanks.

Link to comment
Share on other sites

Hello,

When I change to my dial image in dial widget example code, why do I get two needles?

DSC_0255.thumb.JPG.d71fa71b1d32eead85869f32309cd776.JPG

I think one of them is from "dialCreate".

How can I fix it?

// Dial widget
	wi.g.show = TRUE;
	wi.g.width = 160;
	wi.g.height = 80;
	wi.g.y = 70;
	wi.g.x = 50;
	wi.g.parent = 0;
	wi.text = "Dial Widget";
	//gdispImageOpenFile(&_imgDialFace, "rsc/dial_face.bmp");
	gdispImageOpenFile(&_imgDialFace, "rsc/scale150x76.bmp");

	gdispImageCache(&_imgDialFace);
	_ghDial = dialCreate(0, &wi, &_imgDialFace);
	
	dialSetAngle(_ghDial, DIAL_INITIAL_ANGLE);

 

Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...