Corrupted code generation in GUILC001 app

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
I am using the GUISL001 app to put out strings on the HMI board's OLED display. After code generation the GUILC001 App (v1.0.6) causes build errors.
../Dave/Generated/src/GUILC001/GUILC001.c:190:3: error: 'IO004_Handle9' undeclared (first use in this function)


In fact, I am using IO004 Handle19 for the OLED_CMD pin. Thus, the definition in GUILC001.c
#define GUILC001_IOHandle (IO004_Handle9)

was generated erroneously.


498.attach
0 Likes
6 Replies
Not applicable
Hi Valentina,

Thank you very much for the feedback. Pls follow-up with eTicket 421536581.

Best regards,
Sophia
0 Likes
Not applicable
I found another bug in the GUILC App (V1.0.14) template.
In the following function
/* Reads one byte of data from the OLED through SPI */
unsigned char LCD_X_Read1(void)
{
uint16_t LastWord = 0;
uint16_t Shadow_Data=0xFFFF;
SPI001_ClearFlag(&SPI001_Handle0,SPI001_RECV_IND_FLAG);
SPI001_WriteData(GUILC001_SPIHandle, &Shadow_Data, SPI001_STANDARD_FULLDUPLEX);
//while(!SPI001_GetFlagStatus(&SPI001_Handle0,SPI001_FIFO_STD_RECV_BUF_FLAG));
while(!SPI001_GetFlagStatus(&SPI001_Handle0,SPI001_RECV_IND_FLAG));

SPI001_ReadData(&SPI001_Handle0,&LastWord);

return (unsigned char)LastWord;
}
located in GUILC001c.jet there is SPI001_Handle0 used to read data instead of using the variable GUILC001_SPIHandle.
0 Likes
Not applicable
Hi Valentina,

There is a definition in GUILC001.c
const SPI001_HandleType* GUILC001_SPIHandle = &SPI001_Handle0;


BR,
Zain
0 Likes
Not applicable
Hi Zain,

that is right. But assuming that you want to communicate with the display via SPI001_Handle1 the template inserts SPI001_Handle0 in LCD_X_Read1(void) when clearing the flag, reading the flag and reading the data. Only writing data is done correctly with the mapped GUILC001_SPIHandle.

Best regards!
0 Likes
Not applicable
Hi Val-R,

You are correct, this is a mistake in the dave app.
As workaround, please replace the SPI001_Handle0 with GUILC001_SPIHandle.
When the code is generated, the definition for GUILC001_SPIHandle will mapped according to which SPI handler is used.
So the correct way should be using the GUILC001_SPIHandle.
We will submit an ticket for the bug found.
Thank you.
0 Likes
Not applicable
Hi,

Pls follow up with eTicket 891985520.

Best regards,
Sophia
0 Likes