Hi
I am trying to port ESD to ESP32 Wifi SoC in addition to FT9xx MCUs. The HAL part is working with a new directory ESP32 in FT_Eve_Hal/Hdr and FT_Eve_Hal/Src with relevant .c and .h files. New compiling directive added to FT_Platform.h as ESP32_PLATFORM, together with a new LCD model of 480*854.
Toolchain is the development framework base on Cygwin GCC in Eclipse IDE. I also tested Cross GCC and it shows to be working too. Language in pure C.
Now I am proceeding further with FT_Esd_Framework by copying all .c and .h files to project and get them compiled.
There is a problem with Ft_Esd_WidgetSlots structure in Ft_Esd_Widget.h. This structure is initialized in almost each of the .c files under /FT_Esd_Framework with individual function pointers. For example, in Ft_Esd_Layout_Tag.c this structure is initialized as follows:
static Ft_Esd_WidgetSlots s_Ft_Esd_Layout_Tag__Slots = {
(void(*)(void *))Ft_Esd_Widget_Initialize,
(void(*)(void *))Ft_Esd_Widget_Start,
(void(*)(void *))Ft_Esd_Widget_Enable,
(void(*)(void *))Ft_Esd_Widget_Update,
(void(*)(void *))Ft_Esd_Layout_Tag_Render,
(void(*)(void *))Ft_Esd_Widget_Idle,
(void(*)(void *))Ft_Esd_Widget_Disable,
(void(*)(void *))Ft_Esd_Widget_End,
};
With official Bridgetek FT9xx GCC, this intialization is giving warning as missing braces around initializer [-Wmissing-braces] Ft_Esd_FixedPointNumericLabel__Generated.c /WidgetOpacity/FT_Esd_Widgets line 26 C/C++ Problem
This is a warning but not error.
Unfortunately, the same code with Cygwin GCC/Cross GCC is giving an error with the same message missing braces around initializer [-Wmissing-braces]
Because Ft_Esd_WidgetSlots is a structure composed of a union of an array of 8 elements, should it be 3 braces in initialization like code snippet below instead of a single brace pair ?
static Ft_Esd_WidgetSlots s_Ft_Esd_Layout_Display__Slots = {{{
(void(*)(void *))Ft_Esd_Widget_Initialize,
(void(*)(void *))Ft_Esd_Widget_Start,
(void(*)(void *))Ft_Esd_Widget_Enable,
(void(*)(void *))Ft_Esd_Layout_Display_Update,
(void(*)(void *))Ft_Esd_Layout_Display_Render,
(void(*)(void *))Ft_Esd_Layout_Display_Idle,
(void(*)(void *))Ft_Esd_Widget_Disable,
(void(*)(void *))Ft_Esd_Widget_End,
}}};
I tried three braces with my toolchain and it works OK. Does anybody know why is it so? Is it something with compile options to change it?
Hope it is "legal" to port the ESD to a third party MCU as I notice only FT9xx series MCUs are supported for now. But I do realize that porting guide for ESD 4.5 is on the way. I am not sure if my question here worth an answer.
John