Witam,
Mam następujące kłopoty (błedy przy kompilacji). Zastanawiam się, czemu niektore rzeczy nie są opisane w ksiażce :/ Np. jak powinna wyglądać definicja I2C_Error? Jaka jest potrzebna biblioteka avr zeby niktore funkcje I2C były "rozumiane" przez kompilator? W programie głównym dodałem #include <util/twi.h> ale zostało kilka błędów. Proszę o pomoc
Błędy kompilacji:
Build started 12.12.2015 at 20:30:51
avr-gcc -mmcu=atmega8 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT zegarek.o -MF dep/zegarek.o.d -c ../zegarek.c
In file included from ../zegarek.c:15:
../twi.h: In function 'I2C_Init':
../twi.h:14: warning: implicit declaration of function 'I2C_SetBusSpeed'
../twi.h:14: error: 'I2CBUSCLOCK' undeclared (first use in this function)
../twi.h:14: error: (Each undeclared identifier is reported only once
../twi.h:14: error: for each function it appears in.)
../twi.h: At top level:
../twi.h:17: warning: conflicting types for 'I2C_SetBusSpeed'
../twi.h:14: warning: previous implicit declaration of 'I2C_SetBusSpeed' was here
../twi.h: In function 'I2C_SendAddr':
../twi.h:48: error: 'I2C_NACK' undeclared (first use in this function)
../zegarek.c:35:1: warning: "F_CPU" redefined
<command-line>: warning: this is the location of the previous definition
make: *** [zegarek.o] Error 1
Build failed with 4 errors and 5 warnings...
//Edit =====================================================
Rozwiązanie.... Tylko nie wiem dlaczego ACK ma wartość 0xC4 i NACK ma 0x84. Wiem ze to ma być dla DS1307 a w specyfikacji tech. nic nie ma o tym.
Mam następujące kłopoty (błedy przy kompilacji). Zastanawiam się, czemu niektore rzeczy nie są opisane w ksiażce :/ Np. jak powinna wyglądać definicja I2C_Error? Jaka jest potrzebna biblioteka avr zeby niktore funkcje I2C były "rozumiane" przez kompilator? W programie głównym dodałem #include <util/twi.h> ale zostało kilka błędów. Proszę o pomoc
Kod: C / C++
Błędy kompilacji:
Build started 12.12.2015 at 20:30:51
avr-gcc -mmcu=atmega8 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT zegarek.o -MF dep/zegarek.o.d -c ../zegarek.c
In file included from ../zegarek.c:15:
../twi.h: In function 'I2C_Init':
../twi.h:14: warning: implicit declaration of function 'I2C_SetBusSpeed'
../twi.h:14: error: 'I2CBUSCLOCK' undeclared (first use in this function)
../twi.h:14: error: (Each undeclared identifier is reported only once
../twi.h:14: error: for each function it appears in.)
../twi.h: At top level:
../twi.h:17: warning: conflicting types for 'I2C_SetBusSpeed'
../twi.h:14: warning: previous implicit declaration of 'I2C_SetBusSpeed' was here
../twi.h: In function 'I2C_SendAddr':
../twi.h:48: error: 'I2C_NACK' undeclared (first use in this function)
../zegarek.c:35:1: warning: "F_CPU" redefined
<command-line>: warning: this is the location of the previous definition
make: *** [zegarek.o] Error 1
Build failed with 4 errors and 5 warnings...
//Edit =====================================================
Rozwiązanie.... Tylko nie wiem dlaczego ACK ma wartość 0xC4 i NACK ma 0x84. Wiem ze to ma być dla DS1307 a w specyfikacji tech. nic nie ma o tym.
Kod: C / C++
