Pinguino Forum

Full Version: Bugs I2C libraries
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Currently I try to use the I2C libraries with IDE 11.0-beta.3 under Windows 7 together with the latest Libraries from Github (i.e. p32 in version v11.20150409).

If I try to use:
Code:
errmsg = I2C.send(I2C1,address,0x00);

the compiler tells me:
Code:
if exist C:\pinguino-11\user\source\main32.o @del C:\pinguino-11\user\source\main32.o
if exist C:\pinguino-11\user\source\main32.elf @del C:\pinguino-11\user\source\main32.elf
if exist C:\pinguino-11\user\source\main32.hex @del C:\pinguino-11\user\source\main32.hex
if exist C:\pinguino-11\user\source\obj\non-free\processor.o @del C:\pinguino-11\user\source\obj\non-free\processor.o
C:\pinguino-11\compilers\p32\bin\p32-gcc.exe -march=m4k -EL -msoft-float -nostdlib -static -O3 -minterlink-mips16 -ffunction-sections -fdata-sections -Wl,--gc-sections -Wl,-LC:\pinguino-11\user\source\obj\non-free -Wl,--defsym,_min_heap_size=512 -Wl,-Map=C:\pinguino-11\user\source\output.map -D __PIC32MX__ -D __32MX220F032D__ -D PIC32_PINGUINO_220 -TC:\pinguino-11\p32\lkr\32MX220F032D.ld -TC:\pinguino-11\p32\lkr\elf32pic32mx.x -LC:\pinguino-11\user\source\obj\non-free\usb -lm -lgcc -lc -fdollars-in-identifiers -IC:\pinguino-11\p32\include\non-free -IC:\pinguino-11\p32\include\pinguino\core -IC:\pinguino-11\p32\include\pinguino\libraries -IC:\pinguino-11\p32\lkr -IC:\Users\-\Documents\Dies_und_das\PIC32_PINGUINO_MX220\dobby -IC:\pinguino-11\user\source\obj\non-free -mips16 -S -o C:\pinguino-11\user\source\main32.S C:\pinguino-11\user\source\main32.c
In file included from C:\pinguino-11\user\source\main32.c:60:0:
C:\pinguino-11\user\source\user.c: In function 'loop':
C:\pinguino-11\user\source\user.c:25:14: error: too many arguments to function 'I2C1_send'
    errmsg = I2C1_send(I2C1,address,0x00);
             ^
In file included from C:\pinguino-11\user\source\define.h:7:0,
                from C:\pinguino-11\user\source\main32.c:41:
C:\pinguino-11\p32\include\pinguino\core/i2c1.c:100:4: note: declared here
u8 I2C1_send(u16 address, u8 byte)
   ^
make: *** [compile] Error 1

If I take a look in i2c.c, I can not find a link to I2C1_send. Ok, then I tried to use I2C1 directly:

Code:
errmsg = I2C1.send(address,0x00);

But then the compiler is searching for a pinguinoi2c1.c:

Code:
if exist C:\pinguino-11\user\source\main32.o @del C:\pinguino-11\user\source\main32.o
if exist C:\pinguino-11\user\source\main32.elf @del C:\pinguino-11\user\source\main32.elf
if exist C:\pinguino-11\user\source\main32.hex @del C:\pinguino-11\user\source\main32.hex
if exist C:\pinguino-11\user\source\obj\non-free\processor.o @del C:\pinguino-11\user\source\obj\non-free\processor.o
C:\pinguino-11\compilers\p32\bin\p32-gcc.exe -march=m4k -EL -msoft-float -nostdlib -static -O3 -minterlink-mips16 -ffunction-sections -fdata-sections -Wl,--gc-sections -Wl,-LC:\pinguino-11\user\source\obj\non-free -Wl,--defsym,_min_heap_size=512 -Wl,-Map=C:\pinguino-11\user\source\output.map -D __PIC32MX__ -D __32MX220F032D__ -D PIC32_PINGUINO_220 -TC:\pinguino-11\p32\lkr\32MX220F032D.ld -TC:\pinguino-11\p32\lkr\elf32pic32mx.x -LC:\pinguino-11\user\source\obj\non-free\usb -lm -lgcc -lc -fdollars-in-identifiers -IC:\pinguino-11\p32\include\non-free -IC:\pinguino-11\p32\include\pinguino\core -IC:\pinguino-11\p32\include\pinguino\libraries -IC:\pinguino-11\p32\lkr -IC:\Users\-\Documents\Dies_und_das\PIC32_PINGUINO_MX220\dobby -IC:\pinguino-11\user\source\obj\non-free -mips16 -S -o C:\pinguino-11\user\source\main32.S C:\pinguino-11\user\source\main32.c
In file included from C:\pinguino-11\user\source\main32.c:41:0:
C:\pinguino-11\user\source\define.h:8:26: fatal error: pinguinoi2c1.c: No such file or directory
#include <pinguinoi2c1.c>
                         ^
compilation terminated.
make: *** [compile] Error 1

Next step was to create pinguinoi2c1.c with

Code:
#include <i2c1.c>


and then the compiler finished successfully. I hope this helps.

Robert