Jump to content

GFILE_ALLOW_FLOATS and uGFX source file building error


Dvor_nik

Recommended Posts

Hi! I need same help.

When I try to set

#define GFILE_ALLOW_FLOATS                           TRUE

I have a building error:

Compiling gfile.c
Compiling gfile_fs_native.c
Compiling gfile_fs_ram.c
Compiling gfile_fs_rom.c
Compiling gfile_fs_fatfs.c
Compiling gfile_fs_petitfs.c
Compiling gfile_fs_chibios.c
Compiling gfile_fs_mem.c
Compiling gfile_fs_strings.c
Compiling gfile_printg.c
Compiling gfile_scang.c
Compiling gfile_stdio.c
../../chibios/ext/ugfx/src/gfile/gfile_printg.c: In function 'vfnprintg':
Compiling gfile_fatfs_wrapper.c
../../chibios/ext/ugfx/src/gfile/gfile_printg.c:62:9: error: 'f' redeclared as different kind of symbol
../../chibios/ext/ugfx/src/gfile/gfile_printg.c:55:22: note: previous definition of 'f' was here
../../chibios/ext/ugfx/src/gfile/gfile_printg.c:76:4: error: incompatible type for argument 1 of 'gfileWrite'
In file included from ../../chibios/ext/ugfx/gfx.h:203:0,
from ../../chibios/ext/ugfx/src/gfile/gfile_printg.c:12:
../../chibios/ext/ugfx/src/gfile/gfile.h:167:10: note: expected 'struct GFILE *' but argument is of type 'float'
../../chibios/ext/ugfx/src/gfile/gfile_printg.c:201:5: error: incompatible type for argument 1 of 'gfileWrite'
In file included from ../../chibios/ext/ugfx/gfx.h:203:0,
from ../../chibios/ext/ugfx/src/gfile/gfile_printg.c:12:
../../chibios/ext/ugfx/src/gfile/gfile.h:167:10: note: expected 'struct GFILE *' but argument is of type 'float'
../../chibios/ext/ugfx/src/gfile/gfile_printg.c:206:5: error: incompatible type for argument 1 of 'gfileWrite'
In file included from ../../chibios/ext/ugfx/gfx.h:203:0,
from ../../chibios/ext/ugfx/src/gfile/gfile_printg.c:12:
../../chibios/ext/ugfx/src/gfile/gfile.h:167:10: note: expected 'struct GFILE *' but argument is of type 'float'
../../chibios/ext/ugfx/src/gfile/gfile_printg.c:211:4: error: incompatible type for argument 1 of 'gfileWrite'
In file included from ../../chibios/ext/ugfx/gfx.h:203:0,
from ../../chibios/ext/ugfx/src/gfile/gfile_printg.c:12:
../../chibios/ext/ugfx/src/gfile/gfile.h:167:10: note: expected 'struct GFILE *' but argument is of type 'float'
../../chibios/ext/ugfx/src/gfile/gfile_printg.c:215:4: error: incompatible type for argument 1 of 'gfileWrite'
In file included from ../../chibios/ext/ugfx/gfx.h:203:0,
from ../../chibios/ext/ugfx/src/gfile/gfile_printg.c:12:
../../chibios/ext/ugfx/src/gfile/gfile.h:167:10: note: expected 'struct GFILE *' but argument is of type 'float'
make: *** [build/obj/gfile_printg.o] Error 1
make: *** Waiting for unfinished jobs....

I try it on widgets demo. Just try to add this options.

cttx5.png

///////////////////////////////////////////////////////////////////////////
// GFILE //
///////////////////////////////////////////////////////////////////////////
#define GFX_USE_GFILE TRUE
#define GFILE_ALLOW_FLOATS TRUE // added
#define GFILE_NEED_PRINTG TRUE
#define GFILE_NEED_STRINGS TRUE

#define GFILE_NEED_ROMFS TRUE

Tools: ChibiOS2.6.6 and ChibiStudio Pre8

What the best way to output float values through LABEL?

Link to comment
Share on other sites

Thanks for finding the bug. Code gets changed and we don't always get to test every code option.

I will fix it in the master repository in the morning (too late for me now).

Using sprintg is probably the best way to get a float value into a label. Given that you have found this problem it looks like you were heading that direction anyway.

Link to comment
Share on other sites

inmarket Thank you for fast reply! I will wait.

Please, test this option too:

#define GFILE_NEED_STDIO                             TRUE

I got another compile error with it:

Compiling gfile_scang.c
Compiling gfile_stdio.c
Compiling gfile_fatfs_wrapper.c
../../chibios/ext/ugfx/src/gfile/gfile_stdio.c: In function 'gstdioSeek':
../../chibios/ext/ugfx/src/gfile/gfile_stdio.c:29:14: error: dereferencing pointer to incomplete type
../../chibios/ext/ugfx/src/gfile/gfile_stdio.c: In function 'gstdioGetpos':
../../chibios/ext/ugfx/src/gfile/gfile_stdio.c:41:9: error: dereferencing pointer to incomplete type
../../chibios/ext/ugfx/src/gfile/gfile_stdio.c:41:19: error: 'GFILEFLG_OPEN' undeclared (first use in this function)
../../chibios/ext/ugfx/src/gfile/gfile_stdio.c:41:19: note: each undeclared identifier is reported only once for each function it appears in
../../chibios/ext/ugfx/src/gfile/gfile_stdio.c:43:10: error: dereferencing pointer to incomplete type
make: *** [build/obj/gfile_stdio.o] Error 1
make: *** Waiting for unfinished jobs....
Compiling gfile_fatfs_diskio_chibios.c

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...