matejkrenek / stm8-lcd-i2c

Library for stm8 to work with LCD with I2C convertor
6 stars 0 forks source link

lcd_i2c.c gives error #1

Open phy-zik-tschie opened 1 month ago

phy-zik-tschie commented 1 month ago

MCU: stm8s003f3p6 ToolSet: Stm8Cosmic Compiler: STVD Windows 11

Compiling src\lcd_i2c.c... cxstm8 -iinc +debug -pxp -no -l +mods0 -pp -i"C:\Program Files (x86)\COSMIC\Hstm8" -clDebug\ -coDebug\ src\lcd_i2c.c **#error cpstm8 src\lcd_i2c.c:39(19) missing prototype

error cpstm8 src\lcd_i2c.c:40(17) missing prototype

error cpstm8 src\lcd_i2c.c:43(16) missing prototype

error cpstm8 src\lcd_i2c.c:136(8) missing ;

error cpstm8 src\lcd_i2c.c:136(20) i undefined**

src\lcd_i2c.c: The command: "cxstm8 -iinc +debug -pxp -no -l +mods0 -pp -i"C:\Program Files (x86)\COSMIC\Hstm8" -clDebug\ -coDebug\ src\lcd_i2c.c " has failed, the returned value is: 1 exit code=1.

radyo.elf - 7 error(s), 0 warning(s)

matejkrenek commented 1 month ago

Do you have the lcd_i2c.h file included when compiling the project, because it seems that prototypes of the LCD_I2C functions are not included and therefor the missing prototype error shows up?

phy-zik-tschie commented 1 month ago

There is no problem when compiling with iar.

To compile with stvd, the function called should not be below. For a function that does not have a variable, the expression "void" should be added.

Ekran görüntüsü 2024-07-24 055820

Also, the i variable should be defined before for.

Ekran görüntüsü 2024-07-24 060536