pinsel120866
07.02.2008, 09:22
Hallo,
ich wollte mal den Programmcode aus Band 2 "Asuro bekommt ein Gesicht"
/************************************************** *****************************
*
* File Name: aufgabe3.c
*
* Lösung zur Aufgabe <ASURO bekommt ein Gesicht> aus Mehr Spaß Mit ASURO, Band II
*
* Project : ASURO-LCD extension-module
*
*
* Ver. Date Author Comments
* ------- ---------- -------------- ------------------------------
* 1.00 30.5.06 martin hofmann build
*
*
* Copyright (c) 2007 Martin Hofmann
************************************************** ***************************/
/************************************************** *************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* any later version. *
************************************************** *************************/
#include "asuro.h"
#include "lcd.h"
#include "i2c.h"
const unsigned char Eye_L[8] PROGMEM = {0X00,0X00,0X1C,0X00,0X04,0X00,0X01,0X03};
const unsigned char Eye_R[8] PROGMEM = {0X00,0X00,0X07,0X00,0X04,0X00,0X10,0X18};
const unsigned char MouthA[8] PROGMEM = {0X00,0X00,0X02,0X01,0X00,0X00,0X00,0X00};
const unsigned char MouthB[8] PROGMEM = {0X03,0X01,0X00,0X00,0X18,0X07,0X00,0X00};
const unsigned char MouthC[8] PROGMEM = {0X18,0X10,0X00,0X00,0X03,0X1C,0X00,0X00};
const unsigned char MouthD[8] PROGMEM = {0X00,0X00,0X08,0X10,0X00,0X00,0X00,0X00};
void smily_load(void) //Nötige Sonderzeichen in das Display laden
{
lcd_setchar(0,Eye_L);
lcd_setchar(1,Eye_R);
lcd_setchar(4,MouthA);
lcd_setchar(5,MouthB);
lcd_setchar(6,MouthC);
lcd_setchar(7,MouthD);
}
void smily_draw(void) //Smily mit Sonderzeichen auf dem Display darstellen
{
lcd_home();
lcd_gotoxy(2,0);
lcd_putc('('); //linkes Ohr
lcd_putc(0); //linkes Auge
lcd_putc(1); //rechtes Auge
lcd_putc(')'); //rechtes Ohr
lcd_gotoxy(2,1);
lcd_putc(4); //Mund A
lcd_putc(5); //Mund B
lcd_putc(6); //Mund C
lcd_putc(7); //Mund D
}
int main(void)
{
Init(); //Initialisiert ASURO
lcd_init(LCD_DISP_ON); //Initialisiert das Display Modul
smily_load();
smily_draw();
for(;;);
return 0;
}
mit AVR Studio unter der Lib 2.71 kompilieren und bekomme eine Mega-Liste von Fehlermeldungen:
Build started 7.2.2008 at 10:26:31
-------- begin --------
avr-gcc --version
avr-gcc (GCC) 4.2.2 (WinAVR 20071221)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
avr-gcc -mmcu=atmega8 -I. -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=aufgabe3.o aufgabe3.o asuro.o i2c.o pcf8574.o lcd.o --output aufgabe3.elf -Wl,-Map=aufgabe3.map,--cref -lm
i2c.o: In function `i2c_read':
i2c.c:(.text+0x4a): undefined reference to `sbi'
i2c.c:(.text+0x54): undefined reference to `cbi'
i2c.c:(.text+0x60): undefined reference to `cbi'
i2c.c:(.text+0x76): undefined reference to `sbi'
i2c.c:(.text+0x84): undefined reference to `cbi'
i2c.c:(.text+0x90): undefined reference to `sbi'
i2c.c:(.text+0x9c): undefined reference to `cbi'
i2c.o: In function `i2c_write':
i2c.c:(.text+0xc8): undefined reference to `sbi'
i2c.c:(.text+0xe4): undefined reference to `cbi'
i2c.c:(.text+0xf0): undefined reference to `sbi'
i2c.c:(.text+0xfc): undefined reference to `cbi'
i2c.c:(.text+0x112): undefined reference to `sbi'
i2c.c:(.text+0x11c): undefined reference to `cbi'
i2c.c:(.text+0x128): undefined reference to `cbi'
i2c.o: In function `i2c_start':
i2c.c:(.text+0x154): undefined reference to `sbi'
i2c.o: In function `i2c_stop':
i2c.c:(.text+0x16a): undefined reference to `sbi'
i2c.c:(.text+0x174): undefined reference to `sbi'
i2c.c:(.text+0x180): undefined reference to `cbi'
i2c.c:(.text+0x18c): undefined reference to `cbi'
i2c.o: In function `i2c_rep_start':
i2c.c:(.text+0x19e): undefined reference to `sbi'
i2c.c:(.text+0x1aa): undefined reference to `cbi'
i2c.c:(.text+0x1b6): undefined reference to `cbi'
i2c.c:(.text+0x1c2): undefined reference to `sbi'
i2c.o: In function `i2c_init':
i2c.c:(.text+0x1d8): undefined reference to `cbi'
i2c.c:(.text+0x1e2): undefined reference to `cbi'
i2c.c:(.text+0x1ec): undefined reference to `cbi'
i2c.c:(.text+0x1f6): undefined reference to `cbi'
lcd.o: In function `lcd_puts_p':
lcd.c:(.text+0x6c): undefined reference to `PRG_RDB'
make: *** [aufgabe3.elf] Error 1
Build failed with 28 errors and 0 warnings...
Was muss ich hier tun dass das fehlerfrei durchläuft?
ich wollte mal den Programmcode aus Band 2 "Asuro bekommt ein Gesicht"
/************************************************** *****************************
*
* File Name: aufgabe3.c
*
* Lösung zur Aufgabe <ASURO bekommt ein Gesicht> aus Mehr Spaß Mit ASURO, Band II
*
* Project : ASURO-LCD extension-module
*
*
* Ver. Date Author Comments
* ------- ---------- -------------- ------------------------------
* 1.00 30.5.06 martin hofmann build
*
*
* Copyright (c) 2007 Martin Hofmann
************************************************** ***************************/
/************************************************** *************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* any later version. *
************************************************** *************************/
#include "asuro.h"
#include "lcd.h"
#include "i2c.h"
const unsigned char Eye_L[8] PROGMEM = {0X00,0X00,0X1C,0X00,0X04,0X00,0X01,0X03};
const unsigned char Eye_R[8] PROGMEM = {0X00,0X00,0X07,0X00,0X04,0X00,0X10,0X18};
const unsigned char MouthA[8] PROGMEM = {0X00,0X00,0X02,0X01,0X00,0X00,0X00,0X00};
const unsigned char MouthB[8] PROGMEM = {0X03,0X01,0X00,0X00,0X18,0X07,0X00,0X00};
const unsigned char MouthC[8] PROGMEM = {0X18,0X10,0X00,0X00,0X03,0X1C,0X00,0X00};
const unsigned char MouthD[8] PROGMEM = {0X00,0X00,0X08,0X10,0X00,0X00,0X00,0X00};
void smily_load(void) //Nötige Sonderzeichen in das Display laden
{
lcd_setchar(0,Eye_L);
lcd_setchar(1,Eye_R);
lcd_setchar(4,MouthA);
lcd_setchar(5,MouthB);
lcd_setchar(6,MouthC);
lcd_setchar(7,MouthD);
}
void smily_draw(void) //Smily mit Sonderzeichen auf dem Display darstellen
{
lcd_home();
lcd_gotoxy(2,0);
lcd_putc('('); //linkes Ohr
lcd_putc(0); //linkes Auge
lcd_putc(1); //rechtes Auge
lcd_putc(')'); //rechtes Ohr
lcd_gotoxy(2,1);
lcd_putc(4); //Mund A
lcd_putc(5); //Mund B
lcd_putc(6); //Mund C
lcd_putc(7); //Mund D
}
int main(void)
{
Init(); //Initialisiert ASURO
lcd_init(LCD_DISP_ON); //Initialisiert das Display Modul
smily_load();
smily_draw();
for(;;);
return 0;
}
mit AVR Studio unter der Lib 2.71 kompilieren und bekomme eine Mega-Liste von Fehlermeldungen:
Build started 7.2.2008 at 10:26:31
-------- begin --------
avr-gcc --version
avr-gcc (GCC) 4.2.2 (WinAVR 20071221)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
avr-gcc -mmcu=atmega8 -I. -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=aufgabe3.o aufgabe3.o asuro.o i2c.o pcf8574.o lcd.o --output aufgabe3.elf -Wl,-Map=aufgabe3.map,--cref -lm
i2c.o: In function `i2c_read':
i2c.c:(.text+0x4a): undefined reference to `sbi'
i2c.c:(.text+0x54): undefined reference to `cbi'
i2c.c:(.text+0x60): undefined reference to `cbi'
i2c.c:(.text+0x76): undefined reference to `sbi'
i2c.c:(.text+0x84): undefined reference to `cbi'
i2c.c:(.text+0x90): undefined reference to `sbi'
i2c.c:(.text+0x9c): undefined reference to `cbi'
i2c.o: In function `i2c_write':
i2c.c:(.text+0xc8): undefined reference to `sbi'
i2c.c:(.text+0xe4): undefined reference to `cbi'
i2c.c:(.text+0xf0): undefined reference to `sbi'
i2c.c:(.text+0xfc): undefined reference to `cbi'
i2c.c:(.text+0x112): undefined reference to `sbi'
i2c.c:(.text+0x11c): undefined reference to `cbi'
i2c.c:(.text+0x128): undefined reference to `cbi'
i2c.o: In function `i2c_start':
i2c.c:(.text+0x154): undefined reference to `sbi'
i2c.o: In function `i2c_stop':
i2c.c:(.text+0x16a): undefined reference to `sbi'
i2c.c:(.text+0x174): undefined reference to `sbi'
i2c.c:(.text+0x180): undefined reference to `cbi'
i2c.c:(.text+0x18c): undefined reference to `cbi'
i2c.o: In function `i2c_rep_start':
i2c.c:(.text+0x19e): undefined reference to `sbi'
i2c.c:(.text+0x1aa): undefined reference to `cbi'
i2c.c:(.text+0x1b6): undefined reference to `cbi'
i2c.c:(.text+0x1c2): undefined reference to `sbi'
i2c.o: In function `i2c_init':
i2c.c:(.text+0x1d8): undefined reference to `cbi'
i2c.c:(.text+0x1e2): undefined reference to `cbi'
i2c.c:(.text+0x1ec): undefined reference to `cbi'
i2c.c:(.text+0x1f6): undefined reference to `cbi'
lcd.o: In function `lcd_puts_p':
lcd.c:(.text+0x6c): undefined reference to `PRG_RDB'
make: *** [aufgabe3.elf] Error 1
Build failed with 28 errors and 0 warnings...
Was muss ich hier tun dass das fehlerfrei durchläuft?