Subversion Repositories MK3Mag

Compare Revisions

Ignore whitespace Rev 12 → Rev 13

/tags/V0.14/timer0.h
New file
0,0 → 1,15
#define TIMER_TEILER CK8
//#define TIMER_RELOAD_VALUE 125
 
 
extern volatile unsigned int CountMilliseconds;
extern volatile unsigned char Timer0Overflow;
extern unsigned int I2C_Timeout;
extern unsigned int SIO_Timeout;
 
 
void Timer1_Init(void);
void Delay_ms(unsigned int);
unsigned int SetDelay (unsigned int t);
char CheckDelay (unsigned int t);
 
/tags/V0.14/analog.h
New file
0,0 → 1,6
 
extern void ADC_Init(void);
extern void GetAnalogWerte(void);
extern void AdConvert(void);
extern void FastADConvert(void);
extern unsigned int MessAD(unsigned char);
/tags/V0.14/main.sym
New file
0,0 → 1,253
00000000 W __heap_end
00000000 a __tmp_reg__
00000000 a __tmp_reg__
00000000 a __tmp_reg__
00000000 a __tmp_reg__
00000000 a __tmp_reg__
00000000 a __tmp_reg__
00000000 a __tmp_reg__
00000000 a __tmp_reg__
00000000 a __tmp_reg__
00000000 a __tmp_reg__
00000000 a __tmp_reg__
00000000 a __tmp_reg__
00000000 a __tmp_reg__
00000000 W __vector_default
00000000 T __vectors
00000001 a __zero_reg__
00000001 a __zero_reg__
00000001 a __zero_reg__
00000001 a __zero_reg__
00000001 a __zero_reg__
00000001 a __zero_reg__
00000001 a __zero_reg__
00000001 a __zero_reg__
00000001 a __zero_reg__
00000001 a __zero_reg__
00000001 a __zero_reg__
00000001 a __zero_reg__
00000001 a __zero_reg__
0000003d a __SP_L__
0000003d a __SP_L__
0000003d a __SP_L__
0000003d a __SP_L__
0000003d a __SP_L__
0000003d a __SP_L__
0000003d a __SP_L__
0000003d a __SP_L__
0000003d a __SP_L__
0000003d a __SP_L__
0000003d a __SP_L__
0000003d a __SP_L__
0000003d a __SP_L__
0000003e a __SP_H__
0000003e a __SP_H__
0000003e a __SP_H__
0000003e a __SP_H__
0000003e a __SP_H__
0000003e a __SP_H__
0000003e a __SP_H__
0000003e a __SP_H__
0000003e a __SP_H__
0000003e a __SP_H__
0000003e a __SP_H__
0000003e a __SP_H__
0000003e a __SP_H__
0000003f a __SREG__
0000003f a __SREG__
0000003f a __SREG__
0000003f a __SREG__
0000003f a __SREG__
0000003f a __SREG__
0000003f a __SREG__
0000003f a __SREG__
0000003f a __SREG__
0000003f a __SREG__
0000003f a __SREG__
0000003f a __SREG__
0000003f a __SREG__
00000054 t __c.0
00000054 T __ctors_end
00000054 T __ctors_start
00000054 T __dtors_end
00000054 T __dtors_start
00000069 t __c.1
0000007e t __c.2
00000093 t __c.3
000000a8 t __c.2
000000ab t __c.3
000000ae t __c.4
000000b1 t __c.5
000000b4 t __c.3
000000c2 t __c.4
000000d0 t __c.5
000000dc t __c.6
000000e1 t __c.7
000000ea t __c.8
000000f6 t __c.9
000000fe t __c.10
0000010a W __init
00000116 T __do_copy_data
00000122 t .do_copy_data_loop
00000126 t .do_copy_data_start
0000012c T __do_clear_bss
00000134 t .do_clear_bss_loop
00000136 t .do_clear_bss_start
00000140 T __bad_interrupt
00000140 W __vector_10
00000140 W __vector_12
00000140 W __vector_14
00000140 W __vector_16
00000140 W __vector_17
00000140 W __vector_18
00000140 W __vector_19
00000140 W __vector_2
00000140 W __vector_20
00000140 W __vector_3
00000140 W __vector_4
00000140 W __vector_5
00000140 W __vector_6
00000140 W __vector_7
00000140 W __vector_8
00000144 T Sekundentakt_Init
00000156 T Sekundentakt
000001b4 T Init
000001ca T main
000003c6 T __vector_15
00000430 T __vector_13
000005de T AddCRC
0000063c T SendOutData
00000724 T Decode64
000007fc T BearbeiteRxDaten
0000085f W __stack
0000097a T uart_putchar
00000996 T WriteProgramData
00000998 T UART_Init
000009b4 T SendeRemoteTasten
00000a14 T SendIntervalle
00000a5c T ClearIntervalle
00000aa2 T DatenUebertragung
00000b92 T _long_delay
00000bb2 T _short_delay
00000bc2 T _lcd_write_command
00000bee T _lcd_write_4bit
00000c0c T lcd_write_byte
00000c34 T my_pput
00000c3e T LCD_Init
00000caa T LCD_Gotoxy
00000cf8 T LCD_Write
00000d2e T LCD_Putchar
00000d44 T PRINT
00000d6c T PRINTP
00000d96 T PAD_SP
00000dae T PAD_0
00000dc6 T _printf_P
000012ce T __vector_9
0000133c T Timer1_Init
00001350 T SetDelay
00001362 T CheckDelay
00001378 T Delay_ms
00001392 T Keyboard_Init
000013a4 T GetKeyboard
000014ae T GetKeyboard2
000014c8 T Menu
000016ce T InitIR
000016fc T __vector_1
0000172c T __vector_11
00001884 T ADC_Init
0000188c T ReadADC
0000189c T GetAnalogWerte
000018c8 T memchr
000018e2 T fdevopen
00001970 T calloc
000019a8 T malloc
00001adc T free
00001b94 T memset
00001ba8 T __udivmodsi4
00001bb4 t __udivmodsi4_loop
00001bce t __udivmodsi4_ep
00001bec A __data_load_start
00001bec T _etext
00001c10 A __data_load_end
00800060 D __data_start
00800060 D IntervallDisplay
00800062 D IntervallDebug
00800064 D SlaveAdresse
00800065 D DisplayZeilen
00800066 D CntDatensaetzeProSekunde
0080006c D AnzahlTeilnehmer
0080006d D ErwarteAntwort
0080006e D UebertragungAbgeschlossen
0080006f d state.0
00800070 d KanalSlave.1
00800071 D Array
0080007b d MaxMenue.1
0080007c D LoescheIrCodeTimer
0080007e D __malloc_heap_end
00800080 D __malloc_heap_start
00800082 D __malloc_margin
00800084 B __bss_start
00800084 D __data_end
00800084 D _edata
00800084 B UebertragungUnterbrochen
00800085 B SendeDummyDaten
00800086 B GetVersionAnforderung
00800087 B DebugGetAnforderung
00800088 B Debug_Display_Intervall
0080008a B Debug_Timer_Intervall
0080008c B Minute
0080008d B Sekunde
0080008e B _TastTimer
00800090 B _SekTimer
00800092 B AntwortEingetroffen
00800093 B DisplayBusy
00800094 B TX_DigTransferKanalDaten
00800095 B TX_DigTransferKanalH
00800096 B TX_DigTransferKanalL
00800097 B PC_DebugTimeout
00800098 B AnzahlEmpfangsBytes
00800099 B CntCrcError
0080009b B NeuerDatensatzEmpfangen
0080009c B SioTmp
0080009d b ptr.11
0080009f b crc.6
008000a1 b crc1.7
008000a2 b crc2.8
008000a3 b buf_ptr.9
008000a4 b UartState.10
008000a5 B CountMilliseconds
008000a7 b cnt_10ms.0
008000a8 B KeyTimer
008000aa b taste1.0
008000ab b taste2.1
008000ac b taste3.2
008000ad b taste4.3
008000ae b taste5.4
008000af B TestInt
008000b1 b arr.0
008000b3 b MenuePunkt.2
008000b4 b Shift.0
008000b6 b IR_Code_tmp.1
008000b8 b IR_Zaehler.2
008000b9 b IRSperrCounter.3
008000ba B Debug_Timer
008000bc B Debug_Display_Timer
008000be B DebugIn
008000c9 B VersionInfo
008000d3 B DebugOut
008000ed B PollDisplay
008000ee B SendeBuffer
00800152 B RxdBuffer
008001b6 B KanalVon
008001be B KanalAn
008001c6 B New_IR_Code
008001c7 B IR_Code
008001c9 B Decodierung_Lauft
008001ca B AnalogWerte
008001d0 B __iob
008001d6 B __brkval
008001d8 B __flp
008001da B __bss_end
008001da ? __heap_start
008001da ? _end
00810000 ? __eeprom_end
/tags/V0.14/uart.c
New file
0,0 → 1,475
/*#######################################################################################
MK3Mag 3D-Magnet sensor
!!! THIS IS NOT FREE SOFTWARE !!!
#######################################################################################*/
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Copyright (c) 05.2008 Holger Buss
// + Thanks to Ilja Fähnrich (P_Latzhalter)
// + Nur für den privaten Gebrauch
// + www.MikroKopter.com
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur
// + mit unserer Zustimmung zulässig
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation),
// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist.
// + AUSNAHME: Ein bei www.mikrokopter.de erworbener vorbestückter MK3Mag darf als Baugruppe auch in kommerziellen Systemen verbaut werden
// + Im Zweifelsfall bitte anfragen bei: info@mikrokopter.de
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht,
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de"
// + eindeutig als Ursprung verlinkt werden
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion
// + Benutzung auf eigene Gefahr
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Redistributions of source code (with or without modifications) must retain the above copyright notice,
// + this list of conditions and the following disclaimer.
// + * PORTING this software (or parts of it) to systems (other than hardware from www.mikrokopter.de) is NOT allowed
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived
// + from this software without specific prior written permission.
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet
// + for non-commercial use (directly or indirectly)
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted
// + with our written permission
// + Exception: A preassembled MK3Mag, purchased from www.mikrokopter.de may be used as a part of commercial systems
// + In case of doubt please contact: info@MikroKopter.de
// + * If sources or documentations are redistributet on other webpages, our webpage (http://www.MikroKopter.de) must be
// + clearly linked as origin
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// + POSSIBILITY OF SUCH DAMAGE.
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
#include "main.h"
#include "uart.h"
 
#define MAX_SENDE_BUFF 100
#define MAX_EMPFANGS_BUFF 100
 
unsigned volatile char SIO_Sollwert = 0;
unsigned volatile char SioTmp = 0;
unsigned volatile char SendeBuffer[MAX_SENDE_BUFF];
unsigned volatile char RxdBuffer[MAX_EMPFANGS_BUFF];
unsigned volatile char NeuerDatensatzEmpfangen = 0;
unsigned volatile char UebertragungAbgeschlossen = 1;
unsigned char GetVersionAnforderung = 0,DebugTextAnforderung = 0,DebugGetAnforderung = 0, KompassAntwort = 0;
unsigned char MeineSlaveAdresse;
unsigned char MotorTest[4] = {0,0,0,0};
unsigned volatile char AnzahlEmpfangsBytes = 0;
unsigned char PcZugriff;
 
struct str_DebugOut DebugOut;
struct str_ExternData ExternData;
struct str_ExternControl ExternControl;
struct str_VersionInfo VersionInfo;
 
 
 
int Debug_Timer;
 
const unsigned char ANALOG_TEXT[32][16] =
{
//1234567890123456
"Magnet N ", //0
"Magnet R ",
"Magnet Z ",
"Raw N ",
"Raw R ",
"Raw Z ", //5
"Lage N ",
"Lage R ",
"Xmin ",
"Xmax ",
"Ymin ", //10
"Ymax ",
"Zmin ",
"ZMax ",
"Calstate ",
"Kompass ", //15
"User0 ",
"User1 ",
"Analog18 ",
"Analog19 ",
"Analog20 ", //20
"Analog21 ",
"Analog22 ",
"Analog23 ",
"Analog24 ",
"Analog25 ", //25
"Analog26 ",
"Analog27 ",
"Analog28 ",
"Analog29 ",
"Analog30 ", //30
"Analog31 "
};
 
 
 
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ Sende-Part der Datenübertragung
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SIGNAL(INT_VEC_TX)
{
static unsigned int ptr = 0;
unsigned char tmp_tx;
if(!UebertragungAbgeschlossen)
{
ptr++; // die [0] wurde schon gesendet
tmp_tx = SendeBuffer[ptr];
if((tmp_tx == '\r') || (ptr == MAX_SENDE_BUFF))
{
ptr = 0;
UebertragungAbgeschlossen = 1;
}
UDR = tmp_tx;
}
else ptr = 0;
}
 
void SendUart(void)
{
static unsigned int ptr = 0;
unsigned char tmp_tx;
if(!(USR & 0x40)) return;
if(!UebertragungAbgeschlossen)
{
ptr++; // die [0] wurde schon gesendet
tmp_tx = SendeBuffer[ptr];
if((tmp_tx == '\r') || (ptr == MAX_SENDE_BUFF))
{
ptr = 0;
UebertragungAbgeschlossen = 1;
}
USR |= (1<TXC0);
UDR = tmp_tx;
}
else ptr = 0;
}
 
// --------------------------------------------------------------------------
void Decode64(unsigned char *ptrOut, unsigned char len, unsigned char ptrIn,unsigned char max) // Wohin mit den Daten; Wie lang; Wo im RxdBuffer
{
unsigned char a,b,c,d;
unsigned char ptr = 0;
unsigned char x,y,z;
while(len)
{
a = RxdBuffer[ptrIn++] - '=';
b = RxdBuffer[ptrIn++] - '=';
c = RxdBuffer[ptrIn++] - '=';
d = RxdBuffer[ptrIn++] - '=';
if(ptrIn > max - 2) break; // nicht mehr Daten verarbeiten, als empfangen wurden
 
x = (a << 2) | (b >> 4);
y = ((b & 0x0f) << 4) | (c >> 2);
z = ((c & 0x03) << 6) | d;
 
if(len--) ptrOut[ptr++] = x; else break;
if(len--) ptrOut[ptr++] = y; else break;
if(len--) ptrOut[ptr++] = z; else break;
}
 
}
 
 
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ Empfangs-Part der Datenübertragung
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SIGNAL(INT_VEC_RX)
{
static unsigned int crc;
static unsigned char crc1,crc2,buf_ptr;
static unsigned char UartState = 0;
unsigned char CrcOkay = 0;
SioTmp = UDR;
if(buf_ptr >= MAX_EMPFANGS_BUFF) UartState = 0;
if(SioTmp == '\r' && UartState == 2)
{
UartState = 0;
crc -= RxdBuffer[buf_ptr-2];
crc -= RxdBuffer[buf_ptr-1];
crc %= 4096;
crc1 = '=' + crc / 64;
crc2 = '=' + crc % 64;
CrcOkay = 0;
if((crc1 == RxdBuffer[buf_ptr-2]) && (crc2 == RxdBuffer[buf_ptr-1])) CrcOkay = 1; else { CrcOkay = 0; };
if(CrcOkay) // Datensatz schon verarbeitet
{
NeuerDatensatzEmpfangen = 1;
AnzahlEmpfangsBytes = buf_ptr;
RxdBuffer[buf_ptr] = '\r';
if((RxdBuffer[2] == 'R')) wdt_enable(WDTO_250MS); // Reset-Commando
// uart_putchar(RxdBuffer[2]);
}
}
else
switch(UartState)
{
case 0:
if(SioTmp == '#' && !NeuerDatensatzEmpfangen) UartState = 1; // Startzeichen und Daten schon verarbeitet
buf_ptr = 0;
RxdBuffer[buf_ptr++] = SioTmp;
crc = SioTmp;
break;
case 1: // Adresse auswerten
UartState++;
RxdBuffer[buf_ptr++] = SioTmp;
crc += SioTmp;
break;
case 2: // Eingangsdaten sammeln
RxdBuffer[buf_ptr] = SioTmp;
if(buf_ptr < MAX_EMPFANGS_BUFF) buf_ptr++;
else UartState = 0;
crc += SioTmp;
break;
default:
UartState = 0;
break;
}
 
};
 
 
// --------------------------------------------------------------------------
void AddCRC(unsigned int wieviele)
{
unsigned int tmpCRC = 0,i;
for(i = 0; i < wieviele;i++)
{
tmpCRC += SendeBuffer[i];
}
tmpCRC %= 4096;
SendeBuffer[i++] = '=' + tmpCRC / 64;
SendeBuffer[i++] = '=' + tmpCRC % 64;
SendeBuffer[i++] = '\r';
UebertragungAbgeschlossen = 0;
UDR = SendeBuffer[0];
}
 
 
// --------------------------------------------------------------------------
void SendOutData(unsigned char cmd,unsigned char modul, unsigned char *snd, unsigned char len)
{
unsigned int pt = 0;
unsigned char a,b,c;
unsigned char ptr = 0;
SendeBuffer[pt++] = '#'; // Startzeichen
SendeBuffer[pt++] = modul; // Adresse (a=0; b=1,...)
SendeBuffer[pt++] = cmd; // Commando
 
while(len)
{
if(len) { a = snd[ptr++]; len--;} else a = 0;
if(len) { b = snd[ptr++]; len--;} else b = 0;
if(len) { c = snd[ptr++]; len--;} else c = 0;
SendeBuffer[pt++] = '=' + (a >> 2);
SendeBuffer[pt++] = '=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4));
SendeBuffer[pt++] = '=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6));
SendeBuffer[pt++] = '=' + ( c & 0x3f);
}
AddCRC(pt);
}
 
 
 
//############################################################################
//Routine für die Serielle Ausgabe
int uart_putchar (char c)
//############################################################################
{
if(!(UCR & (1 << TXEN))) return (0);
if (c == '\n')
uart_putchar('\r');
//Warten solange bis Zeichen gesendet wurde
loop_until_bit_is_set(USR, UDRE);
//Ausgabe des Zeichens
UDR = c;
return (0);
}
 
// --------------------------------------------------------------------------
void WriteProgramData(unsigned int pos, unsigned char wert)
{
}
 
//############################################################################
//INstallation der Seriellen Schnittstelle
void UART_Init (void)
//############################################################################
{
//Enable TXEN im Register UCR TX-Data Enable & RX Enable
 
UCR=(1 << TXEN) | (1 << RXEN);
// UART Double Speed (U2X)
USR |= (1<<U2X);
// RX-Interrupt Freigabe
 
UCSRB |= (1<<RXCIE); // serieller Empfangsinterrupt
 
// TX-Interrupt Freigabe
UCSRB |= (1<<TXCIE);
 
//Teiler wird gesetzt
UBRR= (SYSCLK / (BAUD_RATE * 8L) -1 );
//öffnet einen Kanal für printf (STDOUT)
// fdevopen (uart_putchar, NULL);
Debug_Timer = SetDelay(200);
// Version beim Start ausgeben (nicht schön, aber geht... )
uart_putchar ('\n');uart_putchar ('C');uart_putchar ('P');uart_putchar (':');
uart_putchar ('V');uart_putchar (0x30 + VERSION_HAUPTVERSION);uart_putchar ('.');uart_putchar (0x30 + VERSION_NEBENVERSION/10); uart_putchar (0x30 + VERSION_NEBENVERSION%10);
uart_putchar ('\n');
}
 
 
void BearbeiteRxDaten(void)
{
if(!NeuerDatensatzEmpfangen) return;
// unsigned int tmp_int_arr1[1];
// unsigned int tmp_int_arr2[2];
// unsigned int tmp_int_arr3[3];
unsigned char tmp_char_arr2[2];
// unsigned char tmp_char_arr3[3];
// unsigned char tmp_char_arr4[4];
//if(!MotorenEin)
PcZugriff = 255;
 
switch(RxdBuffer[2])
{
case 'w':// Lagewinkel
Decode64((unsigned char *) &ExternData,sizeof(ExternData),3,AnzahlEmpfangsBytes);
DebugOut.Analog[15]++;
KompassAntwort = 1;
break;
case 'c':
case 'b':
Decode64((unsigned char *) &ExternControl,sizeof(ExternControl),3,AnzahlEmpfangsBytes);
ExternData.Winkel[0] = ExternControl.Par1;
ExternData.Winkel[1] = ExternControl.Par2;
break;
case 'v': // Version-Anforderung und Ausbaustufe
GetVersionAnforderung = 1;
PC_Connected = 255;
break;
 
case 'a':// Texte der Analogwerte
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes);
DebugTextAnforderung = tmp_char_arr2[0];
PC_Connected = 255;
break;
case 'g':// "Get"-Anforderung für Debug-Daten
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen
PC_Connected = 255;
DebugGetAnforderung = 1;
break;
case 'h':// x-1 Displayzeilen
PC_Connected = 255;
break;
/*
case 'b':
Decode64((unsigned char *) &ExternControl,sizeof(ExternControl),3,AnzahlEmpfangsBytes);
RemoteTasten |= ExternControl.RemoteTasten;
ConfirmFrame = ExternControl.Frame;
break;
case 'c':
Decode64((unsigned char *) &ExternControl,sizeof(ExternControl),3,AnzahlEmpfangsBytes);
RemoteTasten |= ExternControl.RemoteTasten;
ConfirmFrame = ExternControl.Frame;
DebugDataAnforderung = 1;
break;
case 'h':// x-1 Displayzeilen
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes);
RemoteTasten |= tmp_char_arr2[0];
if(tmp_char_arr2[1] == 255) NurKanalAnforderung = 1; else NurKanalAnforderung = 0; // keine Displaydaten
DebugDisplayAnforderung = 1;
break;
case 't':// Motortest
Decode64((unsigned char *) &MotorTest[0],sizeof(MotorTest),3,AnzahlEmpfangsBytes);
break;
case 'k':// Keys von DubWise
Decode64((unsigned char *) &DubWiseKeys[0],sizeof(DubWiseKeys),3,AnzahlEmpfangsBytes);
ConfirmFrame = DubWiseKeys[3];
break;
case 'q':// "Get"-Anforderung für Settings
// Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen
Decode64((unsigned char *) &tmp_char_arr2[0],sizeof(tmp_char_arr2),3,AnzahlEmpfangsBytes);
if(tmp_char_arr2[0] != 0xff)
{
if(tmp_char_arr2[0] > 5) tmp_char_arr2[0] = 5;
ReadParameterSet(tmp_char_arr2[0], (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE);
SendOutData('L' + tmp_char_arr2[0] -1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE);
}
else
SendOutData('L' + GetActiveParamSetNumber()-1,MeineSlaveAdresse,(unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE);
break;
case 'l':
case 'm':
case 'n':
case 'o':
case 'p': // Parametersatz speichern
Decode64((unsigned char *) &EE_Parameter.Kanalbelegung[0],STRUCT_PARAM_LAENGE,3,AnzahlEmpfangsBytes);
WriteParameterSet(RxdBuffer[2] - 'l' + 1, (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE);
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], RxdBuffer[2] - 'l' + 1); // aktiven Datensatz merken
Umschlag180Nick = (long) EE_Parameter.WinkelUmschlagNick * 2500L;
Umschlag180Roll = (long) EE_Parameter.WinkelUmschlagRoll * 2500L;
Piep(GetActiveParamSetNumber());
break;
*/
}
// DebugOut.AnzahlZyklen = Debug_Timer_Intervall;
NeuerDatensatzEmpfangen = 0;
}
 
 
//---------------------------------------------------------------------------------------------
void DatenUebertragung(void)
{
if((CheckDelay(Debug_Timer) && UebertragungAbgeschlossen)) // im Singlestep-Betrieb in jedem Schtitt senden
{
SetDebugValues();
SendOutData('D',MeineSlaveAdresse,(unsigned char *) &DebugOut,sizeof(DebugOut));
Debug_Timer = SetDelay(250); // Sendeintervall
}
if(GetVersionAnforderung && UebertragungAbgeschlossen)
{
SendOutData('V',MeineSlaveAdresse,(unsigned char *) &VersionInfo,sizeof(VersionInfo));
GetVersionAnforderung = 0;
}
if(DebugTextAnforderung != 255) // Texte für die Analogdaten
{
SendOutData('A',DebugTextAnforderung + '0',(unsigned char *) ANALOG_TEXT[DebugTextAnforderung],16);
DebugTextAnforderung = 255;
}
if(DebugGetAnforderung && UebertragungAbgeschlossen) // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen
{
SendOutData('G',MeineSlaveAdresse,(unsigned char *) &ExternControl,sizeof(ExternControl));
DebugGetAnforderung = 0;
}
if(KompassAntwort && UebertragungAbgeschlossen) // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen
{
SendOutData('K',MeineSlaveAdresse,(unsigned char *) &I2C_Heading,sizeof(I2C_Heading));
KompassAntwort = 0;
}
}
 
/tags/V0.14/Compassl.pnps
New file
0,0 → 1,0
<pd><ViewState><e p="avr_ctrl" x="true"></e></ViewState></pd>
/tags/V0.14/License.txt
New file
0,0 → 1,56
/*#######################################################################################
MK3Mag 3D-Magnet sensor
!!! THIS IS NOT FREE SOFTWARE !!!
#######################################################################################*/
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Copyright (c) 05.2008 Holger Buss
// + Thanks to Ilja Fähnrich (P_Latzhalter)
// + Nur für den privaten Gebrauch
// + www.MikroKopter.com
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur
// + mit unserer Zustimmung zulässig
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation),
// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist.
// + AUSNAHME: Ein bei www.mikrokopter.de erworbener vorbestückter MK3Mag darf als Baugruppe auch in kommerziellen Systemen verbaut werden
// + Im Zweifelsfall bitte anfragen bei: info@mikrokopter.de
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht,
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de"
// + eindeutig als Ursprung verlinkt werden
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion
// + Benutzung auf eigene Gefahr
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Redistributions of source code (with or without modifications) must retain the above copyright notice,
// + this list of conditions and the following disclaimer.
// + * PORTING this software (or parts of it) to systems (other than hardware from www.mikrokopter.de) is NOT allowed
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived
// + from this software without specific prior written permission.
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet
// + for non-commercial use (directly or indirectly)
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted
// + with our written permission
// + Exception: A preassembled MK3Mag, purchased from www.mikrokopter.de may be used as a part of commercial systems
// + In case of doubt please contact: info@MikroKopter.de
// + * If sources or documentations are redistributet on other webpages, our webpage (http://www.MikroKopter.de) must be
// + clearly linked as origin
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// + POSSIBILITY OF SUCH DAMAGE.
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/tags/V0.14/main.map
New file
0,0 → 1,764
Archive member included because of file (symbol)
 
C:/WinAVR/lib/gcc/avr/3.4.5/avr5\libgcc.a(_udivmodsi4.o)
printf_P.o (__udivmodsi4)
C:/WinAVR/lib/gcc/avr/3.4.5/avr5\libgcc.a(_copy_data.o)
main.o (__do_copy_data)
C:/WinAVR/lib/gcc/avr/3.4.5/avr5\libgcc.a(_clear_bss.o)
main.o (__do_clear_bss)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(memchr.o)
printf_P.o (memchr)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(fdevopen.o)
uart.o (fdevopen)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(iob.o)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(fdevopen.o) (__iob)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(calloc.o)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(fdevopen.o) (calloc)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(malloc.o)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(calloc.o) (malloc)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(memset.o)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(calloc.o) (memset)
 
Allocating common symbols
Common symbol size file
 
SendeBuffer 0x64 uart.o
Debug_Timer 0x2 main.o
Debug_Display_Timer
0x2 main.o
__brkval 0x2 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(malloc.o)
DebugIn 0xb main.o
VersionInfo 0xa main.o
New_IR_Code 0x1 ir.o
RxdBuffer 0x64 uart.o
AnalogWerte 0x6 analog.o
IR_Code 0x2 ir.o
KanalVon 0x8 menu.o
Decodierung_Lauft 0x1 ir.o
DebugOut 0x1a main.o
KanalAn 0x8 menu.o
__flp 0x2 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(malloc.o)
PollDisplay 0x1 main.o
__iob 0x6 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(iob.o)
 
Memory Configuration
 
Name Origin Length Attributes
text 0x00000000 0x00020000 xr
data 0x00800060 0x0000ffa0 rw !x
eeprom 0x00810000 0x00010000 rw !x
*default* 0x00000000 0xffffffff
 
Linker script and memory map
 
LOAD C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
LOAD main.o
LOAD uart.o
LOAD lcd.o
LOAD printf_P.o
LOAD timer0.o
LOAD keyboard.o
LOAD menu.o
LOAD ir.o
LOAD analog.o
LOAD C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libm.a
LOAD C:/WinAVR/lib/gcc/avr/3.4.5/avr5\libgcc.a
LOAD C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a
LOAD C:/WinAVR/lib/gcc/avr/3.4.5/avr5\libgcc.a
 
.hash
*(.hash)
 
.dynsym
*(.dynsym)
 
.dynstr
*(.dynstr)
 
.gnu.version
*(.gnu.version)
 
.gnu.version_d
*(.gnu.version_d)
 
.gnu.version_r
*(.gnu.version_r)
 
.rel.init
*(.rel.init)
 
.rela.init
*(.rela.init)
 
.rel.text
*(.rel.text)
*(.rel.text.*)
*(.rel.gnu.linkonce.t*)
 
.rela.text
*(.rela.text)
*(.rela.text.*)
*(.rela.gnu.linkonce.t*)
 
.rel.fini
*(.rel.fini)
 
.rela.fini
*(.rela.fini)
 
.rel.rodata
*(.rel.rodata)
*(.rel.rodata.*)
*(.rel.gnu.linkonce.r*)
 
.rela.rodata
*(.rela.rodata)
*(.rela.rodata.*)
*(.rela.gnu.linkonce.r*)
 
.rel.data
*(.rel.data)
*(.rel.data.*)
*(.rel.gnu.linkonce.d*)
 
.rela.data
*(.rela.data)
*(.rela.data.*)
*(.rela.gnu.linkonce.d*)
 
.rel.ctors
*(.rel.ctors)
 
.rela.ctors
*(.rela.ctors)
 
.rel.dtors
*(.rel.dtors)
 
.rela.dtors
*(.rela.dtors)
 
.rel.got
*(.rel.got)
 
.rela.got
*(.rela.got)
 
.rel.bss
*(.rel.bss)
 
.rela.bss
*(.rela.bss)
 
.rel.plt
*(.rel.plt)
 
.rela.plt
*(.rela.plt)
 
.text 0x00000000 0x1c18
*(.vectors)
.vectors 0x00000000 0x54 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
0x00000000 __vectors
0x00000000 __vector_default
0x00000054 __ctors_start = .
*(.ctors)
0x00000054 __ctors_end = .
0x00000054 __dtors_start = .
*(.dtors)
0x00000054 __dtors_end = .
*(.progmem.gcc*)
*(.progmem*)
.progmem.data 0x00000054 0x54 main.o
.progmem.data 0x000000a8 0xc uart.o
.progmem.data 0x000000b4 0x56 menu.o
0x0000010a . = ALIGN (0x2)
*(.init0)
*(.init1)
*(.init2)
.init2 0x0000010a 0xc C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
*(.init3)
*(.init4)
.init4 0x00000116 0x16 C:/WinAVR/lib/gcc/avr/3.4.5/avr5\libgcc.a(_copy_data.o)
0x00000116 __do_copy_data
.init4 0x0000012c 0x10 C:/WinAVR/lib/gcc/avr/3.4.5/avr5\libgcc.a(_clear_bss.o)
0x0000012c __do_clear_bss
*(.init5)
*(.init6)
*(.init7)
*(.init8)
*(.init9)
.init9 0x0000013c 0x4 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
*(.text)
.text 0x00000140 0x4 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
0x00000140 __vector_12
0x00000140 __bad_interrupt
0x00000140 __vector_6
0x00000140 __vector_3
0x00000140 __vector_17
0x00000140 __vector_19
0x00000140 __vector_7
0x00000140 __vector_5
0x00000140 __vector_4
0x00000140 __vector_2
0x00000140 __vector_8
0x00000140 __vector_14
0x00000140 __vector_10
0x00000140 __vector_16
0x00000140 __vector_18
0x00000140 __vector_20
.text 0x00000144 0x282 main.o
0x000001b4 Init
0x00000156 Sekundentakt
0x000001ca main
0x00000144 Sekundentakt_Init
.text 0x000003c6 0x7e6 uart.o
0x000009f8 WriteProgramData
0x00000a16 SendeRemoteTasten
0x000009fa UART_Init
0x00000430 __vector_13
0x0000080a BearbeiteRxDaten
0x00000abe ClearIntervalle
0x00000a76 SendIntervalle
0x000005de AddCRC
0x00000b04 DatenUebertragung
0x00000732 Decode64
0x000003c6 __vector_15
0x0000064a SendOutData
0x000009dc uart_putchar
.text 0x00000bac 0x1b2 lcd.o
0x00000cc4 LCD_Gotoxy
0x00000c4e my_pput
0x00000c08 _lcd_write_4bit
0x00000bcc _short_delay
0x00000c26 lcd_write_byte
0x00000bdc _lcd_write_command
0x00000c58 LCD_Init
0x00000d48 LCD_Putchar
0x00000d12 LCD_Write
0x00000bac _long_delay
.text 0x00000d5e 0x58a printf_P.o
0x00000de0 _printf_P
0x00000dc8 PAD_0
0x00000d86 PRINTP
0x00000d5e PRINT
0x00000db0 PAD_SP
.text 0x000012e8 0xd6 timer0.o
0x0000137c SetDelay
0x0000138e CheckDelay
0x000013a4 Delay_ms
0x000012e8 __vector_9
0x00001368 Timer1_Init
.text 0x000013be 0x136 keyboard.o
0x000014da GetKeyboard2
0x000013be Keyboard_Init
0x000013d0 GetKeyboard
.text 0x000014f4 0x206 menu.o
0x000014f4 Menu
.text 0x000016fa 0x1b6 ir.o
0x00001728 __vector_1
0x00001758 __vector_11
0x000016fa InitIR
.text 0x000018b0 0x44 analog.o
0x000018c8 GetAnalogWerte
0x000018b8 ReadADC
0x000018b0 ADC_Init
.text 0x000018f4 0x1a C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(memchr.o)
0x000018f4 memchr
.text 0x0000190e 0x8e C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(fdevopen.o)
0x0000190e fdevopen
.text 0x0000199c 0x38 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(calloc.o)
0x0000199c calloc
.text 0x000019d4 0x1ec C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(malloc.o)
0x000019d4 malloc
0x00001b08 free
.text 0x00001bc0 0x14 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(memset.o)
0x00001bc0 memset
0x00001bd4 . = ALIGN (0x2)
*(.text.*)
.text.libgcc 0x00001bd4 0x44 C:/WinAVR/lib/gcc/avr/3.4.5/avr5\libgcc.a(_udivmodsi4.o)
0x00001bd4 __udivmodsi4
0x00001c18 . = ALIGN (0x2)
*(.fini9)
*(.fini8)
*(.fini7)
*(.fini6)
*(.fini5)
*(.fini4)
*(.fini3)
*(.fini2)
*(.fini1)
*(.fini0)
0x00001c18 _etext = .
 
.data 0x00800060 0x24 load address 0x00001c18
0x00800060 PROVIDE (__data_start, .)
*(.data)
.data 0x00800060 0xc main.o
0x00800065 DisplayZeilen
0x00800064 SlaveAdresse
0x00800066 CntDatensaetzeProSekunde
0x00800062 IntervallDebug
0x00800060 IntervallDisplay
.data 0x0080006c 0x5 uart.o
0x0080006e UebertragungAbgeschlossen
0x0080006c AnzahlTeilnehmer
0x0080006d ErwarteAntwort
.data 0x00800071 0xb menu.o
0x00800071 Array
.data 0x0080007c 0x2 ir.o
0x0080007c LoescheIrCodeTimer
.data 0x0080007e 0x6 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(malloc.o)
0x00800080 __malloc_heap_start
0x0080007e __malloc_heap_end
0x00800082 __malloc_margin
*(.gnu.linkonce.d*)
0x00800084 . = ALIGN (0x2)
0x00800084 _edata = .
0x00800084 PROVIDE (__data_end, .)
 
.bss 0x00800084 0x157
0x00800084 PROVIDE (__bss_start, .)
*(.bss)
.bss 0x00800084 0xe main.o
0x00800087 DebugGetAnforderung
0x00800088 Debug_Display_Intervall
0x00800086 GetVersionAnforderung
0x0080008d Sekunde
0x00800085 SendeDummyDaten
0x0080008e _TastTimer
0x0080008c Minute
0x0080008a Debug_Timer_Intervall
0x00800084 UebertragungUnterbrochen
0x00800090 _SekTimer
.bss 0x00800092 0x14 uart.o
0x0080009d SioTmp
0x00800098 PC_DebugTimeout
0x0080009c NeuerDatensatzEmpfangen
0x0080009a CntCrcError
0x00800097 TX_DigTransferKanalL
0x00800094 DisplayBusy
0x00800092 WaitTXD
0x00800099 AnzahlEmpfangsBytes
0x00800095 TX_DigTransferKanalDaten
0x00800093 AntwortEingetroffen
0x00800096 TX_DigTransferKanalH
.bss 0x008000a6 0x3 timer0.o
0x008000a6 CountMilliseconds
.bss 0x008000a9 0x7 keyboard.o
0x008000a9 KeyTimer
.bss 0x008000b0 0x5 menu.o
0x008000b0 TestInt
.bss 0x008000b5 0x6 ir.o
*(COMMON)
COMMON 0x008000bb 0x34 main.o
0x008000bb Debug_Timer
0x008000bd Debug_Display_Timer
0x008000bf DebugIn
0x008000ca VersionInfo
0x008000d4 DebugOut
0x008000ee PollDisplay
COMMON 0x008000ef 0xc8 uart.o
0x008000ef SendeBuffer
0x00800153 RxdBuffer
COMMON 0x008001b7 0x10 menu.o
0x008001b7 KanalVon
0x008001bf KanalAn
COMMON 0x008001c7 0x4 ir.o
0x008001c7 New_IR_Code
0x008001c8 IR_Code
0x008001ca Decodierung_Lauft
COMMON 0x008001cb 0x6 analog.o
0x008001cb AnalogWerte
COMMON 0x008001d1 0x6 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(iob.o)
0x008001d1 __iob
COMMON 0x008001d7 0x4 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(malloc.o)
0x008001d7 __brkval
0x008001d9 __flp
0x008001db PROVIDE (__bss_end, .)
0x00001c18 __data_load_start = LOADADDR (.data)
0x00001c3c __data_load_end = (__data_load_start + SIZEOF (.data))
 
.noinit 0x008001db 0x0
0x008001db PROVIDE (__noinit_start, .)
*(.noinit*)
0x008001db PROVIDE (__noinit_end, .)
0x008001db _end = .
0x008001db PROVIDE (__heap_start, .)
 
.eeprom 0x00810000 0x0
*(.eeprom*)
0x00810000 __eeprom_end = .
 
.stab 0x00000000 0x36c
*(.stab)
.stab 0x00000000 0x36c C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
 
.stabstr 0x00000000 0x84
*(.stabstr)
.stabstr 0x00000000 0x84 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
 
.stab.excl
*(.stab.excl)
 
.stab.exclstr
*(.stab.exclstr)
 
.stab.index
*(.stab.index)
 
.stab.indexstr
*(.stab.indexstr)
 
.comment
*(.comment)
 
.debug
*(.debug)
 
.line
*(.line)
 
.debug_srcinfo
*(.debug_srcinfo)
 
.debug_sfnames
*(.debug_sfnames)
 
.debug_aranges 0x00000000 0xb4
*(.debug_aranges)
.debug_aranges
0x00000000 0x14 main.o
.debug_aranges
0x00000014 0x14 uart.o
.debug_aranges
0x00000028 0x14 lcd.o
.debug_aranges
0x0000003c 0x14 printf_P.o
.debug_aranges
0x00000050 0x14 timer0.o
.debug_aranges
0x00000064 0x14 keyboard.o
.debug_aranges
0x00000078 0x14 menu.o
.debug_aranges
0x0000008c 0x14 ir.o
.debug_aranges
0x000000a0 0x14 analog.o
 
.debug_pubnames
0x00000000 0x701
*(.debug_pubnames)
.debug_pubnames
0x00000000 0x1e1 main.o
.debug_pubnames
0x000001e1 0x240 uart.o
.debug_pubnames
0x00000421 0xb7 lcd.o
.debug_pubnames
0x000004d8 0x4a printf_P.o
.debug_pubnames
0x00000522 0x70 timer0.o
.debug_pubnames
0x00000592 0x52 keyboard.o
.debug_pubnames
0x000005e4 0x4a menu.o
.debug_pubnames
0x0000062e 0x85 ir.o
.debug_pubnames
0x000006b3 0x4e analog.o
 
.debug_info 0x00000000 0x1a6c
*(.debug_info)
.debug_info 0x00000000 0x469 main.o
.debug_info 0x00000469 0x7ba uart.o
.debug_info 0x00000c23 0x260 lcd.o
.debug_info 0x00000e83 0x45d printf_P.o
.debug_info 0x000012e0 0x1d7 timer0.o
.debug_info 0x000014b7 0x177 keyboard.o
.debug_info 0x0000162e 0x1a7 menu.o
.debug_info 0x000017d5 0x171 ir.o
.debug_info 0x00001946 0x126 analog.o
*(.gnu.linkonce.wi.*)
 
.debug_abbrev 0x00000000 0x774
*(.debug_abbrev)
.debug_abbrev 0x00000000 0x10c main.o
.debug_abbrev 0x0000010c 0x178 uart.o
.debug_abbrev 0x00000284 0xbc lcd.o
.debug_abbrev 0x00000340 0x132 printf_P.o
.debug_abbrev 0x00000472 0xc5 timer0.o
.debug_abbrev 0x00000537 0x87 keyboard.o
.debug_abbrev 0x000005be 0xb6 menu.o
.debug_abbrev 0x00000674 0x76 ir.o
.debug_abbrev 0x000006ea 0x8a analog.o
 
.debug_line 0x00000000 0x16a3
*(.debug_line)
.debug_line 0x00000000 0x2aa main.o
.debug_line 0x000002aa 0x4c4 uart.o
.debug_line 0x0000076e 0x279 lcd.o
.debug_line 0x000009e7 0x4e2 printf_P.o
.debug_line 0x00000ec9 0x180 timer0.o
.debug_line 0x00001049 0x170 keyboard.o
.debug_line 0x000011b9 0x19a menu.o
.debug_line 0x00001353 0x212 ir.o
.debug_line 0x00001565 0x13e analog.o
 
.debug_frame
*(.debug_frame)
 
.debug_str 0x00000000 0x889
*(.debug_str)
.debug_str 0x00000000 0x2e2 main.o
0x371 (size before relaxing)
.debug_str 0x000002e2 0x26b uart.o
0x423 (size before relaxing)
.debug_str 0x0000054d 0x9a lcd.o
0x17b (size before relaxing)
.debug_str 0x000005e7 0xf9 printf_P.o
0x1bd (size before relaxing)
.debug_str 0x000006e0 0x6b timer0.o
0x168 (size before relaxing)
.debug_str 0x0000074b 0x5e keyboard.o
0x13f (size before relaxing)
.debug_str 0x000007a9 0x40 menu.o
0x15e (size before relaxing)
.debug_str 0x000007e9 0x6d ir.o
0x169 (size before relaxing)
.debug_str 0x00000856 0x33 analog.o
0x120 (size before relaxing)
 
.debug_loc
*(.debug_loc)
 
.debug_macinfo
*(.debug_macinfo)
OUTPUT(main.elf elf32-avr)
 
Cross Reference Table
 
Symbol File
ADC_Init analog.o
main.o
AddCRC uart.o
AnalogWerte analog.o
uart.o
AntwortEingetroffen uart.o
AnzahlEmpfangsBytes uart.o
AnzahlTeilnehmer uart.o
menu.o
Array menu.o
BearbeiteRxDaten uart.o
main.o
CheckDelay timer0.o
keyboard.o
main.o
ClearIntervalle uart.o
main.o
CntCrcError uart.o
menu.o
CntDatensaetzeProSekunde main.o
uart.o
CountMilliseconds timer0.o
DatenUebertragung uart.o
main.o
DebugGetAnforderung main.o
DebugIn uart.o
main.o
DebugOut uart.o
main.o
Debug_Display_Intervall main.o
Debug_Display_Timer main.o
Debug_Timer main.o
Debug_Timer_Intervall main.o
Decode64 uart.o
Decodierung_Lauft ir.o
Delay_ms timer0.o
main.o
DisplayBusy uart.o
timer0.o
DisplayZeilen main.o
menu.o
uart.o
ErwarteAntwort uart.o
GetAnalogWerte analog.o
main.o
GetKeyboard keyboard.o
main.o
GetKeyboard2 keyboard.o
main.o
GetVersionAnforderung main.o
IR_Code ir.o
timer0.o
uart.o
Init main.o
InitIR ir.o
main.o
IntervallDebug main.o
IntervallDisplay main.o
KanalAn menu.o
KanalVon menu.o
KeyTimer keyboard.o
Keyboard_Init keyboard.o
main.o
LCD_Gotoxy lcd.o
menu.o
uart.o
main.o
LCD_Init lcd.o
main.o
LCD_Putchar lcd.o
printf_P.o
LCD_Write lcd.o
LoescheIrCodeTimer ir.o
timer0.o
Menu menu.o
main.o
Minute main.o
NeuerDatensatzEmpfangen uart.o
New_IR_Code ir.o
PAD_0 printf_P.o
PAD_SP printf_P.o
PC_DebugTimeout uart.o
PRINT printf_P.o
PRINTP printf_P.o
PollDisplay uart.o
main.o
ReadADC analog.o
RxdBuffer uart.o
Sekunde main.o
Sekundentakt main.o
Sekundentakt_Init main.o
SendIntervalle uart.o
SendOutData uart.o
SendeBuffer uart.o
SendeDummyDaten main.o
SendeRemoteTasten uart.o
SetDelay timer0.o
keyboard.o
main.o
SioTmp uart.o
SlaveAdresse main.o
menu.o
uart.o
TX_DigTransferKanalDaten uart.o
TX_DigTransferKanalH uart.o
TX_DigTransferKanalL uart.o
TestInt menu.o
Timer1_Init timer0.o
main.o
UART_Init uart.o
main.o
UebertragungAbgeschlossen uart.o
UebertragungUnterbrochen main.o
VersionInfo main.o
WaitTXD uart.o
timer0.o
WriteProgramData uart.o
_SekTimer main.o
_TastTimer main.o
__bad_interrupt C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__brkval C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(malloc.o)
__bss_end C:/WinAVR/lib/gcc/avr/3.4.5/avr5\libgcc.a(_clear_bss.o)
__bss_start C:/WinAVR/lib/gcc/avr/3.4.5/avr5\libgcc.a(_clear_bss.o)
__data_end C:/WinAVR/lib/gcc/avr/3.4.5/avr5\libgcc.a(_copy_data.o)
__data_load_start C:/WinAVR/lib/gcc/avr/3.4.5/avr5\libgcc.a(_copy_data.o)
__data_start C:/WinAVR/lib/gcc/avr/3.4.5/avr5\libgcc.a(_copy_data.o)
__do_clear_bss C:/WinAVR/lib/gcc/avr/3.4.5/avr5\libgcc.a(_clear_bss.o)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(malloc.o)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(calloc.o)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(iob.o)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(fdevopen.o)
analog.o
ir.o
menu.o
keyboard.o
timer0.o
printf_P.o
lcd.o
uart.o
main.o
__do_copy_data C:/WinAVR/lib/gcc/avr/3.4.5/avr5\libgcc.a(_copy_data.o)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(malloc.o)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(calloc.o)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(iob.o)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(fdevopen.o)
analog.o
ir.o
menu.o
keyboard.o
timer0.o
printf_P.o
lcd.o
uart.o
main.o
__flp C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(malloc.o)
__heap_end C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(malloc.o)
__heap_start C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(malloc.o)
__init C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__iob C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(iob.o)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(fdevopen.o)
__malloc_heap_end C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(malloc.o)
__malloc_heap_start C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(malloc.o)
__malloc_margin C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(malloc.o)
__stack C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
main.o
__udivmodsi4 C:/WinAVR/lib/gcc/avr/3.4.5/avr5\libgcc.a(_udivmodsi4.o)
printf_P.o
__vector_1 ir.o
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_10 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_11 ir.o
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_12 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_13 uart.o
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_14 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_15 uart.o
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_16 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_17 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_18 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_19 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_2 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_20 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_3 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_4 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_5 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_6 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_7 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_8 C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_9 timer0.o
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vector_default C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
__vectors C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
_lcd_write_4bit lcd.o
_lcd_write_command lcd.o
menu.o
main.o
_long_delay lcd.o
menu.o
main.o
_printf_P printf_P.o
menu.o
uart.o
main.o
_short_delay lcd.o
calloc C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(calloc.o)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(fdevopen.o)
fdevopen C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(fdevopen.o)
uart.o
free C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(malloc.o)
lcd_write_byte lcd.o
main main.o
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5/crtm32.o
malloc C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(malloc.o)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(calloc.o)
memchr C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(memchr.o)
printf_P.o
memset C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(memset.o)
C:/WinAVR/bin/../lib/gcc/avr/3.4.5/../../../../avr/lib/avr5\libc.a(calloc.o)
my_pput lcd.o
uart_putchar uart.o
/tags/V0.14/uart.h
New file
0,0 → 1,135
#ifndef _UART_H
#define _UART_H
 
extern unsigned volatile char SIO_Sollwert;
extern unsigned volatile char UebertragungAbgeschlossen;
extern unsigned volatile char PC_DebugTimeout;
extern unsigned char MeineSlaveAdresse;
extern int Debug_Timer;
extern void UART_Init (void);
extern int uart_putchar (char c);
extern void boot_program_page (uint32_t page, uint8_t *buf);
extern void SendUart(void);
 
void DatenUebertragung(void);
 
struct str_DebugOut
{
unsigned char Digital[2];
unsigned int Analog[32]; // Debugwerte
};
 
struct str_ExternData
{
signed int Winkel[2]; // in 0,1 degree
unsigned char UserParameter[2];
unsigned char CalState;
unsigned char Orientation;
};
extern struct str_ExternData ExternData;
#define NICK 0
#define ROLL 1
 
 
struct str_ExternControl
{
unsigned char Digital[2];
unsigned char RemoteTasten;
signed char Nick;
signed char Roll;
signed char Gier;
unsigned char Gas;
signed char Hight;
unsigned char Par1;
unsigned char Par2;
unsigned char Par3;
};
extern struct str_ExternControl ExternControl;
 
struct str_VersionInfo
{
unsigned char Hauptversion;
unsigned char Nebenversion;
unsigned char PCKompatibel;
unsigned char Rserved[7];
};
extern struct str_VersionInfo VersionInfo;
 
 
extern struct str_DebugOut DebugOut;
extern struct str_DebugOut DebugOut;
//Die Baud_Rate der Seriellen Schnittstelle
//#define BAUD_RATE 9600 //Baud Rate für die Serielle Schnittstelle
//#define BAUD_RATE 14400 //Baud Rate für die Serielle Schnittstelle
//#define BAUD_RATE 28800 //Baud Rate für die Serielle Schnittstelle
 
#if X3D_SIO == 1
#define BAUD_RATE 38400 //Baud Rate für die Serielle Schnittstelle
#else
#define BAUD_RATE 57600 //Baud Rate für die Serielle Schnittstelle
#endif
 
//Anpassen der seriellen Schnittstellen Register wenn ein ATMega128 benutzt wird
#if defined (__AVR_ATmega128__)
# define USR UCSR0A
# define UCR UCSR0B
# define UDR UDR0
# define UBRR UBRR0L
# define EICR EICRB
#endif
 
#if defined (__AVR_ATmega8__)
# define USR UCSRA
# define UCR UCSRB
# define UBRR UBRRL
# define EICR EICRB
# define INT_VEC_RX SIG_UART_RECV
# define INT_VEC_TX SIG_UART_TRANS
#endif
 
#if defined (__AVR_ATmega168__)
# define USR UCSR0A
# define UCR UCSR0B
# define UDR UDR0
# define UBRR UBRR0L
# define EICR EICR0B
# define TXEN TXEN0
# define RXEN RXEN0
# define RXCIE RXCIE0
# define TXCIE TXCIE0
# define U2X U2X0
# define UCSRB UCSR0B
# define UDRE UDRE0
# define INT_VEC_RX SIG_USART_RECV
# define INT_VEC_TX SIG_USART_TRANS
#endif
 
 
#if defined (__AVR_ATmega32__)
# define USR UCSRA
# define UCR UCSRB
# define UBRR UBRRL
# define EICR EICRB
# define INT_VEC_RX SIG_UART_RECV
# define INT_VEC_TX SIG_UART_TRANS
#endif
 
#if defined (__AVR_ATmega644__)
# define USR UCSR0A
# define UCR UCSR0B
# define UDR UDR0
# define UBRR UBRR0L
# define EICR EICR0B
# define TXEN TXEN0
# define RXEN RXEN0
# define RXCIE RXCIE0
# define TXCIE TXCIE0
# define U2X U2X0
# define UCSRB UCSR0B
# define UDRE UDRE0
# define INT_VEC_RX SIG_USART_RECV
# define INT_VEC_TX SIG_USART_TRANS
#endif
 
 
#endif //_UART_H
/tags/V0.14/main.c
New file
0,0 → 1,287
/*#######################################################################################
MK3Mag 3D-Magnet sensor
!!! THIS IS NOT FREE SOFTWARE !!!
#######################################################################################*/
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Copyright (c) 05.2008 Holger Buss
// + Thanks to Ilja Fähnrich (P_Latzhalter)
// + Nur für den privaten Gebrauch
// + www.MikroKopter.com
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur
// + mit unserer Zustimmung zulässig
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation),
// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist.
// + AUSNAHME: Ein bei www.mikrokopter.de erworbener vorbestückter MK3Mag darf als Baugruppe auch in kommerziellen Systemen verbaut werden
// + Im Zweifelsfall bitte anfragen bei: info@mikrokopter.de
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht,
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de"
// + eindeutig als Ursprung verlinkt werden
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion
// + Benutzung auf eigene Gefahr
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Redistributions of source code (with or without modifications) must retain the above copyright notice,
// + this list of conditions and the following disclaimer.
// + * PORTING this software (or parts of it) to systems (other than hardware from www.mikrokopter.de) is NOT allowed
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived
// + from this software without specific prior written permission.
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet
// + for non-commercial use (directly or indirectly)
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted
// + with our written permission
// + Exception: A preassembled MK3Mag, purchased from www.mikrokopter.de may be used as a part of commercial systems
// + In case of doubt please contact: info@MikroKopter.de
// + * If sources or documentations are redistributet on other webpages, our webpage (http://www.MikroKopter.de) must be
// + clearly linked as origin
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// + POSSIBILITY OF SUCH DAMAGE.
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
signed int OffsetN, OffsetR, OffsetZ;
 
signed int RawMagnet1a,RawMagnet1b; // raw AD-Data
signed int RawMagnet2a,RawMagnet2b;
signed int RawMagnet3a,RawMagnet3b;
signed int Xmin = 0, Xmax = 0; Ymin = 0, Ymax = 0; Zmin = 0, Zmax = 0;
signed int UncalMagnetN,UncalMagnetR,UncalMagnetZ; // Messwert-Delta ohne Offset- und Verstärker korrektur
signed int MagnetN,MagnetR,MagnetZ;
unsigned int PwmHeading = 0;
unsigned int PC_Connected = 0;
unsigned int Heading;
#include "main.h"
 
uint16_t eeXmin EEMEM = 0;
uint16_t eeXmax EEMEM = 0;
uint16_t eeYmin EEMEM = 0;
uint16_t eeYmax EEMEM = 0;
uint16_t eeZmin EEMEM = 0;
uint16_t eeZmax EEMEM = 0;
 
 
//############################################################################
//
void Wait(unsigned char dauer)
//############################################################################
{
dauer = (unsigned char)TCNT0 + dauer;
while((TCNT0 - dauer) & 0x80);
}
 
void CalcFields(void)
{
UncalMagnetN = (1 * UncalMagnetN + (RawMagnet1a - RawMagnet1b)) / 2;
UncalMagnetR = (1 * UncalMagnetR + (RawMagnet3a - RawMagnet3b)) / 2;
UncalMagnetZ = (1 * UncalMagnetZ + (RawMagnet2a - RawMagnet2b)) / 2;
 
OffsetN = (Xmin + Xmax) / 2;
OffsetR = (Ymin + Ymax) / 2;
OffsetZ = (Zmin + Zmax) / 2;
 
MagnetN = (1024L * (long)(UncalMagnetN - OffsetN)) / (Xmax - Xmin);
MagnetR = (1024L * (long)(UncalMagnetR - OffsetR)) / (Ymax - Ymin);
MagnetZ = (1024L * (long)(UncalMagnetZ - OffsetZ)) / (Zmax - Zmin);
}
 
void CalcHeading(void)
{
double nick_rad, roll_rad, Hx, Hy, Cx, Cy, Cz;
int heading;
nick_rad = ((double)ExternData.Winkel[0]) * M_PI / (double)(1800);
roll_rad = ((double)ExternData.Winkel[1]) * M_PI / (double)(1800);
 
Cx = MagnetN;
Cy = MagnetR;
Cz = MagnetZ;
 
if(ExternData.Orientation == 1)
{
Cx = MagnetR;
Cy = -MagnetN;
Cz = MagnetZ;
}
 
Hx = Cx * (double)cos(nick_rad) +
Cy * (double)sin(nick_rad) * (double)sin(roll_rad) -
Cz * (double)sin(nick_rad) * (double)cos(roll_rad);
Hy = Cy * (double)cos(roll_rad) +
Cz * (double)sin(roll_rad);
if(Hx == 0 && Hy < 0) heading = 90;
else if(Hx == 0 && Hy > 0) heading = 270;
else if(Hx < 0) heading = 180 - (atan(Hy / Hx) * 180.0) / M_PI;
else if(Hx > 0 && Hy < 0) heading = - (atan(Hy / Hx) * 180.0) / M_PI;
else if(Hx > 0 && Hy > 0) heading = 360 - (atan(Hy / Hx) * 180.0) / M_PI;
 
if(abs(heading) < 361) Heading = heading;
PwmHeading = Heading + 10;
}
 
 
void Calibrate(void)
{
unsigned char cal;
if(I2C_WriteCal.CalByte) cal = I2C_WriteCal.CalByte;
else cal = ExternData.CalState;
switch(cal)
{
case 0:
LED_ON;
break;
case 1:
Xmin = 10000;
Xmax = -10000;
Ymin = 10000;
Ymax = -10000;
Zmin = 10000;
Zmax = -10000;
LED_OFF;
break;
case 2:
LED_ON; // find Min and Max of the X- and Y-Sensors
if(UncalMagnetN < Xmin) Xmin = UncalMagnetN;
if(UncalMagnetN > Xmax) Xmax = UncalMagnetN;
if(UncalMagnetR < Ymin) Ymin = UncalMagnetR;
if(UncalMagnetR > Ymax) Ymax = UncalMagnetR;
break;
case 3:
LED_OFF;
break;
case 4:
LED_ON; // find Min and Max of the Z-Sensor
if(UncalMagnetZ < Zmin) Zmin = UncalMagnetZ;
if(UncalMagnetZ > Zmax) Zmax = UncalMagnetZ;
break;
case 5:
LED_OFF; // Save values
if((Xmax - Xmin) > 150 && (Ymax - Ymin) > 150 && (Zmax - Zmin) > 150)
{
eeprom_write_word(&eeXmin, Xmin);
eeprom_write_word(&eeXmax, Xmax);
eeprom_write_word(&eeYmin, Ymin);
eeprom_write_word(&eeYmax, Ymax);
eeprom_write_word(&eeZmin, Zmin);
eeprom_write_word(&eeZmax, Zmax);
Delay_ms(2000);
}
LED_ON;
break;
}
}
 
 
void SetDebugValues(void)
{
DebugOut.Analog[0] = MagnetN;
DebugOut.Analog[1] = MagnetR;
DebugOut.Analog[2] = MagnetZ;
DebugOut.Analog[3] = UncalMagnetN;
DebugOut.Analog[4] = UncalMagnetR;
DebugOut.Analog[5] = UncalMagnetZ;
DebugOut.Analog[6] = ExternData.Winkel[0];
DebugOut.Analog[7] = ExternData.Winkel[1];
DebugOut.Analog[8] = Xmin;
DebugOut.Analog[9] = Xmax;
DebugOut.Analog[10] = Ymin;
DebugOut.Analog[11] = Ymax;
DebugOut.Analog[12] = Zmin;
DebugOut.Analog[13] = Zmax;
DebugOut.Analog[14] = ExternData.CalState;
DebugOut.Analog[15] = Heading;
DebugOut.Analog[16] = ExternData.UserParameter[0];
DebugOut.Analog[17] = ExternData.UserParameter[1];
}
 
 
//############################################################################
//Hauptprogramm
int main (void)
//############################################################################
{
DDRC = 0x08;
PORTC = 0x08;
DDRD = 0xf4;
PORTD = 0xA0;
DDRB = 0x04;
PORTB = 0x35;
LED_ON;
UART_Init();
Timer0_Init();
ADC_Init();
InitIC2_Slave();
sei();//Globale Interrupts Einschalten
Debug_Timer = SetDelay(100); // Sendeintervall
Xmin = eeprom_read_word(&eeXmin);
Xmax = eeprom_read_word(&eeXmax);
Ymin = eeprom_read_word(&eeYmin);
Ymax = eeprom_read_word(&eeYmax);
Zmin = eeprom_read_word(&eeZmin);
Zmax = eeprom_read_word(&eeZmax);
 
VersionInfo.Hauptversion = VERSION_HAUPTVERSION;
VersionInfo.Nebenversion = VERSION_NEBENVERSION;
VersionInfo.PCKompatibel = 7;
ExternData.Orientation = 0;
ExternData.CalState = 0;
I2C_WriteCal.CalByte = 0;
while (1)
{
FLIP_LOW;
Delay_ms(2);
RawMagnet1a = MessAD(0);
RawMagnet2a = -MessAD(1);
RawMagnet3a = MessAD(7);
Delay_ms(1);
 
FLIP_HIGH;
Delay_ms(2);
RawMagnet1b = MessAD(0);
RawMagnet2b = -MessAD(1);
RawMagnet3b = MessAD(7);
Delay_ms(1);
 
CalcFields();
if(ExternData.CalState || I2C_WriteCal.CalByte) Calibrate();
else CalcHeading();
BearbeiteRxDaten();
 
if(PC_Connected)
{
DDRD |= 0x02; // TXD-Portpin
UCR |= (1 << TXEN);
DatenUebertragung();
PC_Connected--;
}
else
{
UCR &= ~(1 << TXEN);
DDRD &= ~0x02; // TXD-Portpin
}
} // while(1)
}
 
/tags/V0.14/old_macros.h
New file
0,0 → 1,47
/*
For backwards compatibility only.
Ingo Busker ingo@mikrocontroller.com
*/
 
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
 
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif
 
#ifndef inb
#define inb(sfr) _SFR_BYTE(sfr)
#endif
 
#ifndef outb
#define outb(sfr, val) (_SFR_BYTE(sfr) = (val))
#endif
 
#ifndef inw
#define inw(sfr) _SFR_WORD(sfr)
#endif
 
#ifndef outw
#define outw(sfr, val) (_SFR_WORD(sfr) = (val))
#endif
 
#ifndef outp
#define outp(val, sfr) outb(sfr, val)
#endif
 
#ifndef inp
#define inp(sfr) inb(sfr)
#endif
 
#ifndef BV
#define BV(bit) _BV(bit)
#endif
 
 
#ifndef PRG_RDB
#define PRG_RDB pgm_read_byte
#endif
 
/tags/V0.14/main.h
New file
0,0 → 1,76
#ifndef _MAIN_H
#define _MAIN_H
 
 
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include <avr/eeprom.h>
#include <avr/boot.h>
#include <avr/wdt.h>
#include <avr/eeprom.h>
 
#include "twislave.h"
#include "old_macros.h"
#include "analog.h"
#include "uart.h"
#include "timer0.h"
 
 
#if defined(__AVR_ATmega8__)
# define OC1 PB1
# define DDROC DDRB
# define OCR OCR1A
# define PWM10 WGM10
# define PWM11 WGM11
#endif
 
#define SYSCLK 8000000L //Quarz Frequenz in Hz
 
#define INT0_ENABLE GIMSK |= 0x40
#define INT0_DISABLE GIMSK &= ~0x40
#define TIM0_START TIMSK0 |= _BV(TOIE0)
#define TIM0_STOPP TIMSK0 &= ~_BV(TOIE0)
 
#define ICP_INT_ENABLE TIMSK0 |= 0x20
#define ICP_INT_DISABLE TIMSK0 &= ~0x20
#define TIMER1_INT_ENABLE TIMSK0 |= 0x04
#define TIMER1_INT_DISABLE TIMSK0 &= ~0x04
#define TIMER2_INT_ENABLE TIMSK0 |= 0x40
#define TIMER2_INT_DISABLE TIMSK0 &= ~0x40
#define INT0_POS_FLANKE MCUCR |= 0x01
#define INT0_ANY_FLANKE MCUCR |= 0x01
#define INT0_NEG_FLANKE MCUCR &= ~0x01
#define CLR_INT0_FLAG GIFR &= ~0x40
#define INIT_INT0_FLANKE MCUCR &= ~0x03; MCUCR |= 0x02;
#define TIMER0_PRESCALER TCCR0
#define ICP_POS_FLANKE TCCR1B |= (1<<ICES1)
#define ICP_NEG_FLANKE TCCR1B &= ~(1<<ICES1)
 
#define LED_ON PORTD |= 0x80
#define LED_OFF PORTD &= ~0x80
#define FLIP_HIGH PORTD |= 0x60
#define FLIP_LOW PORTD &= ~0x60
 
extern unsigned int PwmHeading;
extern unsigned int PC_Connected;
extern unsigned int Heading;
extern signed int MagnetN,MagnetR,MagnetZ;
 
extern uint16_t eeXmin EEMEM;
extern uint16_t eeXmax EEMEM;
extern uint16_t eeYmin EEMEM;
extern uint16_t eeYmax EEMEM;
extern uint16_t eeZmin EEMEM;
extern uint16_t eeZmax EEMEM;
 
#endif //_MAIN_H
 
 
 
 
 
/tags/V0.14/Compass.pnproj
New file
0,0 → 1,0
<Project name="avr_ctrl"><File path="uart.h"></File><File path="main.c"></File><File path="main.h"></File><File path="makefile"></File><File path="uart.c"></File><File path="timer0.c"></File><File path="timer0.h"></File><File path="analog.h"></File><File path="analog.c"></File><File path="twislave.c"></File><File path="twislave.h"></File></Project>
/tags/V0.14/makefile
New file
0,0 → 1,386
#--------------------------------------------------------------------
# MCU name
MCU = atmega168
#-------------------------------------------------------------------
HAUPT_VERSION = 0
NEBEN_VERSION = 14
#-------------------------------------------------------------------
 
# Output format. (can be srec, ihex, binary)
FORMAT = ihex
 
# Target file name (without extension).
TARGET = MK3Mag_MEGA168_V$(HAUPT_VERSION)_$(NEBEN_VERSION)
 
# Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization.
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
OPT = s
 
##########################################################################################################
# List C source files here. (C dependencies are automatically generated.)
SRC = main.c uart.c timer0.c analog.c twislave.c
#printf_P.c
##########################################################################################################
 
# If there is more than one source file, append them above, or modify and
# uncomment the following:
#SRC += foo.c bar.c
 
# You can also wrap lines by appending a backslash to the end of the line:
#SRC += baz.c \
#xyzzy.c
 
 
 
# List Assembler source files here.
# Make them always end in a capital .S. Files ending in a lowercase .s
# will not be considered source files but generated files (assembler
# output from the compiler), and will be deleted upon "make clean"!
# Even though the DOS/Win* filesystem matches both .s and .S the same,
# it will preserve the spelling of the filenames, and gcc itself does
# care about how the name is spelled on its command-line.
ASRC =
 
 
# List any extra directories to look for include files here.
# Each directory must be seperated by a space.
EXTRAINCDIRS =
 
 
# Optional compiler flags.
# -g: generate debugging information (for GDB, or for COFF conversion)
# -O*: optimization level
# -f...: tuning, see gcc manual and avr-libc documentation
# -Wall...: warning level
# -Wa,...: tell GCC to pass this to the assembler.
# -ahlms: create assembler listing
CFLAGS = -g -O$(OPT) \
-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums \
-Wall -Wstrict-prototypes \
-Wa,-adhlns=$(<:.c=.lst) \
$(patsubst %,-I%,$(EXTRAINCDIRS))
 
 
# Set a "language standard" compiler flag.
# Unremark just one line below to set the language standard to use.
# gnu99 = C99 + GNU extensions. See GCC manual for more information.
#CFLAGS += -std=c89
#CFLAGS += -std=gnu89
#CFLAGS += -std=c99
CFLAGS += -std=gnu99
 
CFLAGS += -DVERSION_HAUPTVERSION=$(HAUPT_VERSION) -DVERSION_NEBENVERSION=$(NEBEN_VERSION)
 
ifeq ($(AVR_CTRL_PLATINE), 1)
CFLAGS += -DAVR_CTRL_PLATINE=$(AVR_CTRL_PLATINE)
endif
 
 
 
# Optional assembler flags.
# -Wa,...: tell GCC to pass this to the assembler.
# -ahlms: create listing
# -gstabs: have the assembler create line number information; note that
# for use in COFF files, additional information about filenames
# and function names needs to be present in the assembler source
# files -- see avr-libc docs [FIXME: not yet described there]
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
 
 
 
# Optional linker flags.
# -Wl,...: tell GCC to pass this to linker.
# -Map: create map file
# --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
 
 
 
# Additional libraries
 
# Minimalistic printf version
#LDFLAGS += -Wl,-u,vfprintf -lprintf_min
 
# Floating point printf version (requires -lm below)
#LDFLAGS += -Wl,-u,vfprintf -lprintf_flt
 
# -lm = math library
LDFLAGS += -lm
 
 
 
 
# Programming support using avrdude. Settings and variables.
 
# Programming hardware: alf avr910 avrisp bascom bsd
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
#
# Type: avrdude -c ?
# to get a full listing.
#
 
AVRDUDE_PROGRAMMER = dt006
#AVRDUDE_PROGRAMMER = stk200
 
#AVRDUDE_PORT = com1 # programmer connected to serial device
AVRDUDE_PORT = lpt1 # programmer connected to parallel port
 
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
 
AVRDUDE_FLAGS = -F -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
 
# Uncomment the following if you want avrdude's erase cycle counter.
# Note that this counter needs to be initialized first using -Yn,
# see avrdude manual.
#AVRDUDE_ERASE += -y
 
# Uncomment the following if you do /not/ wish a verification to be
# performed after programming the device.
#AVRDUDE_FLAGS += -V -E noreset
 
 
# Increase verbosity level. Please use this when submitting bug
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
# to submit bug reports.
#AVRDUDE_FLAGS += -v -v
 
 
 
 
# ---------------------------------------------------------------------------
 
# Define directories, if needed.
DIRAVR = c:/winavr
DIRAVRBIN = $(DIRAVR)/bin
DIRAVRUTILS = $(DIRAVR)/utils/bin
DIRINC = .
DIRLIB = $(DIRAVR)/avr/lib
 
 
# Define programs and commands.
SHELL = sh
 
CC = avr-gcc
 
OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
SIZE = avr-size
 
 
# Programming support using avrdude.
AVRDUDE = avrdude
 
 
REMOVE = rm -f
COPY = cp
 
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
ELFSIZE = $(SIZE) -A $(TARGET).elf
 
 
 
# Define Messages
# English
MSG_ERRORS_NONE = Errors: none
MSG_BEGIN = -------- begin --------
MSG_END = -------- end --------
MSG_SIZE_BEFORE = Size before:
MSG_SIZE_AFTER = Size after:
MSG_COFF = Converting to AVR COFF:
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
MSG_FLASH = Creating load file for Flash:
MSG_EEPROM = Creating load file for EEPROM:
MSG_EXTENDED_LISTING = Creating Extended Listing:
MSG_SYMBOL_TABLE = Creating Symbol Table:
MSG_LINKING = Linking:
MSG_COMPILING = Compiling:
MSG_ASSEMBLING = Assembling:
MSG_CLEANING = Cleaning project:
 
 
 
 
# Define all object files.
OBJ = $(SRC:.c=.o) $(ASRC:.S=.o)
 
# Define all listing files.
LST = $(ASRC:.S=.lst) $(SRC:.c=.lst)
 
# Combine all necessary flags and optional flags.
# Add target processor to flags.
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS)
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
 
 
 
# Default target.
all: begin gccversion sizebefore $(TARGET).elf $(TARGET).hex $(TARGET).eep \
$(TARGET).lss $(TARGET).sym sizeafter finished end
 
 
# Eye candy.
# AVR Studio 3.x does not check make's exit code but relies on
# the following magic strings to be generated by the compile job.
begin:
@echo
@echo $(MSG_BEGIN)
 
finished:
@echo $(MSG_ERRORS_NONE)
 
end:
@echo $(MSG_END)
@echo
 
 
# Display size of file.
sizebefore:
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi
 
sizeafter:
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
 
 
 
# Display compiler version information.
gccversion :
@$(CC) --version
 
 
 
 
# Convert ELF to COFF for use in debugging / simulating in
# AVR Studio or VMLAB.
COFFCONVERT=$(OBJCOPY) --debugging \
--change-section-address .data-0x800000 \
--change-section-address .bss-0x800000 \
--change-section-address .noinit-0x800000 \
--change-section-address .eeprom-0x810000
 
 
coff: $(TARGET).elf
@echo
@echo $(MSG_COFF) $(TARGET).cof
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
 
 
extcoff: $(TARGET).elf
@echo
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
 
 
 
 
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
 
 
 
 
# Create final output files (.hex, .eep) from ELF output file.
%.hex: %.elf
@echo
@echo $(MSG_FLASH) $@
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
 
%.eep: %.elf
@echo
@echo $(MSG_EEPROM) $@
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
 
# Create extended listing file from ELF output file.
%.lss: %.elf
@echo
@echo $(MSG_EXTENDED_LISTING) $@
$(OBJDUMP) -h -S $< > $@
 
# Create a symbol table from ELF output file.
%.sym: %.elf
@echo
@echo $(MSG_SYMBOL_TABLE) $@
avr-nm -n $< > $@
 
 
 
# Link: create ELF output file from object files.
.SECONDARY : $(TARGET).elf
.PRECIOUS : $(OBJ)
%.elf: $(OBJ)
@echo
@echo $(MSG_LINKING) $@
$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)
 
 
# Compile: create object files from C source files.
%.o : %.c
@echo
@echo $(MSG_COMPILING) $<
$(CC) -c $(ALL_CFLAGS) $< -o $@
 
 
# Compile: create assembler files from C source files.
%.s : %.c
$(CC) -S $(ALL_CFLAGS) $< -o $@
 
 
# Assemble: create object files from assembler source files.
%.o : %.S
@echo
@echo $(MSG_ASSEMBLING) $<
$(CC) -c $(ALL_ASFLAGS) $< -o $@
 
 
 
 
 
 
# Target: clean project.
clean: begin clean_list finished end
 
clean_list :
@echo
@echo $(MSG_CLEANING)
# $(REMOVE) $(TARGET).hex
# $(REMOVE) $(TARGET).eep
# $(REMOVE) $(TARGET).obj
$(REMOVE) $(TARGET).cof
$(REMOVE) $(TARGET).elf
$(REMOVE) $(TARGET).map
$(REMOVE) $(TARGET).obj
$(REMOVE) $(TARGET).a90
$(REMOVE) $(TARGET).sym
$(REMOVE) $(TARGET).lnk
$(REMOVE) $(TARGET).lss
$(REMOVE) $(OBJ)
$(REMOVE) $(LST)
$(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d)
 
 
# Automatically generate C source code dependencies.
# (Code originally taken from the GNU make user manual and modified
# (See README.txt Credits).)
#
# Note that this will work with sh (bash) and sed that is shipped with WinAVR
# (see the SHELL variable defined above).
# This may not work with other shells or other seds.
#
%.d: %.c
set -e; $(CC) -MM $(ALL_CFLAGS) $< \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > $@; \
[ -s $@ ] || rm -f $@
 
 
# Remove the '-' if you want to see the dependency files generated.
-include $(SRC:.c=.d)
 
 
 
# Listing of phony targets.
.PHONY : all begin finish end sizebefore sizeafter gccversion coff extcoff \
clean clean_list program
 
/tags/V0.14/twislave.c
New file
0,0 → 1,198
/*#######################################################################################
MK3Mag 3D-Magnet sensor
!!! THIS IS NOT FREE SOFTWARE !!!
#######################################################################################*/
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Copyright (c) 05.2008 Holger Buss
// + Thanks to Ilja Fähnrich (P_Latzhalter)
// + Nur für den privaten Gebrauch
// + www.MikroKopter.com
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur
// + mit unserer Zustimmung zulässig
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation),
// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist.
// + AUSNAHME: Ein bei www.mikrokopter.de erworbener vorbestückter MK3Mag darf als Baugruppe auch in kommerziellen Systemen verbaut werden
// + Im Zweifelsfall bitte anfragen bei: info@mikrokopter.de
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht,
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de"
// + eindeutig als Ursprung verlinkt werden
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion
// + Benutzung auf eigene Gefahr
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Redistributions of source code (with or without modifications) must retain the above copyright notice,
// + this list of conditions and the following disclaimer.
// + * PORTING this software (or parts of it) to systems (other than hardware from www.mikrokopter.de) is NOT allowed
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived
// + from this software without specific prior written permission.
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet
// + for non-commercial use (directly or indirectly)
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted
// + with our written permission
// + Exception: A preassembled MK3Mag, purchased from www.mikrokopter.de may be used as a part of commercial systems
// + In case of doubt please contact: info@MikroKopter.de
// + * If sources or documentations are redistributet on other webpages, our webpage (http://www.MikroKopter.de) must be
// + clearly linked as origin
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// + POSSIBILITY OF SUCH DAMAGE.
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
#include <avr/io.h>
#include <util/twi.h>
#include "main.h"
 
unsigned char I2C_RxBufferSize, I2C_TxBufferSize;
unsigned char *I2C_TxBuffer, *I2C_RxBuffer;
unsigned char Tx_Idx=0, Rx_Idx=0, I2C_Direction;
unsigned char I2C_Command;
unsigned char Tx_Idx, Rx_Idx;
 
struct str_I2C_Heading I2C_Heading;
struct str_I2C_WriteNickRoll I2C_WriteNickRoll;
struct str_I2C_Mag I2C_Mag;
struct str_I2C_EEPROM I2C_ReadEEPROM, I2C_WriteEEPROM;
struct str_I2C_Version I2C_Version;
struct str_I2C_WriteCal I2C_WriteCal;
 
 
 
//############################################################################
//I2C (TWI) Interface Init
void InitIC2_Slave(void)
//############################################################################
{
TWAR = I2C_SLAVE_ADDRESS; // Eigene Adresse setzen
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWIE) | (1<<TWEA);
I2C_Version.Hauptversion = VersionInfo.Hauptversion;
I2C_Version.Nebenversion = VersionInfo.Nebenversion;
I2C_Version.Comp = 1;
}
#define TWCR_ACK TWCR = (1<<TWEN)|(1<<TWIE)|(1<<TWINT)|(1<<TWEA)|(0<<TWSTA)|(0<<TWSTO)|(0<<TWWC)
//############################################################################
//ISR, die bei einem Ereignis auf dem Bus ausgelöst wird. Im Register TWSR befindet
//sich dann ein Statuscode, anhand dessen die Situation festgestellt werden kann.
ISR (TWI_vect)
//############################################################################
{
switch (TWSR & 0xF8)
{
case SR_SLA_ACK:
//TWCR |= (1<<TWINT);
Rx_Idx = 0;
TWCR_ACK;
return;
// Daten Empfangen
case SR_PREV_ACK:
if (Rx_Idx == 0)
{ I2C_Command = TWDR;
switch(I2C_Command)
{
case I2C_CMD_VERSION:
I2C_TxBuffer = (unsigned char *)&I2C_Version;
I2C_TxBufferSize = sizeof(I2C_Version);
I2C_RxBufferSize = 0;
break;
case I2C_CMD_WRITE_EEPROM:
I2C_TxBufferSize = 0;
I2C_RxBuffer = (unsigned char *)&I2C_WriteEEPROM;
I2C_RxBufferSize = sizeof(I2C_WriteEEPROM);
break;
 
case I2C_CMD_WRITE_CAL:
I2C_TxBufferSize = 0;
I2C_RxBuffer = (unsigned char *)&I2C_WriteCal;
I2C_RxBufferSize = sizeof(I2C_WriteCal);
break;
 
case I2C_CMD_READ_EEPROM:
I2C_TxBuffer = (unsigned char *)&I2C_ReadEEPROM.Inhalt;
I2C_TxBufferSize = 2;
I2C_RxBuffer = (unsigned char *)&I2C_ReadEEPROM;
I2C_RxBufferSize = 1;
break;
case I2C_CMD_READ_MAG:
I2C_TxBuffer = (unsigned char *)&I2C_Mag;
I2C_TxBufferSize = sizeof(I2C_Mag);
I2C_RxBufferSize = 0;
I2C_Mag.MagX = MagnetN;
I2C_Mag.MagY = MagnetR;
I2C_Mag.MagZ = MagnetZ;
break;
case I2C_CMD_READ_HEADING:
I2C_TxBuffer = (unsigned char *)&I2C_Heading;
I2C_TxBufferSize = sizeof(I2C_Heading);
I2C_RxBuffer = (unsigned char *)&I2C_WriteNickRoll;
I2C_RxBufferSize = sizeof(I2C_WriteNickRoll);
I2C_Heading.Heading = Heading;
ExternData.Winkel[NICK] = I2C_WriteNickRoll.Nick;
ExternData.Winkel[ROLL] = I2C_WriteNickRoll.Roll;
break;
}
}
else
{
if ((Rx_Idx-1) < I2C_RxBufferSize) I2C_RxBuffer[Rx_Idx-1] = TWDR;
}
Rx_Idx++;
I2C_Timeout = 500;
//TWCR |= (1<<TWINT);
TWCR_ACK;
return;
// Daten Senden
case SW_SLA_ACK:
Tx_Idx = 0;
if (I2C_TxBufferSize > 0) TWDR = I2C_TxBuffer[Tx_Idx++];
// TWCR |= (1<<TWINT) | (1<< TWEA);
TWCR_ACK;
return;
// Daten Senden
case SW_DATA_ACK:
if (Tx_Idx < I2C_TxBufferSize) TWDR = I2C_TxBuffer[Tx_Idx++];
else TWDR = 0x00;
//TWCR |= (1<<TWINT) | (1<< TWEA);
TWCR_ACK;
return;
// Bus-Fehler zurücksetzen
case TWI_BUS_ERR_2:
TWCR |=(1<<TWSTO) | (1<<TWINT);
// Bus-Fehler zurücksetzen
case TWI_BUS_ERR_1:
TWCR |=(1<<TWSTO) | (1<<TWINT);
}
TWCR =(1<<TWEA) | (1<<TWINT) | (1<<TWEN) | (1<<TWIE); // TWI Reset
}
 
 
/tags/V0.14/timer0.c
New file
0,0 → 1,128
/*#######################################################################################
MK3Mag 3D-Magnet sensor
!!! THIS IS NOT FREE SOFTWARE !!!
#######################################################################################*/
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Copyright (c) 05.2008 Holger Buss
// + Thanks to Ilja Fähnrich (P_Latzhalter)
// + Nur für den privaten Gebrauch
// + www.MikroKopter.com
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur
// + mit unserer Zustimmung zulässig
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation),
// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist.
// + AUSNAHME: Ein bei www.mikrokopter.de erworbener vorbestückter MK3Mag darf als Baugruppe auch in kommerziellen Systemen verbaut werden
// + Im Zweifelsfall bitte anfragen bei: info@mikrokopter.de
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht,
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de"
// + eindeutig als Ursprung verlinkt werden
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion
// + Benutzung auf eigene Gefahr
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Redistributions of source code (with or without modifications) must retain the above copyright notice,
// + this list of conditions and the following disclaimer.
// + * PORTING this software (or parts of it) to systems (other than hardware from www.mikrokopter.de) is NOT allowed
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived
// + from this software without specific prior written permission.
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet
// + for non-commercial use (directly or indirectly)
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted
// + with our written permission
// + Exception: A preassembled MK3Mag, purchased from www.mikrokopter.de may be used as a part of commercial systems
// + In case of doubt please contact: info@MikroKopter.de
// + * If sources or documentations are redistributet on other webpages, our webpage (http://www.MikroKopter.de) must be
// + clearly linked as origin
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// + POSSIBILITY OF SUCH DAMAGE.
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#include "main.h"
volatile unsigned int CountMilliseconds = 0;
volatile unsigned char Timer0Overflow;
unsigned int I2C_Timeout = 0;
unsigned int SIO_Timeout = 0;
 
enum {
STOP = 0,
CK = 1,
CK8 = 2,
CK64 = 3,
CK256 = 4,
CK1024 = 5,
T0_FALLING_EDGE = 6,
T0_RISING_EDGE = 7
};
 
 
SIGNAL(SIG_OVERFLOW0)
{
static unsigned char cnt;
static unsigned int cmps_cnt;
TCNT0 -= 101; // reload
Timer0Overflow++;
 
if(++cmps_cnt == 380)
{
PORTB |= 0x04;
cmps_cnt = 0;
}
else
if(cmps_cnt == PwmHeading)
{
PORTB &= ~0x04;
}
if(!--cnt)
{
cnt = 10;
CountMilliseconds += 1;
if(I2C_Timeout) I2C_Timeout--;
if(SIO_Timeout) SIO_Timeout--;
}
}
 
 
void Timer0_Init(void)
{
TCCR0B = TIMER_TEILER; // Starten des Timers
// TCNT0 = 100; // reload
TIM0_START;
TIMER2_INT_ENABLE;
}
 
 
unsigned int SetDelay(unsigned int t)
{
return(CountMilliseconds + t - 1);
}
 
char CheckDelay (unsigned int t)
{
return(((t - CountMilliseconds) & 0x8000) >> 8);
}
 
void Delay_ms(unsigned int w)
{
unsigned int akt;
akt = SetDelay(w);
while (!CheckDelay(akt));
}
/tags/V0.14/analog.c
New file
0,0 → 1,83
/*#######################################################################################
MK3Mag 3D-Magnet sensor
!!! THIS IS NOT FREE SOFTWARE !!!
#######################################################################################*/
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Copyright (c) 05.2008 Holger Buss
// + Thanks to Ilja Fähnrich (P_Latzhalter)
// + Nur für den privaten Gebrauch
// + www.MikroKopter.com
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Die Portierung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur
// + mit unserer Zustimmung zulässig
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation),
// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist.
// + AUSNAHME: Ein bei www.mikrokopter.de erworbener vorbestückter MK3Mag darf als Baugruppe auch in kommerziellen Systemen verbaut werden
// + Im Zweifelsfall bitte anfragen bei: info@mikrokopter.de
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht,
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de"
// + eindeutig als Ursprung verlinkt werden
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion
// + Benutzung auf eigene Gefahr
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Redistributions of source code (with or without modifications) must retain the above copyright notice,
// + this list of conditions and the following disclaimer.
// + * PORTING this software (or parts of it) to systems (other than hardware from www.mikrokopter.de) is NOT allowed
// + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived
// + from this software without specific prior written permission.
// + * The use of this project (hardware, software, binary files, sources and documentation) is only permittet
// + for non-commercial use (directly or indirectly)
// + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted
// + with our written permission
// + Exception: A preassembled MK3Mag, purchased from www.mikrokopter.de may be used as a part of commercial systems
// + In case of doubt please contact: info@MikroKopter.de
// + * If sources or documentations are redistributet on other webpages, our webpage (http://www.MikroKopter.de) must be
// + clearly linked as origin
// + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// + POSSIBILITY OF SUCH DAMAGE.
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
#include "main.h"
 
//############################################################################
//Init ADC
void ADC_Init(void)
{
ADMUX = 0;
ADCSRA = 0x87;
ADMUX = 0;
ADCSRA |= 0x40; // Start Conversion
}
 
 
unsigned int MessAD(unsigned char channel)
{
unsigned int messwert = 0;
ADMUX = channel;
ADCSRA |= 0x10; // Clear Ready-Bit
ADCSRA |= 0x40; // Start Conversion
while (((ADCSRA & 0x10) == 0));
messwert = ADCW;
return(messwert);
}
 
 
 
/tags/V0.14/twislave.h
New file
0,0 → 1,86
#ifndef _TWI_SLAVE_H_
#define _TWI_SLAVE_H_
 
#define I2C_SLAVE_ADDRESS 0x50
 
#define I2C_CMD_VERSION 0x01
struct str_I2C_Version
{
unsigned char Hauptversion;
unsigned char Nebenversion;
unsigned char Comp;
} ;
 
#define I2C_CMD_WRITE_EEPROM 0x0A
#define I2C_CMD_READ_EEPROM 0x0B
struct str_I2C_EEPROM
{
unsigned char Adresse;
unsigned int Inhalt;
} ;
 
#define I2C_CMD_READ_MAG 0x02
struct str_I2C_Mag
{
int MagX;
int MagY;
int MagZ;
} ;
 
#define I2C_CMD_READ_HEADING 0x03
struct str_I2C_WriteNickRoll
{
int Nick;
int Roll;
} ;
 
#define I2C_CMD_WRITE_CAL 0x04
struct str_I2C_WriteCal
{
unsigned char CalByte;
unsigned char Dummy1;
unsigned char Dummy2;
} ;
 
struct str_I2C_Heading
{
unsigned int Heading;
} ;
 
 
extern unsigned char Tx_Idx, Rx_Idx, I2C_Direction;
 
extern struct str_I2C_Heading I2C_Heading;
extern struct str_I2C_WriteNickRoll I2C_WriteNickRoll;
extern struct str_I2C_Mag I2C_Mag;
extern struct str_I2C_EEPROM I2C_ReadEEPROM, I2C_WriteEEPROM;
extern struct str_I2C_Version I2C_Version;
extern struct str_I2C_WriteCal I2C_WriteCal;
 
 
extern void InitIC2_Slave (void);
 
#define TWI_BUS_ERR_1 0x00
#define TWI_BUS_ERR_2 0xF8
 
// Status Slave RX Mode
#define SR_SLA_ACK 0x60
#define SR_LOST_ACK 0x68
#define SR_GEN_CALL_ACK 0x70
#define GEN_LOST_ACK 0x78
#define SR_PREV_ACK 0x80
#define SR_PREV_NACK 0x88
#define GEN_PREV_ACK 0x90
#define GEN_PREV_NACK 0x98
#define STOP_CONDITION 0xA0
#define REPEATED_START 0xA0
 
// Status Slave TX mode
#define SW_SLA_ACK 0xA8
#define SW_LOST_ACK 0xB0
#define SW_DATA_ACK 0xB8
#define SW_DATA_NACK 0xC0
#define SW_LAST_ACK 0xC8
 
#endif
 
/tags/V0.14/Hex-Files/MK3Mag_MEGA168_V0_14.hex
New file
0,0 → 1,489
:100000000C945A000C9475000C9475000C947500B7
:100010000C9475000C9475000C9475000C9475008C
:100020000C9475000C9475000C9475000C9475007C
:100030000C9475000C9475000C9475000C9475006C
:100040000C9491090C9475000C94D6060C947500D0
:100050000C9406060C9475000C9475000C947500B5
:100060000C94520A0C947500083B3BD74ABC846E32
:10007000023D2FC1FEBD9A31743DDA3D83BE117F32
:10008000C73E4CBBE5BEAAAA6C3F80000000082911
:10009000573F9F2D49CBA5310F76C73493F27E375A
:1000A000D00D013AB60B613D2AAAAB3F0000003FDC
:1000B0008000000011241FBECFEFD4E0DEBFCDBF13
:1000C00013E0A0E0B1E0E6E6FCE102C005900D928D
:1000D000A230B107D9F714E0A2E0B3E001C01D924D
:1000E000AF39B107E1F70C9431050C94000096B5D7
:1000F000980F86B5891B87FDFCCF08954F925F92BC
:100100006F927F928F929F92AF92BF92CF92DF9227
:10011000EF92FF920F931F93CF93DF938091410350
:10012000909142032091330330913403821B930B4F
:100130002091350330913603280F391F37FF02C055
:100140002F5F3F4FF901F595E795F0933603E09364
:1001500035038091390390913A0320913103309116
:100160003203821B930B2091490330914A03280FDD
:10017000391F37FF02C02F5F3F4F390175946794D5
:1001800070924A036092490380914B0390914C0313
:1001900020914D0330914E03821B930B20913D0320
:1001A00030913E03280F391F37FF02C02F5F3F4FAA
:1001B00029015594479450923E0340923D0360912B
:1001C00010037091110320910E0330910F03CB01A6
:1001D000820F931F97FD0196AC015595479550935B
:1001E000400340933F03A0900C03B0900D03C091D7
:1001F0000A03D0910B03C5018C0F9D1F97FD01963B
:100200006C01D594C794D0923C03C0923B0380907C
:10021000080390900903E0900603F0900703C401DF
:100220008E0D9F1D97FD01968C01159507951093D6
:10023000380300933703CF01841B950BAA2797FD42
:10024000A095BA2F4AE0880F991FAA1FBB1F4A9595
:10025000D1F7261B370B442737FD4095542FBC019F
:10026000CD010E94D80D3093460320934503C3016E
:100270008C199D09AA2797FDA095BA2F3AE0880FFF
:10028000991FAA1FBB1F3A95D1F7CA19DB099E0116
:10029000442737FD4095542FBC01CD010E94D80D55
:1002A0003093480320934703C201801B910BAA2778
:1002B00097FDA095BA2F2AE0880F991FAA1FBB1F90
:1002C0002A95D1F7E818F9089701442737FD40959A
:1002D000542FBC01CD010E94D80D309344032093CC
:1002E0004303DF91CF911F910F91FF90EF90DF902B
:1002F000CF90BF90AF909F908F907F906F905F90C6
:100300004F9008952F923F924F925F926F927F92FB
:100310008F929F92AF92BF92CF92DF92EF92FF9215
:100320000F931F93CF93DF93CDB7DEB72E970FB602
:10033000F894DEBF0FBECDBF80913204909133049C
:10034000AA2797FDA095BA2FBC01CD010E945E0C93
:10035000DC01CB012BED3FE049E450E4BC01CD01D1
:100360000E94740DDC01CB0120E030E041EE54E44A
:10037000BC01CD010E94FB0B5B016C018091340438
:1003800090913504AA2797FDA095BA2FBC01CD0105
:100390000E945E0CDC01CB012BED3FE049E450E410
:1003A000BC01CD010E94740DDC01CB0120E030E0E6
:1003B00041EE54E4BC01CD010E94FB0B69837A83BA
:1003C0008B839C838090450390904603C401AA27A9
:1003D00097FDA095BA2FBC01CD010E945E0C7B0158
:1003E0008C018091470390914803AA2797FDA0951F
:1003F000BA2FBC01CD010E945E0C6D837E838F837A
:1004000098878091430390914403AA2797FDA09574
:10041000BA2FBC01CD010E945E0C69877A878B8759
:100420009C87809139048130A1F4ED80FE800F819A
:1004300018858827992788199909AA2797FDA095D3
:10044000BA2FBC01CD010E945E0C6D837E838F8329
:100450009887C601B5010E94F50BDC01CB019C0118
:10046000AD01C801B7010E94740D3B014C01C601EA
:10047000B5010E94BC0D5B016C019B01AC016D815B
:100480007E818F8198850E94740D7B018C0169812A
:100490007A818B819C810E94BC0D1B012C019B01E8
:1004A000AC01C801B7010E94740DDC01CB019C01B5
:1004B000AD01C401B3010E94840B3B014C01A601B4
:1004C000950169857A858B859C850E94740D7B01D9
:1004D0008C0169817A818B819C810E94F50B5B0183
:1004E0006C019B01AC01C801B7010E94740DDC01D5
:1004F000CB019C01AD01C401B3010E94830B3B0100
:100500004C01A60195016D817E818F8198850E94A5
:10051000740D7B018C01A201910169857A858B851F
:100520009C850E94740DDC01CB019C01AD01C801CA
:10053000B7010E94840B7B018C0120E030E040E099
:1005400050E0C401B3010E947B0C882369F420E0D1
:1005500030E040E050E0C801B7010E947B0C8823E6
:100560001CF48AE590E0C8C020E030E040E050E0B4
:10057000C401B3010E947B0C882379F420E030E0B1
:1005800040E050E0C801B7010E947E0C18162CF420
:10059000EEE0F1E0FE87ED87B1C020E030E040E022
:1005A00050E0C401B3010E947B0C88234CF5A401E8
:1005B0009301C801B7010E94FB0BDC01CB01BC0118
:1005C000CD010E94C60BDC01CB0120E030E044E30A
:1005D00053E4BC01CD010E94740DDC01CB012BED75
:1005E0003FE049E450E4BC01CD010E94FB0BDC017B
:1005F000CB019C01AD0160E070E084E393E472C044
:1006000020E030E040E050E0C401B3010E947E0CE5
:1006100018165CF520E030E040E050E0C801B7017A
:100620000E947B0C88230CF5A4019301C801B7013B
:100630000E94FB0BDC01CB01BC01CD010E94C60B6B
:10064000DC01CB0120E030E044E353ECBC01CD0100
:100650000E94740DDC01CB012BED3FE049E450E436
:10066000BC01CD010E94FB0B3FC020E030E040E028
:1006700050E0C401B3010E947E0C18160CF03EC07D
:1006800020E030E040E050E0C801B7010E947E0C5D
:100690001816A4F5A4019301C801B7010E94FB0B31
:1006A000DC01CB01BC01CD010E94C60BDC01CB01FA
:1006B00020E030E044E353E4BC01CD010E94740D1E
:1006C000DC01CB012BED3FE049E450E4BC01CD015E
:1006D0000E94FB0BDC01CB019C01AD0160E070E0EE
:1006E00084EB93E40E94830BDC01CB01BC01CD01C0
:1006F0000E94410CDC01CB019E878D878D859E85F4
:1007000088599E4F815D924030F48D859E859093EF
:10071000500380934F0380914F03909150030A96AA
:1007200090930503809304032E960FB6F894DEBFD2
:100730000FBECDBFDF91CF911F910F91FF90EF9032
:10074000DF90CF90BF90AF909F908F907F906F90F1
:100750005F904F903F902F9008958091810488235F
:1007600011F48091380499278230910599F18330F2
:1007700091052CF4009779F0019779F00895843071
:10078000910509F460C0843091050CF45AC00597B6
:1007900009F476C008955F9A089520E137E2309316
:1007A00011032093100380EF98ED90930F03809333
:1007B0000E0330930D0320930C0390930B0380934F
:1007C0000A0330930903209308039093070380934F
:1007D000060337C05F9A209135033091360380912C
:1007E0001003909111032817390724F43093110353
:1007F0002093100380910E0390910F0382179307AB
:1008000024F430930F0320930E0320914903309179
:100810004A0380910C0390910D032817390724F4A3
:1008200030930D0320930C0380910A0390910B03E6
:10083000821793070CF086C030930B0320930A03B2
:1008400008955F9808955F9A20913D0330913E038B
:1008500080910803909109032817390724F43093F5
:1008600009032093080380910603909107038217E0
:1008700093070CF067C03093070320930603089595
:100880005F9880910E0390910F0340911003509157
:100890001103841B950B873991050CF452C080918C
:1008A0000A0390910B0320910C0330910D03821BDE
:1008B000930B873991050CF444C080910603909105
:1008C00007032091080330910903821B930B87399A
:1008D00091050CF436C0AAE0B0E00A010E941A0E9D
:1008E000A8E0B0E080910E0390910F030C010E94EC
:1008F0001A0EA6E0B0E080910C0390910D030C015C
:100900000E941A0EA4E0B0E080910A0390910B03BC
:100910000C010E941A0EA2E0B0E0809108039091B1
:1009200009030C010E941A0EA0E0B0E080910603BA
:10093000909107030C010E941A0E80ED97E00E942F
:10094000110A5F9A08958091450390914603909310
:100950003D0480933C048091470390914803909319
:100960003F0480933E04809143039091440390930D
:100970004104809340048091350390913603909315
:100980004304809342048091490390914A039093D9
:1009900045048093440480913D0390913E039093DD
:1009A00047048093460480913204909133049093DD
:1009B00049048093480480913404909135049093C5
:1009C0004B0480934A0480911003909111039093FB
:1009D0004D0480934C0480910E0390910F039093EB
:1009E0004F0480934E0480910C0390910D039093DB
:1009F00051048093500480910A0390910B039093CB
:100A000053048093520480910803909109039093BA
:100A100055048093540480910603909107039093AA
:100A20005704809356048091380499279093590471
:100A30008093580480914F039091500390935B04EE
:100A400080935A0480913604992790935D04809393
:100A50005C0480913704992790935F0480935E042F
:100A60000895CFEFD4E0DEBFCDBF88E087B988B965
:100A700084EF8AB980EA8BB984E084B985E385B9CB
:100A80005F9A0E945B080E94F0090E941E0A0E9461
:100A9000400A789484E690E00E94FD099093B703A1
:100AA0008093B603AAE0B0E00E94150EF093110304
:100AB000E0931003A8E0B0E00E94150EF0930F033E
:100AC000E0930E03A6E0B0E00E94150EF0930D0334
:100AD000E0930C03A4E0B0E00E94150EF0930B032A
:100AE000E0930A03A2E0B0E00E94150EF093090320
:100AF000E0930803A0E0B0E00E94150EF093070316
:100B0000E09306031092B9038EE08093BA0387E066
:100B10008093BB0310923904109238041092810420
:100B20008BB18F798BB982E090E00E94110A80E04E
:100B30000E942B0A909342038093410381E00E941C
:100B40002B0A909581959F4F90934C0380934B0374
:100B500087E00E942B0A90933A038093390381E047
:100B600090E00E94110A8BB180668BB982E090E020
:100B70000E94110A80E00E942B0A90933403809314
:100B8000330381E00E942B0A909581959F4F9093AB
:100B90004E0380934D0387E00E942B0A909332030B
:100BA0008093310381E090E00E94110A0E947E0050
:100BB00080913804882321F480918104882319F0DE
:100BC0000E94AD0302C00E9482010E94970880919A
:100BD000020390910303892B91F0519A8091C100F7
:100BE00088608093C1000E94260980910203909141
:100BF00003030197909303038093020391CF8091A5
:100C0000C100877F8093C10051988ACF1F920F92B5
:100C10000FB60F9211248F939F93EF93FF938091C0
:100C200000038823E1F480911E0390911F03019635
:100C300090931F0380931E03FC01EE5AFC4FE0814A
:100C4000ED3019F08436910539F410921F0310929B
:100C50001E0381E080930003E093C60004C010925D
:100C60001F0310921E03FF91EF919F918F910F90A0
:100C70000FBE0F901F9018958091C00086FF29C06D
:100C800080910003882309F580912003909121032E
:100C900001969093210380932003FC01EE5AFC4FB0
:100CA000E081ED3019F08436910539F4109221037A
:100CB0001092200381E0809300038091C000816046
:100CC0008093C000E093C600089510922103109213
:100CD000200308951F93CF93DF93EC0110E0662368
:100CE00009F460C0A22FBB271297E42FFF27E2531D
:100CF000FC4F30813D534F5FE42FFF27E253FC4F01
:100D000050815D534F5FE42FFF27E253FC4F70810A
:100D10007D534F5FE42FFF27E253FC4FE081ED53FB
:100D20004F5F842F9927A817B907E4F1832F9927DC
:100D3000880F991F880F991F352F32953F70382BD8
:100D4000852F99278F70907054E0880F991F5A95BE
:100D5000E1F7572F56955695582B872F9927837073
:100D6000907026E0880F991F2A95E1F78E2B61502D
:100D70006F3FC1F0FE01E10FF11D30831F5F615035
:100D80006F3F81F0FE01E10FF11D50831F5F615045
:100D90006F3F41F0FE01E10FF11D80831F5F66236D
:100DA00009F0A3CFDF91CF911F9108951F920F9269
:100DB0000FB60F9211242F933F934F935F938F930E
:100DC0009F93AF93BF93CF93DF93EF93FF93809164
:100DD000C60080931C0340912603443610F0109205
:100DE000270350911C035D3009F04DC0809127030B
:100DF000823009F048C010922703A42FBB27A253CA
:100E0000BC4FFD0132978081209122033091230352
:100E1000281B3109ED0121978881281B3109C9015F
:100E20009F709093230380932203689415F89695FE
:100E300087951694E1F7982F935C909324032F7372
:100E40003070235C209325038081981709F06AC0D5
:100E50008881281709F066C081E080931B034093C6
:100E600012035C938091D003823509F05BC088E166
:100E700090E02CE00FB6F894A895809360000FBE28
:100E8000209360004FC020912703822F9927813043
:100E90009105F9F0823091051CF4892B21F040C0B6
:100EA000029711F13DC080911C03833239F4809187
:100EB0001B03882319F481E08093270380911C038E
:100EC0008093CE0381E08093260380911C039927B1
:100ED00022C02F5F20932703E42FFF27E253FC4F0C
:100EE00080911C03808309C0E42FFF27E253FC4F4D
:100EF00080911C038083443620F44F5F4093260387
:100F000002C01092270320911C038091220390912C
:100F10002303820F911D909323038093220302C029
:100F200010922703FF91EF91DF91CF91BF91AF9185
:100F30009F918F915F914F913F912F910F900FBE95
:100F40000F901F901895AC01A0E0B0E09D01A8178C
:100F5000B90748F4E2E5F3E08191280F311D1196BD
:100F6000A417B507C8F33F70FD01EE5AFC4FC90145
:100F700076E0969587957A95E1F7835C8083119664
:100F8000FD01EE5AFC4F2F733070822F835C8083FB
:100F9000AD5ABC4F8DE08C931092000380915203A8
:100FA0008093C60008951F93CF93DF93382FEA01F3
:100FB000722F10E083E280935203609353033093C7
:100FC0005403A3E0B0E0772309F458C0772311F469
:100FD000972F07C0FE01E10FF11D1F5F9081715037
:100FE00011F4472F0EC0FE01E10FF11D1F5F40817C
:100FF000715039F0FE01E10FF11D1F5F60817150EA
:1010000001C0672FFD01EE5AFC4F892F869586950A
:10101000835C80831196FD01EE5AFC4F892F99273E
:101020008370907024E0880F991F2A95E1F7552767
:101030009A0194E0369527959A95E1F7822B835C87
:1010400080831196FD01EE5AFC4F4F705070440F93
:10105000551F440F551F862F992726E09695879593
:101060002A95E1F7842B835C80831196FD01EE5A6B
:10107000FC4F6F73635C60831196A5CFCD010E9416
:10108000A307DF91CF911F910895CF93C82F80912F
:10109000C10083FF0BC0CA3019F48DE00E944508DF
:1010A0008091C00085FFFCCFC093C60080E090E037
:1010B000CF910895089588E18093C1008091C00088
:1010C00082608093C0008091C10080688093C100DD
:1010D0008091C10080648093C10080E18093C4004E
:1010E00088EC90E00E94FD099093B7038093B603CB
:1010F0008AE00E94450883E40E94450880E50E943A
:1011000045088AE30E94450886E50E94450880E379
:101110000E9445088EE20E94450881E30E9445082E
:1011200084E30E9445088AE00E9445080895CF9311
:10113000DF93CDB7DEB722970FB6F894DEBF0FBEB0
:10114000CDBF80911B03882309F477C08FEF809374
:10115000B8038091D00399278736910509F45BC0C5
:10116000883691056CF48136910509F448C08136C2
:1011700091050CF460C0843691050CF05CC024C06D
:1011800086379105C1F1873791052CF48836910592
:1011900009F44BC050C08737910509F04CC020912D
:1011A000120343E068E082E394E00E946A068091C3
:1011B0005A0490915B04019690935B0480935A04C7
:1011C00081E08093170337C02091120343E06BE066
:1011D00083EC93E00E946A068091CB039927909359
:1011E0003304809332048091CC0399279093350483
:1011F0008093340420C081E080931A0316C02091AC
:10120000120343E062E0CE0101960E946A068981E2
:10121000809319030AC08FEF90E0909303038093AB
:10122000020381E08093180306C08FEF90E0909353
:1012300003038093020310921B0322960FB6F894C7
:10124000DEBF0FBECDBFDF91CF9108958091B60371
:101250009091B7030E94060A8823B1F080910003A1
:10126000882391F00E94A30422E44AE354E06091B1
:10127000510384E40E94D3078AEF90E00E94FD09A5
:101280009093B7038093B60380911A03882371F07B
:1012900080910003882351F02AE049EB53E06091EC
:1012A000510386E50E94D30710921A036091190337
:1012B0006F3F91F0862F992734E0880F991F3A9558
:1012C000E1F780509F4F605D20E1AC0181E40E9416
:1012D000D3078FEF8093190380911803882371F04F
:1012E00080910003882351F02BE043EC53E06091A0
:1012F000510387E40E94D3071092180380911703CB
:10130000882371F080910003882351F022E04AE89D
:1013100054E0609151038BE40E94D30710921703AD
:1013200008951F920F920FB60F9211242F933F939F
:101330008F939F9386B5855686BD80917C048F5F81
:1013400080937C0420912F03309130032F5F3F4F17
:101350003093300320932F0381E02C37380731F48A
:101360002A9A1092300310922F0308C08091040330
:10137000909105032817390709F42A9880912E03C4
:10138000815080932E03882311F58AE080932E03E9
:1013900080912C0390912D03019690932D038093BF
:1013A0002C0380912A0390912B03009729F0019739
:1013B00090932B0380932A03809128039091290313
:1013C000009729F0019790932903809328039F9118
:1013D0008F913F912F910F900FBE0F901F901895F6
:1013E00082E085BD80916E00816080936E00809167
:1013F0006E00806480936E00089520912C033091DC
:101400002D03280F391FC9010197089520912C033E
:1014100030912D03821B930B892F99278078992770
:101420000895CF93DF930E94FD09EC01CE010E9445
:10143000060A8823D9F3DF91CF91089510927C009A
:1014400087E880937A0010927C0080917A00806413
:1014500080937A00089580937C0080917A00806167
:1014600080937A0080917A00806480937A008091E2
:101470007A0084FFFCCF80917800909179000895E4
:1014800080E58093BA0085EC8093BC008091B9031D
:10149000809392048091BA038093930481E08093B7
:1014A000940408951F920F920FB60F9211242F9358
:1014B0003F934F935F938F939F93EF93FF9380910D
:1014C000B9009927887F907080389105F1F08138B4
:1014D00091053CF4009709F401C18036910591F023
:1014E00002C1883B910509F4DEC0893B91052CF4CB
:1014F000883A910509F4C9C0F6C0883F910509F4FE
:10150000E8C0F1C010929E04EEC020919E042223F8
:1015100009F09AC08091BB0080938404992783309E
:10152000910509F466C08430910534F48130910549
:1015300079F00297D1F19DC08A309105A9F08B30E6
:1015400091051CF40497A9F094C00B97E1F091C0A9
:1015500082E994E09093800480937F0483E08093F9
:101560009D042093950485C020939D048CE894E00D
:1015700004C020939D0481E894E090937E048093BE
:101580007D0483E00FC080E994E090938004809311
:101590007F0422E020939D04019790937E04809322
:1015A0007D0481E08093950464C086E994E0909383
:1015B000800480937F0486E080939D0420939504AB
:1015C00080914503909146039093970480939604ED
:1015D00080914703909148039093990480939804D5
:1015E000809143039091440390939B0480939A04C9
:1015F00040C08AE894E09093800480937F0482E066
:1016000080939D0485E894E090937E0480937D040C
:1016100084E08093950480914F03909150039093C0
:101620008B0480938A048091850490918604909322
:1016300033048093320480918704909188049093BE
:1016400035048093340415C0422F55279A01215048
:1016500030408091950499272817390754F4E09178
:101660007D04F0917E04E40FF51F31978091BB005B
:10167000808380919E048F5F80939E0484EF91E02D
:1016800090932B0380932A032EC010929C04809188
:101690009D04882341F1E0917F04F091800481E072
:1016A00080939C040FC090919C0480919D04981796
:1016B00068F4E0917F04F0918004E90FF11D9F5FD1
:1016C00090939C0480818093BB000DC01092BB005E
:1016D0000AC08091BC0080698093BC008091BC00EE
:1016E00080698093BC0085EC8093BC00FF91EF91F2
:1016F0009F918F915F914F913F912F910F900FBECE
:101700000F901F9018955058192E90D101D040C1BC
:10171000BA176207730784079507B1F188F40EF4CE
:1017200010940B2EBA2FA02D062E622F202D072EDF
:10173000732F302D082E842F402D092E952F502DDC
:10174000FF275523B9F0591B49F0573E98F04695AD
:1017500037952795A795F0405395C9F776F0BA0FBE
:10176000621F731F841F30F4879577956795B7952F
:10177000F040939517FA0F2E0895BF1BBB27BA0BA5
:10178000620B730B840BF6CFDEF67CC11F930F93B5
:101790000027192F10789F775FE340E861307105CB
:1017A0008407950718F000680E94BB0C912B6F937B
:1017B0007F938F939F930E94CF0DE8E6F0E003D1D3
:1017C0005F914F913F912F910E94740D002351F032
:1017D0002BED3FE049EC5FE300E8902717FD5068F0
:1017E0000E94840B0F911F91089550E449EC3FE053
:1017F0002BED6ED0A2C01AD101D0CAC0552359F02A
:10180000992369F09F575F57951B33F442F4903842
:1018100011F4915805C0D4C091589F3F09F432C1CA
:10182000BB27112462177307840730F4660F771FF4
:10183000881FBB1F915098F311D00F920FD00F92B9
:101840000DD0A0E82617370748071B0609F0A04867
:10185000BA2F602D7F918F9100240895A0E8002475
:10186000621773078407B10528F0621B730B840BA2
:10187000B1090A2A660F771F881FBB1FA69581F73B
:10188000089597FBDFD09F3738F0FEE9F91B982FBA
:10189000872F762F6B2F05C0F2C096958795779589
:1018A0006795F150D0F73EF49095809570956195CD
:1018B0007F4F8F4F9F4F0895E89403C097FB0EF41E
:1018C000F3DFB62F672F782F892F9EE9002460C0A1
:1018D0005F77552319F444230AF072C02F933F9386
:1018E0004F935F9388DF55274427CED05F914F9168
:1018F0003F912F91F9C00ED05EF004C00BD026F0BE
:1019000001C008D019F020F48FEF089580E0089509
:1019100081E0089597FB092E052600F8689489D088
:10192000E89407FC07C0621773078407950721F046
:1019300008F400940794989408951F939F7750ECAF
:1019400049E43FE02BEDE0DE10E89F775FE349ECF0
:101950003FE02BED621773078407950720F050ECEA
:1019600049E4D2DE11271BD19068EEE8F0E02BD0DD
:1019700091271F9108959B01AC019FE380E8772791
:1019800066270C94FB0B9A95BB0F661F771F881F69
:1019900011249923A1F08823B2F79F3F59F0BB0F80
:1019A00048F421F4002011F460FF04C06F5F7F4F02
:1019B0008F4F9F4F881F9795879597F908955FC020
:1019C0009FEF80EC0895FF92EF92DF92CF92BF924B
:1019D0006B017C01B59016D0B590BB2069F09F9348
:1019E0008F937F936F93B601C7010CD02F913F91D6
:1019F0004F915F910E94FB0BBF90CF90DF90EF90D3
:101A0000FF900895D0D002C09601A701EF93FF93F5
:101A10000E94740DFF91EF91C6D0EF93FF930E9447
:101A2000840BFF91EF91BA9479F70895052E09265A
:101A300007FA440F551F5F3F79F0AA27A51708F052
:101A400051E04795880F991F9F3F31F0BB27B91789
:101A500008F091E0879508959F919F911124B0CF50
:101A600097FB880F991F9F3F31F0BB27B91708F0EC
:101A700091E0879508959F919F911124A1CF6627AA
:101A80007727882799270895EBDFCF93DF93D52F0A
:101A9000C42F55274427332722279923D9F09F376E
:101AA000C8F0F92F75DF592F482F372F262FF63919
:101AB00068F4E7DE03DFC030CD0721F06993799346
:101AC000899399939058DF91CF911ECE99278827BB
:101AD00077276627C030CD0721F0299339934993A2
:101AE0005993DF91CF9154CFA1DF01D051CF9923EA
:101AF00039F0552329F09F575F57950F13F49AF14A
:101B0000C1CF91589F3FE1F3629FA12D0F92BB2758
:101B1000639FA00DB11DEE27729FA00DB11DEE1F9A
:101B2000AF93AA27649FB00DE11D739FB00DE11D17
:101B3000AA1F6627829FB00DE11DA61F5527749F1F
:101B4000E00DA11D551F839FE00DA11D561F849F11
:101B5000A00D511D852F7A2F6E2F1F900F90882377
:101B60001AF4939539F42CCF000C111CBB1F661F7F
:101B7000771F881F012808959F939F77993358F006
:101B800050E449EC3FE02BEDA3DE5FEB49EC3FE096
:101B90002BEDBADDD2DE5F915078952708959B0139
:101BA000AC010C94740D5591459135912591089592
:101BB00097FB092E05260ED057FD04D014D00AD06D
:101BC000001C38F450954095309521953F4F4F4F6C
:101BD0005F4F0895F6F790958095709561957F4FCA
:101BE0008F4F9F4F0895A1E21A2EAA1BBB1BFD0128
:101BF0000DC0AA1FBB1FEE1FFF1FA217B307E407EC
:101C0000F50720F0A21BB30BE40BF50B661F771F43
:101C1000881F991F1A9469F7609570958095909523
:101C20009B01AC01BD01CF01089509D0E02D07D083
:101C3000F02D08950CD0012C0AD011240895F999A3
:101C4000FECFB2BDA1BDF89A119600B40895F999DE
:101C5000FECFB2BDA1BD00BC11960FB6F894FA9AA2
:061C6000F99A0FBE089581
:101C66004D61676E6574204E2020202020202020A4
:101C76004D61676E65742052202020202020202090
:101C86004D61676E6574205A202020202020202078
:101C9600526177202020204E202020202020202046
:101CA6005261772020202052202020202020202032
:101CB600526177202020205A20202020202020201A
:101CC6004C616765204E20202020202020202020E7
:101CD6004C616765205220202020202020202020D3
:101CE600586D696E202020202020202020202020D2
:101CF600586D6178202020202020202020202020C0
:101D0600596D696E202020202020202020202020B0
:101D1600596D61782020202020202020202020209E
:101D26005A6D696E2020202020202020202020208F
:101D36005A4D61782020202020202020202020209D
:101D460043616C737461746520202020202020205C
:101D56004B6F6D706173732020202020202020207F
:101D6600557365723020202020202020202020203E
:101D7600557365723120202020202020202020202D
:101D8600416E616C6F673138202020202020202092
:101D9600416E616C6F673139202020202020202081
:101DA600416E616C6F673230202020202020202079
:101DB600416E616C6F673231202020202020202068
:101DC600416E616C6F673232202020202020202057
:101DD600416E616C6F673233202020202020202046
:101DE600416E616C6F673234202020202020202035
:101DF600416E616C6F673235202020202020202024
:101E0600416E616C6F673236202020202020202012
:101E1600416E616C6F673237202020202020202001
:101E2600416E616C6F6732382020202020202020F0
:101E3600416E616C6F6732392020202020202020DF
:101E4600416E616C6F6733302020202020202020D7
:101E5600416E616C6F6733312020202020202020C6
:021E6600010079
:00000001FF
/tags/V0.14/main.lss
New file
0,0 → 1,4534
 
main.elf: file format elf32-avr
 
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00001bec 00000000 00000000 00000094 2**0
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 00000024 00800060 00001bec 00001c80 2**0
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000156 00800084 00800084 00001ca4 2**0
ALLOC
3 .noinit 00000000 008001da 008001da 00001ca4 2**0
CONTENTS
4 .eeprom 00000000 00810000 00810000 00001ca4 2**0
CONTENTS
5 .stab 0000036c 00000000 00000000 00001ca4 2**2
CONTENTS, READONLY, DEBUGGING
6 .stabstr 00000084 00000000 00000000 00002010 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_aranges 000000b4 00000000 00000000 00002094 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_pubnames 000006f5 00000000 00000000 00002148 2**0
CONTENTS, READONLY, DEBUGGING
9 .debug_info 00001a41 00000000 00000000 0000283d 2**0
CONTENTS, READONLY, DEBUGGING
10 .debug_abbrev 00000774 00000000 00000000 0000427e 2**0
CONTENTS, READONLY, DEBUGGING
11 .debug_line 0000169d 00000000 00000000 000049f2 2**0
CONTENTS, READONLY, DEBUGGING
12 .debug_str 00000874 00000000 00000000 0000608f 2**0
CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:
 
00000000 <__vectors>:
0: 0c 94 85 00 jmp 0x10a <__init>
4: 0c 94 7e 0b jmp 0x16fc <__vector_1>
8: 0c 94 a0 00 jmp 0x140 <__bad_interrupt>
c: 0c 94 a0 00 jmp 0x140 <__bad_interrupt>
10: 0c 94 a0 00 jmp 0x140 <__bad_interrupt>
14: 0c 94 a0 00 jmp 0x140 <__bad_interrupt>
18: 0c 94 a0 00 jmp 0x140 <__bad_interrupt>
1c: 0c 94 a0 00 jmp 0x140 <__bad_interrupt>
20: 0c 94 a0 00 jmp 0x140 <__bad_interrupt>
24: 0c 94 67 09 jmp 0x12ce <__vector_9>
28: 0c 94 a0 00 jmp 0x140 <__bad_interrupt>
2c: 0c 94 96 0b jmp 0x172c <__vector_11>
30: 0c 94 a0 00 jmp 0x140 <__bad_interrupt>
34: 0c 94 18 02 jmp 0x430 <__vector_13>
38: 0c 94 a0 00 jmp 0x140 <__bad_interrupt>
3c: 0c 94 e3 01 jmp 0x3c6 <__vector_15>
40: 0c 94 a0 00 jmp 0x140 <__bad_interrupt>
44: 0c 94 a0 00 jmp 0x140 <__bad_interrupt>
48: 0c 94 a0 00 jmp 0x140 <__bad_interrupt>
4c: 0c 94 a0 00 jmp 0x140 <__bad_interrupt>
50: 0c 94 a0 00 jmp 0x140 <__bad_interrupt>
 
00000054 <__ctors_end>:
54: 20 2d mov r18, r0
56: 2d 20 and r2, r13
58: 52 65 ori r21, 0x52 ; 82
5a: 6d 6f ori r22, 0xFD ; 253
5c: 74 65 ori r23, 0x54 ; 84
5e: 20 20 and r2, r0
60: 2d 2d mov r18, r13
62: 20 20 and r2, r0
64: 20 20 and r2, r0
66: 20 20 and r2, r0
...
 
00000069 <__c.1>:
69: 20 2d 2d 20 44 69 73 70 6c 61 79 20 2d 2d 20 20 -- Display --
79: 20 20 20 20 00 .
 
0000007e <__c.2>:
7e: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
8e: 20 20 20 20 00 .
 
00000093 <__c.3>:
93: 20 20 77 77 77 2e 4d 69 63 72 6f 53 50 53 2e 63 www.MicroSPS.c
a3: 6f 6d 20 20 00 om .
 
000000a8 <__c.2>:
a8: 25 73 00 %s.
 
000000ab <__c.3>:
ab: 25 73 00 %s.
 
000000ae <__c.4>:
ae: 25 73 00 %s.
 
000000b1 <__c.5>:
b1: 25 73 00 %s.
 
000000b4 <__c.3>:
b4: 56 65 72 62 69 6e 64 65 6e 20 6d 69 74 00 Verbinden mit.
 
000000c2 <__c.4>:
c2: 4d 69 63 72 6f 53 50 53 3a 25 32 69 20 00 MicroSPS:%2i .
 
000000d0 <__c.5>:
d0: 4d 61 78 20 41 64 72 65 73 73 65 00 Max Adresse.
 
000000dc <__c.6>:
dc: 25 32 69 20 00 %2i .
 
000000e1 <__c.7>:
e1: 43 68 65 63 6b 73 75 6d 00 Checksum.
 
000000ea <__c.8>:
ea: 45 72 72 6f 72 73 3a 25 35 69 20 00 Errors:%5i .
 
000000f6 <__c.9>:
f6: 44 69 73 70 6c 61 79 00 Display.
 
000000fe <__c.10>:
fe: 5a 65 69 6c 65 6e 3a 25 31 69 20 00 Zeilen:%1i .
 
0000010a <__init>:
10a: 11 24 eor r1, r1
10c: 1f be out 0x3f, r1 ; 63
10e: cf e5 ldi r28, 0x5F ; 95
110: d8 e0 ldi r29, 0x08 ; 8
112: de bf out 0x3e, r29 ; 62
114: cd bf out 0x3d, r28 ; 61
 
00000116 <__do_copy_data>:
116: 10 e0 ldi r17, 0x00 ; 0
118: a0 e6 ldi r26, 0x60 ; 96
11a: b0 e0 ldi r27, 0x00 ; 0
11c: ec ee ldi r30, 0xEC ; 236
11e: fb e1 ldi r31, 0x1B ; 27
120: 02 c0 rjmp .+4 ; 0x126 <.do_copy_data_start>
 
00000122 <.do_copy_data_loop>:
122: 05 90 lpm r0, Z+
124: 0d 92 st X+, r0
 
00000126 <.do_copy_data_start>:
126: a4 38 cpi r26, 0x84 ; 132
128: b1 07 cpc r27, r17
12a: d9 f7 brne .-10 ; 0x122 <.do_copy_data_loop>
 
0000012c <__do_clear_bss>:
12c: 11 e0 ldi r17, 0x01 ; 1
12e: a4 e8 ldi r26, 0x84 ; 132
130: b0 e0 ldi r27, 0x00 ; 0
132: 01 c0 rjmp .+2 ; 0x136 <.do_clear_bss_start>
 
00000134 <.do_clear_bss_loop>:
134: 1d 92 st X+, r1
 
00000136 <.do_clear_bss_start>:
136: aa 3d cpi r26, 0xDA ; 218
138: b1 07 cpc r27, r17
13a: e1 f7 brne .-8 ; 0x134 <.do_clear_bss_loop>
13c: 0c 94 e5 00 jmp 0x1ca <main>
 
00000140 <__bad_interrupt>:
140: 0c 94 00 00 jmp 0x0 <__vectors>
 
00000144 <Sekundentakt_Init>:
unsigned int IntervallDebug = 250, IntervallDisplay = 120;
 
void Sekundentakt_Init(void)
{
_SekTimer = SetDelay(1000);
144: 88 ee ldi r24, 0xE8 ; 232
146: 93 e0 ldi r25, 0x03 ; 3
148: 0e 94 a8 09 call 0x1350 <SetDelay>
14c: 90 93 91 00 sts 0x0091, r25
150: 80 93 90 00 sts 0x0090, r24
154: 08 95 ret
 
00000156 <Sekundentakt>:
}
 
void Sekundentakt(void)
{
if(CheckDelay(_SekTimer))
156: 80 91 90 00 lds r24, 0x0090
15a: 90 91 91 00 lds r25, 0x0091
15e: 0e 94 b1 09 call 0x1362 <CheckDelay>
162: 88 23 and r24, r24
164: 31 f1 breq .+76 ; 0x1b2 <Sekundentakt+0x5c>
{
GetKeyboard();
166: 0e 94 d2 09 call 0x13a4 <GetKeyboard>
_SekTimer += 1000;
16a: 80 91 90 00 lds r24, 0x0090
16e: 90 91 91 00 lds r25, 0x0091
172: 88 51 subi r24, 0x18 ; 24
174: 9c 4f sbci r25, 0xFC ; 252
176: 90 93 91 00 sts 0x0091, r25
17a: 80 93 90 00 sts 0x0090, r24
if(!CntDatensaetzeProSekunde) UebertragungUnterbrochen = 1; else UebertragungUnterbrochen = 0;
17e: 80 91 66 00 lds r24, 0x0066
182: 88 23 and r24, r24
184: 21 f4 brne .+8 ; 0x18e <Sekundentakt+0x38>
186: 81 e0 ldi r24, 0x01 ; 1
188: 80 93 84 00 sts 0x0084, r24
18c: 02 c0 rjmp .+4 ; 0x192 <Sekundentakt+0x3c>
18e: 10 92 84 00 sts 0x0084, r1
CntDatensaetzeProSekunde = 0;
192: 10 92 66 00 sts 0x0066, r1
if(++Sekunde == 60)
196: 80 91 8d 00 lds r24, 0x008D
19a: 8f 5f subi r24, 0xFF ; 255
19c: 80 93 8d 00 sts 0x008D, r24
1a0: 8c 33 cpi r24, 0x3C ; 60
1a2: 39 f4 brne .+14 ; 0x1b2 <Sekundentakt+0x5c>
{
Sekunde = 0;
1a4: 10 92 8d 00 sts 0x008D, r1
Minute++;
1a8: 80 91 8c 00 lds r24, 0x008C
1ac: 8f 5f subi r24, 0xFF ; 255
1ae: 80 93 8c 00 sts 0x008C, r24
1b2: 08 95 ret
 
000001b4 <Init>:
}
}
}
 
void Init(void)
{
VersionInfo.Hauptversion = 0;
1b4: 10 92 c9 00 sts 0x00C9, r1
VersionInfo.Nebenversion = 99;
1b8: 83 e6 ldi r24, 0x63 ; 99
1ba: 80 93 ca 00 sts 0x00CA, r24
VersionInfo.PCKompatibel = 1;
1be: 81 e0 ldi r24, 0x01 ; 1
1c0: 80 93 cb 00 sts 0x00CB, r24
VersionInfo.Commercial = 0x00;
1c4: 10 92 cc 00 sts 0x00CC, r1
1c8: 08 95 ret
 
000001ca <main>:
}
 
#define MENU 0
#define REMOTE 1
 
//############################################################################
//Hauptprogramm
void main (void)
//############################################################################
{
1ca: ca e5 ldi r28, 0x5A ; 90
1cc: d8 e0 ldi r29, 0x08 ; 8
1ce: de bf out 0x3e, r29 ; 62
1d0: cd bf out 0x3d, r28 ; 61
char z,txt[]= {"Moin"},key,key_old = 255;
1d2: de 01 movw r26, r28
1d4: 11 96 adiw r26, 0x01 ; 1
1d6: e7 e6 ldi r30, 0x67 ; 103
1d8: f0 e0 ldi r31, 0x00 ; 0
1da: 85 e0 ldi r24, 0x05 ; 5
1dc: 01 90 ld r0, Z+
1de: 0d 92 st X+, r0
1e0: 81 50 subi r24, 0x01 ; 1
1e2: e1 f7 brne .-8 ; 0x1dc <main+0x12>
int test = 0;
unsigned int DelayTast;
unsigned int DelayDaten,DelayDisplay;
 
unsigned char mode = REMOTE;
1e4: 91 e0 ldi r25, 0x01 ; 1
1e6: b9 2e mov r11, r25
unsigned char neueDatenuebertragung = 1;
 
UART_Init();
1e8: 0e 94 cc 04 call 0x998 <UART_Init>
LCD_Init();
1ec: 0e 94 1f 06 call 0xc3e <LCD_Init>
UART_Init();
1f0: 0e 94 cc 04 call 0x998 <UART_Init>
Timer1_Init();
1f4: 0e 94 9e 09 call 0x133c <Timer1_Init>
Keyboard_Init();
1f8: 0e 94 c9 09 call 0x1392 <Keyboard_Init>
Sekundentakt_Init();
1fc: 0e 94 a2 00 call 0x144 <Sekundentakt_Init>
InitIR();
200: 0e 94 67 0b call 0x16ce <InitIR>
ADC_Init();
204: 0e 94 42 0c call 0x1884 <ADC_Init>
Init();
208: 0e 94 da 00 call 0x1b4 <Init>
sei ();//Globale Interrupts Einschalten
20c: 78 94 sei
DDRB = 0xff;
20e: 8f ef ldi r24, 0xFF ; 255
210: 87 bb out 0x17, r24 ; 23
PORTB = 0x00;
212: 18 ba out 0x18, r1 ; 24
LCD_Clear;
214: 81 e0 ldi r24, 0x01 ; 1
216: 0e 94 e1 05 call 0xbc2 <_lcd_write_command>
21a: 0e 94 c9 05 call 0xb92 <_long_delay>
 
/* while(1)
*/
 
DelayTast = SetDelay(80);
21e: 80 e5 ldi r24, 0x50 ; 80
220: 90 e0 ldi r25, 0x00 ; 0
222: 0e 94 a8 09 call 0x1350 <SetDelay>
226: 7c 01 movw r14, r24
DelayDaten = SetDelay(200);
228: 88 ec ldi r24, 0xC8 ; 200
22a: 90 e0 ldi r25, 0x00 ; 0
22c: 0e 94 a8 09 call 0x1350 <SetDelay>
230: 8c 01 movw r16, r24
DelayDisplay = SetDelay(300);
232: 8c e2 ldi r24, 0x2C ; 44
234: 91 e0 ldi r25, 0x01 ; 1
236: 0e 94 a8 09 call 0x1350 <SetDelay>
23a: 6c 01 movw r12, r24
ClearIntervalle();
23c: 0e 94 2e 05 call 0xa5c <ClearIntervalle>
while (1)
{
if(mode == MENU)
240: bb 20 and r11, r11
242: 11 f5 brne .+68 ; 0x288 <main+0xbe>
{
Delay_ms(10);
244: 8a e0 ldi r24, 0x0A ; 10
246: 90 e0 ldi r25, 0x00 ; 0
248: 0e 94 bc 09 call 0x1378 <Delay_ms>
key = GetKeyboard();
24c: 0e 94 d2 09 call 0x13a4 <GetKeyboard>
Menu(key);
250: 99 27 eor r25, r25
252: 0e 94 64 0a call 0x14c8 <Menu>
if(_TASTE5)
256: cb 9b sbis 0x19, 3 ; 25
258: f5 cf rjmp .-22 ; 0x244 <main+0x7a>
{
do { Delay_ms(10);} while(_TASTE5);
25a: 8a e0 ldi r24, 0x0A ; 10
25c: 90 e0 ldi r25, 0x00 ; 0
25e: 0e 94 bc 09 call 0x1378 <Delay_ms>
262: cb 99 sbic 0x19, 3 ; 25
264: fa cf rjmp .-12 ; 0x25a <main+0x90>
mode = REMOTE;
266: 81 e0 ldi r24, 0x01 ; 1
268: b8 2e mov r11, r24
DelayTast = SetDelay(100);
26a: 84 e6 ldi r24, 0x64 ; 100
26c: 90 e0 ldi r25, 0x00 ; 0
26e: 0e 94 a8 09 call 0x1350 <SetDelay>
272: 7c 01 movw r14, r24
DelayDaten = SetDelay(200);
274: 88 ec ldi r24, 0xC8 ; 200
276: 90 e0 ldi r25, 0x00 ; 0
278: 0e 94 a8 09 call 0x1350 <SetDelay>
27c: 8c 01 movw r16, r24
LCD_Clear;
27e: 8b 2d mov r24, r11
280: 0e 94 e1 05 call 0xbc2 <_lcd_write_command>
284: 0e 94 c9 05 call 0xb92 <_long_delay>
}
}
else
if(mode == REMOTE)
288: 81 e0 ldi r24, 0x01 ; 1
28a: b8 16 cp r11, r24
28c: c9 f6 brne .-78 ; 0x240 <main+0x76>
{
BearbeiteRxDaten();
28e: 0e 94 fe 03 call 0x7fc <BearbeiteRxDaten>
 
if(CheckDelay(DelayDaten))
292: c8 01 movw r24, r16
294: 0e 94 b1 09 call 0x1362 <CheckDelay>
298: 88 23 and r24, r24
29a: c9 f3 breq .-14 ; 0x28e <main+0xc4>
{
Sekundentakt();
29c: 0e 94 ab 00 call 0x156 <Sekundentakt>
DelayDaten = SetDelay(10);
2a0: 8a e0 ldi r24, 0x0A ; 10
2a2: 90 e0 ldi r25, 0x00 ; 0
2a4: 0e 94 a8 09 call 0x1350 <SetDelay>
2a8: 8c 01 movw r16, r24
 
if(CheckDelay(DelayDisplay))
2aa: c6 01 movw r24, r12
2ac: 0e 94 b1 09 call 0x1362 <CheckDelay>
2b0: 88 23 and r24, r24
2b2: 39 f0 breq .+14 ; 0x2c2 <main+0xf8>
{
DelayDisplay = SetDelay(300);
2b4: 8c e2 ldi r24, 0x2C ; 44
2b6: 91 e0 ldi r25, 0x01 ; 1
2b8: 0e 94 a8 09 call 0x1350 <SetDelay>
2bc: 6c 01 movw r12, r24
PollDisplay = 1;
2be: b0 92 ed 00 sts 0x00ED, r11
}
key = GetKeyboard2();
2c2: 0e 94 57 0a call 0x14ae <GetKeyboard2>
DatenUebertragung(key);
2c6: 99 27 eor r25, r25
2c8: 0e 94 51 05 call 0xaa2 <DatenUebertragung>
 
if(UebertragungUnterbrochen)
2cc: 80 91 84 00 lds r24, 0x0084
2d0: 88 23 and r24, r24
2d2: 81 f1 breq .+96 ; 0x334 <main+0x16a>
{
//01234567890123456789
LCD_printfxy(0,0," -- Remote -- ");
2d4: 60 e0 ldi r22, 0x00 ; 0
2d6: 86 2f mov r24, r22
2d8: 0e 94 55 06 call 0xcaa <LCD_Gotoxy>
2dc: 84 e5 ldi r24, 0x54 ; 84
2de: 90 e0 ldi r25, 0x00 ; 0
2e0: 9f 93 push r25
2e2: 8f 93 push r24
2e4: 0e 94 e3 06 call 0xdc6 <_printf_P>
LCD_printfxy(0,1," -- Display -- ");
2e8: 61 e0 ldi r22, 0x01 ; 1
2ea: 80 e0 ldi r24, 0x00 ; 0
2ec: 0e 94 55 06 call 0xcaa <LCD_Gotoxy>
2f0: 0f 90 pop r0
2f2: 0f 90 pop r0
2f4: 89 e6 ldi r24, 0x69 ; 105
2f6: 90 e0 ldi r25, 0x00 ; 0
2f8: 9f 93 push r25
2fa: 8f 93 push r24
2fc: 0e 94 e3 06 call 0xdc6 <_printf_P>
LCD_printfxy(0,2," ");
300: 62 e0 ldi r22, 0x02 ; 2
302: 80 e0 ldi r24, 0x00 ; 0
304: 0e 94 55 06 call 0xcaa <LCD_Gotoxy>
308: 0f 90 pop r0
30a: 0f 90 pop r0
30c: 8e e7 ldi r24, 0x7E ; 126
30e: 90 e0 ldi r25, 0x00 ; 0
310: 9f 93 push r25
312: 8f 93 push r24
314: 0e 94 e3 06 call 0xdc6 <_printf_P>
LCD_printfxy(0,3," www.MicroSPS.com ");
318: 63 e0 ldi r22, 0x03 ; 3
31a: 80 e0 ldi r24, 0x00 ; 0
31c: 0e 94 55 06 call 0xcaa <LCD_Gotoxy>
320: 0f 90 pop r0
322: 0f 90 pop r0
324: 83 e9 ldi r24, 0x93 ; 147
326: 90 e0 ldi r25, 0x00 ; 0
328: 9f 93 push r25
32a: 8f 93 push r24
32c: 0e 94 e3 06 call 0xdc6 <_printf_P>
330: 0f 90 pop r0
332: 0f 90 pop r0
}
 
if(CheckDelay(DelayTast))
334: c7 01 movw r24, r14
336: 0e 94 b1 09 call 0x1362 <CheckDelay>
33a: 88 23 and r24, r24
33c: 09 f4 brne .+2 ; 0x340 <main+0x176>
33e: a7 cf rjmp .-178 ; 0x28e <main+0xc4>
{
DelayTast = SetDelay(100);
340: 84 e6 ldi r24, 0x64 ; 100
342: 90 e0 ldi r25, 0x00 ; 0
344: 0e 94 a8 09 call 0x1350 <SetDelay>
348: 7c 01 movw r14, r24
if(_TASTE5)
34a: cb 9b sbis 0x19, 3 ; 25
34c: 0c c0 rjmp .+24 ; 0x366 <main+0x19c>
{
do { Delay_ms(10);} while(_TASTE5);
34e: 8a e0 ldi r24, 0x0A ; 10
350: 90 e0 ldi r25, 0x00 ; 0
352: 0e 94 bc 09 call 0x1378 <Delay_ms>
356: cb 99 sbic 0x19, 3 ; 25
358: fa cf rjmp .-12 ; 0x34e <main+0x184>
mode = MENU;
35a: bb 24 eor r11, r11
LCD_Clear;
35c: 81 e0 ldi r24, 0x01 ; 1
35e: 0e 94 e1 05 call 0xbc2 <_lcd_write_command>
362: 0e 94 c9 05 call 0xb92 <_long_delay>
366: 80 91 be 00 lds r24, 0x00BE
}
// if(key & 0x10) DebugIn.Digital[0] |= 0x01; else DebugIn.Digital[0] &= ~0x01;
if(PIND & 0x08) DebugIn.Digital[0] |= 0x02; else DebugIn.Digital[0] &= ~0x02;
36a: 83 9b sbis 0x10, 3 ; 16
36c: 02 c0 rjmp .+4 ; 0x372 <main+0x1a8>
36e: 82 60 ori r24, 0x02 ; 2
370: 01 c0 rjmp .+2 ; 0x374 <main+0x1aa>
372: 8d 7f andi r24, 0xFD ; 253
374: 80 93 be 00 sts 0x00BE, r24
378: 80 91 be 00 lds r24, 0x00BE
if(PIND & 0x10) DebugIn.Digital[0] |= 0x04; else DebugIn.Digital[0] &= ~0x04;
37c: 84 9b sbis 0x10, 4 ; 16
37e: 02 c0 rjmp .+4 ; 0x384 <main+0x1ba>
380: 84 60 ori r24, 0x04 ; 4
382: 01 c0 rjmp .+2 ; 0x386 <main+0x1bc>
384: 8b 7f andi r24, 0xFB ; 251
386: 80 93 be 00 sts 0x00BE, r24
38a: 80 91 be 00 lds r24, 0x00BE
if(PIND & 0x20) DebugIn.Digital[0] |= 0x08; else DebugIn.Digital[0] &= ~0x08;
38e: 85 9b sbis 0x10, 5 ; 16
390: 02 c0 rjmp .+4 ; 0x396 <main+0x1cc>
392: 88 60 ori r24, 0x08 ; 8
394: 01 c0 rjmp .+2 ; 0x398 <main+0x1ce>
396: 87 7f andi r24, 0xF7 ; 247
398: 80 93 be 00 sts 0x00BE, r24
39c: 80 91 be 00 lds r24, 0x00BE
if(PIND & 0x40) DebugIn.Digital[0] |= 0x10; else DebugIn.Digital[0] &= ~0x10;
3a0: 86 9b sbis 0x10, 6 ; 16
3a2: 02 c0 rjmp .+4 ; 0x3a8 <main+0x1de>
3a4: 80 61 ori r24, 0x10 ; 16
3a6: 01 c0 rjmp .+2 ; 0x3aa <main+0x1e0>
3a8: 8f 7e andi r24, 0xEF ; 239
3aa: 80 93 be 00 sts 0x00BE, r24
3ae: 80 91 be 00 lds r24, 0x00BE
if(PIND & 0x80) DebugIn.Digital[0] |= 0x20; else DebugIn.Digital[0] &= ~0x20;
3b2: 87 9b sbis 0x10, 7 ; 16
3b4: 02 c0 rjmp .+4 ; 0x3ba <main+0x1f0>
3b6: 80 62 ori r24, 0x20 ; 32
3b8: 01 c0 rjmp .+2 ; 0x3bc <main+0x1f2>
3ba: 8f 7d andi r24, 0xDF ; 223
3bc: 80 93 be 00 sts 0x00BE, r24
GetAnalogWerte();
3c0: 0e 94 4e 0c call 0x189c <GetAnalogWerte>
3c4: 3d cf rjmp .-390 ; 0x240 <main+0x76>
 
000003c6 <__vector_15>:
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ Sende-Part der Datenübertragung
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SIGNAL(INT_VEC_TX)
{
3c6: 1f 92 push r1
3c8: 0f 92 push r0
3ca: 0f b6 in r0, 0x3f ; 63
3cc: 0f 92 push r0
3ce: 11 24 eor r1, r1
3d0: 8f 93 push r24
3d2: 9f 93 push r25
3d4: ef 93 push r30
3d6: ff 93 push r31
static unsigned int ptr = 0;
unsigned char tmp_tx;
if(!UebertragungAbgeschlossen)
3d8: 80 91 6e 00 lds r24, 0x006E
3dc: 88 23 and r24, r24
3de: d9 f4 brne .+54 ; 0x416 <__vector_15+0x50>
{
ptr++; // die [0] wurde schon gesendet
3e0: 80 91 9d 00 lds r24, 0x009D
3e4: 90 91 9e 00 lds r25, 0x009E
3e8: 01 96 adiw r24, 0x01 ; 1
3ea: 90 93 9e 00 sts 0x009E, r25
3ee: 80 93 9d 00 sts 0x009D, r24
tmp_tx = SendeBuffer[ptr];
3f2: fc 01 movw r30, r24
3f4: e2 51 subi r30, 0x12 ; 18
3f6: ff 4f sbci r31, 0xFF ; 255
3f8: e0 81 ld r30, Z
if((tmp_tx == '\r') || (ptr == MAX_SENDE_BUFF))
3fa: ed 30 cpi r30, 0x0D ; 13
3fc: 19 f0 breq .+6 ; 0x404 <__vector_15+0x3e>
3fe: 84 36 cpi r24, 0x64 ; 100
400: 91 05 cpc r25, r1
402: 39 f4 brne .+14 ; 0x412 <__vector_15+0x4c>
{
ptr = 0;
404: 10 92 9e 00 sts 0x009E, r1
408: 10 92 9d 00 sts 0x009D, r1
UebertragungAbgeschlossen = 1;
40c: 81 e0 ldi r24, 0x01 ; 1
40e: 80 93 6e 00 sts 0x006E, r24
}
UDR = tmp_tx;
412: ec b9 out 0x0c, r30 ; 12
414: 04 c0 rjmp .+8 ; 0x41e <__vector_15+0x58>
}
else ptr = 0;
416: 10 92 9e 00 sts 0x009E, r1
41a: 10 92 9d 00 sts 0x009D, r1
41e: ff 91 pop r31
420: ef 91 pop r30
422: 9f 91 pop r25
424: 8f 91 pop r24
426: 0f 90 pop r0
428: 0f be out 0x3f, r0 ; 63
42a: 0f 90 pop r0
42c: 1f 90 pop r1
42e: 18 95 reti
 
00000430 <__vector_13>:
}
 
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++ Empfangs-Part der Datenübertragung, incl. CRC-Auswertung
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SIGNAL(INT_VEC_RX)
{
430: 1f 92 push r1
432: 0f 92 push r0
434: 0f b6 in r0, 0x3f ; 63
436: 0f 92 push r0
438: 11 24 eor r1, r1
43a: 2f 93 push r18
43c: 3f 93 push r19
43e: 4f 93 push r20
440: 5f 93 push r21
442: 8f 93 push r24
444: 9f 93 push r25
446: af 93 push r26
448: bf 93 push r27
44a: ef 93 push r30
44c: ff 93 push r31
static unsigned int crc;
static unsigned char crc1,crc2,buf_ptr;
static unsigned char UartState = 0;
unsigned char CrcOkay = 0;
44e: 20 e0 ldi r18, 0x00 ; 0
 
SioTmp = UDR;
450: 8c b1 in r24, 0x0c ; 12
452: 80 93 9c 00 sts 0x009C, r24
if(buf_ptr >= MAX_EMPFANGS_BUFF) UartState = 0;
456: 50 91 a3 00 lds r21, 0x00A3
45a: 54 36 cpi r21, 0x64 ; 100
45c: 10 f0 brcs .+4 ; 0x462 <__vector_13+0x32>
45e: 20 93 a4 00 sts 0x00A4, r18
if(SioTmp == '\r' && UartState == 2)
462: 80 91 9c 00 lds r24, 0x009C
466: 8d 30 cpi r24, 0x0D ; 13
468: 09 f0 breq .+2 ; 0x46c <__vector_13+0x3c>
46a: 5b c0 rjmp .+182 ; 0x522 <__vector_13+0xf2>
46c: 80 91 a4 00 lds r24, 0x00A4
470: 82 30 cpi r24, 0x02 ; 2
472: 09 f0 breq .+2 ; 0x476 <__vector_13+0x46>
474: 56 c0 rjmp .+172 ; 0x522 <__vector_13+0xf2>
{
UartState = 0;
476: 20 93 a4 00 sts 0x00A4, r18
crc -= RxdBuffer[buf_ptr-2];
47a: 85 2f mov r24, r21
47c: 99 27 eor r25, r25
47e: 8e 5a subi r24, 0xAE ; 174
480: 9e 4f sbci r25, 0xFE ; 254
482: fc 01 movw r30, r24
484: 32 97 sbiw r30, 0x02 ; 2
486: 40 81 ld r20, Z
488: 20 91 9f 00 lds r18, 0x009F
48c: 30 91 a0 00 lds r19, 0x00A0
490: 24 1b sub r18, r20
492: 31 09 sbc r19, r1
crc -= RxdBuffer[buf_ptr-1];
494: dc 01 movw r26, r24
496: 11 97 sbiw r26, 0x01 ; 1
498: 8c 91 ld r24, X
49a: 28 1b sub r18, r24
49c: 31 09 sbc r19, r1
crc %= 4096;
49e: c9 01 movw r24, r18
4a0: 9f 70 andi r25, 0x0F ; 15
4a2: 90 93 a0 00 sts 0x00A0, r25
4a6: 80 93 9f 00 sts 0x009F, r24
crc1 = '=' + crc / 64;
4aa: 46 e0 ldi r20, 0x06 ; 6
4ac: 96 95 lsr r25
4ae: 87 95 ror r24
4b0: 4a 95 dec r20
4b2: e1 f7 brne .-8 ; 0x4ac <__vector_13+0x7c>
4b4: 98 2f mov r25, r24
4b6: 93 5c subi r25, 0xC3 ; 195
4b8: 90 93 a1 00 sts 0x00A1, r25
crc2 = '=' + crc % 64;
4bc: 2f 73 andi r18, 0x3F ; 63
4be: 30 70 andi r19, 0x00 ; 0
4c0: 23 5c subi r18, 0xC3 ; 195
4c2: 20 93 a2 00 sts 0x00A2, r18
CrcOkay = 0;
if((crc1 == RxdBuffer[buf_ptr-2]) && (crc2 == RxdBuffer[buf_ptr-1])) CrcOkay = 1; else { CrcOkay = 0; CntCrcError++;};
4c6: 80 81 ld r24, Z
4c8: 98 17 cp r25, r24
4ca: 29 f4 brne .+10 ; 0x4d6 <__vector_13+0xa6>
4cc: 8c 91 ld r24, X
4ce: 28 17 cp r18, r24
4d0: 11 f4 brne .+4 ; 0x4d6 <__vector_13+0xa6>
4d2: 21 e0 ldi r18, 0x01 ; 1
4d4: 0a c0 rjmp .+20 ; 0x4ea <__vector_13+0xba>
4d6: 20 e0 ldi r18, 0x00 ; 0
4d8: 80 91 99 00 lds r24, 0x0099
4dc: 90 91 9a 00 lds r25, 0x009A
4e0: 01 96 adiw r24, 0x01 ; 1
4e2: 90 93 9a 00 sts 0x009A, r25
4e6: 80 93 99 00 sts 0x0099, r24
if(!NeuerDatensatzEmpfangen && CrcOkay) // Datensatz schon verarbeitet
4ea: 80 91 9b 00 lds r24, 0x009B
4ee: 88 23 and r24, r24
4f0: 09 f0 breq .+2 ; 0x4f4 <__vector_13+0xc4>
4f2: 66 c0 rjmp .+204 ; 0x5c0 <__vector_13+0x190>
4f4: 22 23 and r18, r18
4f6: 09 f4 brne .+2 ; 0x4fa <__vector_13+0xca>
4f8: 63 c0 rjmp .+198 ; 0x5c0 <__vector_13+0x190>
{
CntDatensaetzeProSekunde++;
4fa: 80 91 66 00 lds r24, 0x0066
4fe: 8f 5f subi r24, 0xFF ; 255
500: 80 93 66 00 sts 0x0066, r24
PC_DebugTimeout = 10;
504: 8a e0 ldi r24, 0x0A ; 10
506: 80 93 97 00 sts 0x0097, r24
NeuerDatensatzEmpfangen = 1;
50a: 81 e0 ldi r24, 0x01 ; 1
50c: 80 93 9b 00 sts 0x009B, r24
AnzahlEmpfangsBytes = buf_ptr;
510: 50 93 98 00 sts 0x0098, r21
RxdBuffer[buf_ptr] = '\r';
514: e5 2f mov r30, r21
516: ff 27 eor r31, r31
518: ee 5a subi r30, 0xAE ; 174
51a: fe 4f sbci r31, 0xFE ; 254
51c: 8d e0 ldi r24, 0x0D ; 13
51e: 80 83 st Z, r24
520: 4f c0 rjmp .+158 ; 0x5c0 <__vector_13+0x190>
// if((RxdBuffer[1] == 's') && (RxdBuffer[2] == 'R')) wdt_enable(WDTO_250MS); // Reset-Commando
}
}
else
switch(UartState)
522: 20 91 a4 00 lds r18, 0x00A4
526: 82 2f mov r24, r18
528: 99 27 eor r25, r25
52a: 81 30 cpi r24, 0x01 ; 1
52c: 91 05 cpc r25, r1
52e: f9 f0 breq .+62 ; 0x56e <__vector_13+0x13e>
530: 82 30 cpi r24, 0x02 ; 2
532: 91 05 cpc r25, r1
534: 1c f4 brge .+6 ; 0x53c <__vector_13+0x10c>
536: 89 2b or r24, r25
538: 21 f0 breq .+8 ; 0x542 <__vector_13+0x112>
53a: 40 c0 rjmp .+128 ; 0x5bc <__vector_13+0x18c>
53c: 02 97 sbiw r24, 0x02 ; 2
53e: 11 f1 breq .+68 ; 0x584 <__vector_13+0x154>
540: 3d c0 rjmp .+122 ; 0x5bc <__vector_13+0x18c>
{
case 0:
if(SioTmp == '#' && !NeuerDatensatzEmpfangen) UartState = 1; // Startzeichen und Daten schon verarbeitet
542: 80 91 9c 00 lds r24, 0x009C
546: 83 32 cpi r24, 0x23 ; 35
548: 39 f4 brne .+14 ; 0x558 <__vector_13+0x128>
54a: 80 91 9b 00 lds r24, 0x009B
54e: 88 23 and r24, r24
550: 19 f4 brne .+6 ; 0x558 <__vector_13+0x128>
552: 81 e0 ldi r24, 0x01 ; 1
554: 80 93 a4 00 sts 0x00A4, r24
buf_ptr = 0;
RxdBuffer[buf_ptr++] = SioTmp;
558: 80 91 9c 00 lds r24, 0x009C
55c: 80 93 52 01 sts 0x0152, r24
560: 81 e0 ldi r24, 0x01 ; 1
562: 80 93 a3 00 sts 0x00A3, r24
crc = SioTmp;
566: 80 91 9c 00 lds r24, 0x009C
56a: 99 27 eor r25, r25
56c: 22 c0 rjmp .+68 ; 0x5b2 <__vector_13+0x182>
break;
case 1: // Adresse auswerten
UartState++;
56e: 2f 5f subi r18, 0xFF ; 255
570: 20 93 a4 00 sts 0x00A4, r18
RxdBuffer[buf_ptr++] = SioTmp;
574: e5 2f mov r30, r21
576: ff 27 eor r31, r31
578: ee 5a subi r30, 0xAE ; 174
57a: fe 4f sbci r31, 0xFE ; 254
57c: 80 91 9c 00 lds r24, 0x009C
580: 80 83 st Z, r24
582: 09 c0 rjmp .+18 ; 0x596 <__vector_13+0x166>
crc += SioTmp;
break;
case 2: // Eingangsdaten sammeln
RxdBuffer[buf_ptr] = SioTmp;
584: e5 2f mov r30, r21
586: ff 27 eor r31, r31
588: ee 5a subi r30, 0xAE ; 174
58a: fe 4f sbci r31, 0xFE ; 254
58c: 80 91 9c 00 lds r24, 0x009C
590: 80 83 st Z, r24
if(buf_ptr < MAX_EMPFANGS_BUFF) buf_ptr++;
592: 54 36 cpi r21, 0x64 ; 100
594: 20 f4 brcc .+8 ; 0x59e <__vector_13+0x16e>
596: 5f 5f subi r21, 0xFF ; 255
598: 50 93 a3 00 sts 0x00A3, r21
59c: 02 c0 rjmp .+4 ; 0x5a2 <__vector_13+0x172>
else UartState = 0;
59e: 10 92 a4 00 sts 0x00A4, r1
crc += SioTmp;
5a2: 20 91 9c 00 lds r18, 0x009C
5a6: 80 91 9f 00 lds r24, 0x009F
5aa: 90 91 a0 00 lds r25, 0x00A0
5ae: 82 0f add r24, r18
5b0: 91 1d adc r25, r1
5b2: 90 93 a0 00 sts 0x00A0, r25
5b6: 80 93 9f 00 sts 0x009F, r24
break;
5ba: 02 c0 rjmp .+4 ; 0x5c0 <__vector_13+0x190>
default:
UartState = 0;
5bc: 10 92 a4 00 sts 0x00A4, r1
5c0: ff 91 pop r31
5c2: ef 91 pop r30
5c4: bf 91 pop r27
5c6: af 91 pop r26
5c8: 9f 91 pop r25
5ca: 8f 91 pop r24
5cc: 5f 91 pop r21
5ce: 4f 91 pop r20
5d0: 3f 91 pop r19
5d2: 2f 91 pop r18
5d4: 0f 90 pop r0
5d6: 0f be out 0x3f, r0 ; 63
5d8: 0f 90 pop r0
5da: 1f 90 pop r1
5dc: 18 95 reti
 
000005de <AddCRC>:
break;
}
};
 
// --------------------------------------------------------------------------
void AddCRC(unsigned int wieviele)
{
5de: ac 01 movw r20, r24
unsigned int tmpCRC = 0,i;
5e0: a0 e0 ldi r26, 0x00 ; 0
5e2: b0 e0 ldi r27, 0x00 ; 0
for(i = 0; i < wieviele;i++)
5e4: 9d 01 movw r18, r26
5e6: a8 17 cp r26, r24
5e8: b9 07 cpc r27, r25
5ea: 48 f4 brcc .+18 ; 0x5fe <AddCRC+0x20>
5ec: ee ee ldi r30, 0xEE ; 238
5ee: f0 e0 ldi r31, 0x00 ; 0
{
tmpCRC += SendeBuffer[i];
5f0: 81 91 ld r24, Z+
5f2: 28 0f add r18, r24
5f4: 31 1d adc r19, r1
5f6: 11 96 adiw r26, 0x01 ; 1
5f8: a4 17 cp r26, r20
5fa: b5 07 cpc r27, r21
5fc: c8 f3 brcs .-14 ; 0x5f0 <AddCRC+0x12>
}
tmpCRC %= 4096;
5fe: 3f 70 andi r19, 0x0F ; 15
SendeBuffer[i++] = '=' + tmpCRC / 64;
600: fd 01 movw r30, r26
602: e2 51 subi r30, 0x12 ; 18
604: ff 4f sbci r31, 0xFF ; 255
606: c9 01 movw r24, r18
608: 56 e0 ldi r21, 0x06 ; 6
60a: 96 95 lsr r25
60c: 87 95 ror r24
60e: 5a 95 dec r21
610: e1 f7 brne .-8 ; 0x60a <AddCRC+0x2c>
612: 83 5c subi r24, 0xC3 ; 195
614: 80 83 st Z, r24
616: 11 96 adiw r26, 0x01 ; 1
SendeBuffer[i++] = '=' + tmpCRC % 64;
618: fd 01 movw r30, r26
61a: e2 51 subi r30, 0x12 ; 18
61c: ff 4f sbci r31, 0xFF ; 255
61e: 2f 73 andi r18, 0x3F ; 63
620: 30 70 andi r19, 0x00 ; 0
622: 82 2f mov r24, r18
624: 83 5c subi r24, 0xC3 ; 195
626: 80 83 st Z, r24
SendeBuffer[i++] = '\r';
628: a1 51 subi r26, 0x11 ; 17
62a: bf 4f sbci r27, 0xFF ; 255
62c: 8d e0 ldi r24, 0x0D ; 13
62e: 8c 93 st X, r24
UebertragungAbgeschlossen = 0;
630: 10 92 6e 00 sts 0x006E, r1
UDR = SendeBuffer[0];
634: 80 91 ee 00 lds r24, 0x00EE
638: 8c b9 out 0x0c, r24 ; 12
63a: 08 95 ret
 
0000063c <SendOutData>:
// PrintSendeBuffer();
}
 
 
// --------------------------------------------------------------------------
void SendOutData(unsigned char cmd,unsigned char modul, unsigned char *snd, unsigned char len)
{
63c: 1f 93 push r17
63e: cf 93 push r28
640: df 93 push r29
642: 38 2f mov r19, r24
644: 96 2f mov r25, r22
646: ea 01 movw r28, r20
648: 72 2f mov r23, r18
unsigned int pt = 0,i;
unsigned char a,b,c,d;
unsigned char ptr = 0;
64a: 10 e0 ldi r17, 0x00 ; 0
unsigned char x,y,z;
//while(!UebertragungAbgeschlossen);
SendeBuffer[pt++] = '#'; // Startzeichen
64c: 83 e2 ldi r24, 0x23 ; 35
64e: 80 93 ee 00 sts 0x00EE, r24
SendeBuffer[pt++] = modul+'a'; // Adresse (a=0; b=1,...)
652: 9f 59 subi r25, 0x9F ; 159
654: 90 93 ef 00 sts 0x00EF, r25
SendeBuffer[pt++] = cmd; // Commando
658: 30 93 f0 00 sts 0x00F0, r19
65c: a3 e0 ldi r26, 0x03 ; 3
65e: b0 e0 ldi r27, 0x00 ; 0
 
while(len)
{
if(len) { a = snd[ptr++]; len--;} else a = 0;
if(len) { b = snd[ptr++]; len--;} else b = 0;
if(len) { c = snd[ptr++]; len--;} else c = 0;
SendeBuffer[pt++] = '=' + (a >> 2);
SendeBuffer[pt++] = '=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4));
SendeBuffer[pt++] = '=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6));
SendeBuffer[pt++] = '=' + ( c & 0x3f);
660: 77 23 and r23, r23
662: 09 f4 brne .+2 ; 0x666 <SendOutData+0x2a>
664: 58 c0 rjmp .+176 ; 0x716 <SendOutData+0xda>
666: 77 23 and r23, r23
668: 11 f4 brne .+4 ; 0x66e <SendOutData+0x32>
66a: 97 2f mov r25, r23
66c: 07 c0 rjmp .+14 ; 0x67c <SendOutData+0x40>
66e: fe 01 movw r30, r28
670: e1 0f add r30, r17
672: f1 1d adc r31, r1
674: 1f 5f subi r17, 0xFF ; 255
676: 90 81 ld r25, Z
678: 71 50 subi r23, 0x01 ; 1
67a: 11 f4 brne .+4 ; 0x680 <SendOutData+0x44>
67c: 47 2f mov r20, r23
67e: 0e c0 rjmp .+28 ; 0x69c <SendOutData+0x60>
680: fe 01 movw r30, r28
682: e1 0f add r30, r17
684: f1 1d adc r31, r1
686: 1f 5f subi r17, 0xFF ; 255
688: 40 81 ld r20, Z
68a: 71 50 subi r23, 0x01 ; 1
68c: 39 f0 breq .+14 ; 0x69c <SendOutData+0x60>
68e: fe 01 movw r30, r28
690: e1 0f add r30, r17
692: f1 1d adc r31, r1
694: 1f 5f subi r17, 0xFF ; 255
696: 60 81 ld r22, Z
698: 71 50 subi r23, 0x01 ; 1
69a: 01 c0 rjmp .+2 ; 0x69e <SendOutData+0x62>
69c: 67 2f mov r22, r23
69e: fd 01 movw r30, r26
6a0: e2 51 subi r30, 0x12 ; 18
6a2: ff 4f sbci r31, 0xFF ; 255
6a4: 89 2f mov r24, r25
6a6: 86 95 lsr r24
6a8: 86 95 lsr r24
6aa: 83 5c subi r24, 0xC3 ; 195
6ac: 80 83 st Z, r24
6ae: 11 96 adiw r26, 0x01 ; 1
6b0: fd 01 movw r30, r26
6b2: e2 51 subi r30, 0x12 ; 18
6b4: ff 4f sbci r31, 0xFF ; 255
6b6: 89 2f mov r24, r25
6b8: 99 27 eor r25, r25
6ba: 83 70 andi r24, 0x03 ; 3
6bc: 90 70 andi r25, 0x00 ; 0
6be: 24 e0 ldi r18, 0x04 ; 4
6c0: 88 0f add r24, r24
6c2: 99 1f adc r25, r25
6c4: 2a 95 dec r18
6c6: e1 f7 brne .-8 ; 0x6c0 <SendOutData+0x84>
6c8: 55 27 eor r21, r21
6ca: 9a 01 movw r18, r20
6cc: 94 e0 ldi r25, 0x04 ; 4
6ce: 36 95 lsr r19
6d0: 27 95 ror r18
6d2: 9a 95 dec r25
6d4: e1 f7 brne .-8 ; 0x6ce <SendOutData+0x92>
6d6: 82 2b or r24, r18
6d8: 83 5c subi r24, 0xC3 ; 195
6da: 80 83 st Z, r24
6dc: 11 96 adiw r26, 0x01 ; 1
6de: fd 01 movw r30, r26
6e0: e2 51 subi r30, 0x12 ; 18
6e2: ff 4f sbci r31, 0xFF ; 255
6e4: 4f 70 andi r20, 0x0F ; 15
6e6: 50 70 andi r21, 0x00 ; 0
6e8: 44 0f add r20, r20
6ea: 55 1f adc r21, r21
6ec: 44 0f add r20, r20
6ee: 55 1f adc r21, r21
6f0: 86 2f mov r24, r22
6f2: 99 27 eor r25, r25
6f4: 26 e0 ldi r18, 0x06 ; 6
6f6: 96 95 lsr r25
6f8: 87 95 ror r24
6fa: 2a 95 dec r18
6fc: e1 f7 brne .-8 ; 0x6f6 <SendOutData+0xba>
6fe: 84 2b or r24, r20
700: 83 5c subi r24, 0xC3 ; 195
702: 80 83 st Z, r24
704: 11 96 adiw r26, 0x01 ; 1
706: fd 01 movw r30, r26
708: e2 51 subi r30, 0x12 ; 18
70a: ff 4f sbci r31, 0xFF ; 255
70c: 6f 73 andi r22, 0x3F ; 63
70e: 63 5c subi r22, 0xC3 ; 195
710: 60 83 st Z, r22
712: 11 96 adiw r26, 0x01 ; 1
714: a5 cf rjmp .-182 ; 0x660 <SendOutData+0x24>
}
AddCRC(pt);
716: cd 01 movw r24, r26
718: 0e 94 ef 02 call 0x5de <AddCRC>
71c: df 91 pop r29
71e: cf 91 pop r28
720: 1f 91 pop r17
722: 08 95 ret
 
00000724 <Decode64>:
}
 
// --------------------------------------------------------------------------
void Decode64(unsigned char *ptrOut, unsigned char len, unsigned char ptrIn,unsigned char max) // Wohin mit den Daten; Wie lang; Wo im RxdBuffer
{
724: 1f 93 push r17
726: cf 93 push r28
728: df 93 push r29
72a: ec 01 movw r28, r24
unsigned char a,b,c,d;
unsigned char ptr = 0;
72c: 10 e0 ldi r17, 0x00 ; 0
unsigned char x,y,z;
while(len)
{
a = RxdBuffer[ptrIn++] - '=';
b = RxdBuffer[ptrIn++] - '=';
c = RxdBuffer[ptrIn++] - '=';
d = RxdBuffer[ptrIn++] - '=';
if(ptrIn > max - 2) break; // nicht mehr Daten verarbeiten, als empfangen wurden
 
x = (a << 2) | (b >> 4);
y = ((b & 0x0f) << 4) | (c >> 2);
z = ((c & 0x03) << 6) | d;
 
if(len--) ptrOut[ptr++] = x; else break;
if(len--) ptrOut[ptr++] = y; else break;
if(len--) ptrOut[ptr++] = z; else break;
72e: 66 23 and r22, r22
730: 09 f4 brne .+2 ; 0x734 <Decode64+0x10>
732: 60 c0 rjmp .+192 ; 0x7f4 <Decode64+0xd0>
734: a2 2f mov r26, r18
736: bb 27 eor r27, r27
738: 12 97 sbiw r26, 0x02 ; 2
73a: e4 2f mov r30, r20
73c: ff 27 eor r31, r31
73e: ee 5a subi r30, 0xAE ; 174
740: fe 4f sbci r31, 0xFE ; 254
742: 30 81 ld r19, Z
744: 3d 53 subi r19, 0x3D ; 61
746: 4f 5f subi r20, 0xFF ; 255
748: e4 2f mov r30, r20
74a: ff 27 eor r31, r31
74c: ee 5a subi r30, 0xAE ; 174
74e: fe 4f sbci r31, 0xFE ; 254
750: 50 81 ld r21, Z
752: 5d 53 subi r21, 0x3D ; 61
754: 4f 5f subi r20, 0xFF ; 255
756: e4 2f mov r30, r20
758: ff 27 eor r31, r31
75a: ee 5a subi r30, 0xAE ; 174
75c: fe 4f sbci r31, 0xFE ; 254
75e: 70 81 ld r23, Z
760: 7d 53 subi r23, 0x3D ; 61
762: 4f 5f subi r20, 0xFF ; 255
764: e4 2f mov r30, r20
766: ff 27 eor r31, r31
768: ee 5a subi r30, 0xAE ; 174
76a: fe 4f sbci r31, 0xFE ; 254
76c: e0 81 ld r30, Z
76e: ed 53 subi r30, 0x3D ; 61
770: 4f 5f subi r20, 0xFF ; 255
772: 84 2f mov r24, r20
774: 99 27 eor r25, r25
776: a8 17 cp r26, r24
778: b9 07 cpc r27, r25
77a: e4 f1 brlt .+120 ; 0x7f4 <Decode64+0xd0>
77c: 83 2f mov r24, r19
77e: 99 27 eor r25, r25
780: 88 0f add r24, r24
782: 99 1f adc r25, r25
784: 88 0f add r24, r24
786: 99 1f adc r25, r25
788: 35 2f mov r19, r21
78a: 32 95 swap r19
78c: 3f 70 andi r19, 0x0F ; 15
78e: 38 2b or r19, r24
790: 85 2f mov r24, r21
792: 99 27 eor r25, r25
794: 8f 70 andi r24, 0x0F ; 15
796: 90 70 andi r25, 0x00 ; 0
798: f4 e0 ldi r31, 0x04 ; 4
79a: 88 0f add r24, r24
79c: 99 1f adc r25, r25
79e: fa 95 dec r31
7a0: e1 f7 brne .-8 ; 0x79a <Decode64+0x76>
7a2: 57 2f mov r21, r23
7a4: 56 95 lsr r21
7a6: 56 95 lsr r21
7a8: 58 2b or r21, r24
7aa: 87 2f mov r24, r23
7ac: 99 27 eor r25, r25
7ae: 83 70 andi r24, 0x03 ; 3
7b0: 90 70 andi r25, 0x00 ; 0
7b2: 76 e0 ldi r23, 0x06 ; 6
7b4: 88 0f add r24, r24
7b6: 99 1f adc r25, r25
7b8: 7a 95 dec r23
7ba: e1 f7 brne .-8 ; 0x7b4 <Decode64+0x90>
7bc: 8e 2b or r24, r30
7be: 61 50 subi r22, 0x01 ; 1
7c0: 6f 3f cpi r22, 0xFF ; 255
7c2: c1 f0 breq .+48 ; 0x7f4 <Decode64+0xd0>
7c4: fe 01 movw r30, r28
7c6: e1 0f add r30, r17
7c8: f1 1d adc r31, r1
7ca: 30 83 st Z, r19
7cc: 1f 5f subi r17, 0xFF ; 255
7ce: 61 50 subi r22, 0x01 ; 1
7d0: 6f 3f cpi r22, 0xFF ; 255
7d2: 81 f0 breq .+32 ; 0x7f4 <Decode64+0xd0>
7d4: fe 01 movw r30, r28
7d6: e1 0f add r30, r17
7d8: f1 1d adc r31, r1
7da: 50 83 st Z, r21
7dc: 1f 5f subi r17, 0xFF ; 255
7de: 61 50 subi r22, 0x01 ; 1
7e0: 6f 3f cpi r22, 0xFF ; 255
7e2: 41 f0 breq .+16 ; 0x7f4 <Decode64+0xd0>
7e4: fe 01 movw r30, r28
7e6: e1 0f add r30, r17
7e8: f1 1d adc r31, r1
7ea: 80 83 st Z, r24
7ec: 1f 5f subi r17, 0xFF ; 255
7ee: 66 23 and r22, r22
7f0: 09 f0 breq .+2 ; 0x7f4 <Decode64+0xd0>
7f2: a3 cf rjmp .-186 ; 0x73a <Decode64+0x16>
7f4: df 91 pop r29
7f6: cf 91 pop r28
7f8: 1f 91 pop r17
7fa: 08 95 ret
 
000007fc <BearbeiteRxDaten>:
}
 
}
 
// --------------------------------------------------------------------------
void BearbeiteRxDaten(void)
{
7fc: cf 93 push r28
7fe: df 93 push r29
800: cd b7 in r28, 0x3d ; 61
802: de b7 in r29, 0x3e ; 62
804: ad 97 sbiw r28, 0x2d ; 45
806: 0f b6 in r0, 0x3f ; 63
808: f8 94 cli
80a: de bf out 0x3e, r29 ; 62
80c: 0f be out 0x3f, r0 ; 63
80e: cd bf out 0x3d, r28 ; 61
unsigned int tmp_int_arr1[1];
unsigned int tmp_int_arr2[2];
unsigned int tmp_int_arr20[21];
unsigned char tmp_char_arr3[3];
// unsigned int tmp_int_arr4[4];
 
if(!NeuerDatensatzEmpfangen) return;
810: 80 91 9b 00 lds r24, 0x009B
814: 88 23 and r24, r24
816: 09 f4 brne .+2 ; 0x81a <BearbeiteRxDaten+0x1e>
818: a7 c0 rjmp .+334 ; 0x968 <__stack+0x109>
NeuerDatensatzEmpfangen = 0;
81a: 10 92 9b 00 sts 0x009B, r1
if(ErwarteAntwort == RxdBuffer[2]) AntwortEingetroffen = 1;
81e: 90 91 6d 00 lds r25, 0x006D
822: 80 91 54 01 lds r24, 0x0154
826: 98 17 cp r25, r24
828: 19 f4 brne .+6 ; 0x830 <BearbeiteRxDaten+0x34>
82a: 81 e0 ldi r24, 0x01 ; 1
82c: 80 93 92 00 sts 0x0092, r24
switch(RxdBuffer[2])
830: 80 91 54 01 lds r24, 0x0154
834: 99 27 eor r25, r25
836: 82 33 cpi r24, 0x32 ; 50
838: 91 05 cpc r25, r1
83a: 09 f4 brne .+2 ; 0x83e <BearbeiteRxDaten+0x42>
83c: 46 c0 rjmp .+140 ; 0x8ca <__stack+0x6b>
83e: 83 33 cpi r24, 0x33 ; 51
840: 91 05 cpc r25, r1
842: 34 f4 brge .+12 ; 0x850 <BearbeiteRxDaten+0x54>
844: 80 33 cpi r24, 0x30 ; 48
846: 91 05 cpc r25, r1
848: 99 f0 breq .+38 ; 0x870 <__stack+0x11>
84a: c1 97 sbiw r24, 0x31 ; 49
84c: 49 f1 breq .+82 ; 0x8a0 <__stack+0x41>
84e: 8c c0 rjmp .+280 ; 0x968 <__stack+0x109>
850: 84 34 cpi r24, 0x44 ; 68
852: 91 05 cpc r25, r1
854: 09 f4 brne .+2 ; 0x858 <BearbeiteRxDaten+0x5c>
856: 6b c0 rjmp .+214 ; 0x92e <__stack+0xcf>
858: 85 34 cpi r24, 0x45 ; 69
85a: 91 05 cpc r25, r1
85c: 24 f4 brge .+8 ; 0x866 <__stack+0x7>
85e: c3 97 sbiw r24, 0x33 ; 51
860: 09 f4 brne .+2 ; 0x864 <__stack+0x5>
862: 48 c0 rjmp .+144 ; 0x8f4 <__stack+0x95>
864: 81 c0 rjmp .+258 ; 0x968 <__stack+0x109>
866: 8b 34 cpi r24, 0x4B ; 75
868: 91 05 cpc r25, r1
86a: 09 f4 brne .+2 ; 0x86e <__stack+0xf>
86c: 6c c0 rjmp .+216 ; 0x946 <__stack+0xe7>
86e: 7c c0 rjmp .+248 ; 0x968 <__stack+0x109>
{
case '0':// LCD-Zeile0
Decode64((unsigned char *) &tmp_int_arr20,sizeof(tmp_int_arr20),3,AnzahlEmpfangsBytes);
870: 20 91 98 00 lds r18, 0x0098
874: 43 e0 ldi r20, 0x03 ; 3
876: 6a e2 ldi r22, 0x2A ; 42
878: ce 01 movw r24, r28
87a: 01 96 adiw r24, 0x01 ; 1
87c: 0e 94 92 03 call 0x724 <Decode64>
tmp_int_arr20[20] = 0;
880: 1a a6 std Y+42, r1 ; 0x2a
882: 19 a6 std Y+41, r1 ; 0x29
DisplayBusy = 1;
884: 81 e0 ldi r24, 0x01 ; 1
886: 80 93 93 00 sts 0x0093, r24
LCD_printfxy(0,0,"%s",tmp_int_arr20);
88a: 60 e0 ldi r22, 0x00 ; 0
88c: 86 2f mov r24, r22
88e: 0e 94 55 06 call 0xcaa <LCD_Gotoxy>
892: ce 01 movw r24, r28
894: 01 96 adiw r24, 0x01 ; 1
896: 9f 93 push r25
898: 8f 93 push r24
89a: 88 ea ldi r24, 0xA8 ; 168
89c: 90 e0 ldi r25, 0x00 ; 0
89e: 3e c0 rjmp .+124 ; 0x91c <__stack+0xbd>
break;
case '1':// LCD-Zeile1
Decode64((unsigned char *) &tmp_int_arr20,sizeof(tmp_int_arr20),3,AnzahlEmpfangsBytes);
8a0: 20 91 98 00 lds r18, 0x0098
8a4: 43 e0 ldi r20, 0x03 ; 3
8a6: 6a e2 ldi r22, 0x2A ; 42
8a8: ce 01 movw r24, r28
8aa: 01 96 adiw r24, 0x01 ; 1
8ac: 0e 94 92 03 call 0x724 <Decode64>
tmp_int_arr20[20] = 0;
8b0: 1a a6 std Y+42, r1 ; 0x2a
8b2: 19 a6 std Y+41, r1 ; 0x29
LCD_printfxy(0,1,"%s",tmp_int_arr20);
8b4: 61 e0 ldi r22, 0x01 ; 1
8b6: 80 e0 ldi r24, 0x00 ; 0
8b8: 0e 94 55 06 call 0xcaa <LCD_Gotoxy>
8bc: ce 01 movw r24, r28
8be: 01 96 adiw r24, 0x01 ; 1
8c0: 9f 93 push r25
8c2: 8f 93 push r24
8c4: 8b ea ldi r24, 0xAB ; 171
8c6: 90 e0 ldi r25, 0x00 ; 0
8c8: 29 c0 rjmp .+82 ; 0x91c <__stack+0xbd>
break;
case '2':// LCD-Zeile2
Decode64((unsigned char *) &tmp_int_arr20,sizeof(tmp_int_arr20),3,AnzahlEmpfangsBytes);
8ca: 20 91 98 00 lds r18, 0x0098
8ce: 43 e0 ldi r20, 0x03 ; 3
8d0: 6a e2 ldi r22, 0x2A ; 42
8d2: ce 01 movw r24, r28
8d4: 01 96 adiw r24, 0x01 ; 1
8d6: 0e 94 92 03 call 0x724 <Decode64>
tmp_int_arr20[20] = 0;
8da: 1a a6 std Y+42, r1 ; 0x2a
8dc: 19 a6 std Y+41, r1 ; 0x29
LCD_printfxy(0,2,"%s",tmp_int_arr20);
8de: 62 e0 ldi r22, 0x02 ; 2
8e0: 80 e0 ldi r24, 0x00 ; 0
8e2: 0e 94 55 06 call 0xcaa <LCD_Gotoxy>
8e6: ce 01 movw r24, r28
8e8: 01 96 adiw r24, 0x01 ; 1
8ea: 9f 93 push r25
8ec: 8f 93 push r24
8ee: 8e ea ldi r24, 0xAE ; 174
8f0: 90 e0 ldi r25, 0x00 ; 0
8f2: 14 c0 rjmp .+40 ; 0x91c <__stack+0xbd>
break;
case '3':// LCD-Zeile3
Decode64((unsigned char *) &tmp_int_arr20,sizeof(tmp_int_arr20),3,AnzahlEmpfangsBytes);
8f4: 20 91 98 00 lds r18, 0x0098
8f8: 43 e0 ldi r20, 0x03 ; 3
8fa: 6a e2 ldi r22, 0x2A ; 42
8fc: ce 01 movw r24, r28
8fe: 01 96 adiw r24, 0x01 ; 1
900: 0e 94 92 03 call 0x724 <Decode64>
tmp_int_arr20[20] = 0;
904: 1a a6 std Y+42, r1 ; 0x2a
906: 19 a6 std Y+41, r1 ; 0x29
LCD_printfxy(0,3,"%s",tmp_int_arr20);
908: 63 e0 ldi r22, 0x03 ; 3
90a: 80 e0 ldi r24, 0x00 ; 0
90c: 0e 94 55 06 call 0xcaa <LCD_Gotoxy>
910: ce 01 movw r24, r28
912: 01 96 adiw r24, 0x01 ; 1
914: 9f 93 push r25
916: 8f 93 push r24
918: 81 eb ldi r24, 0xB1 ; 177
91a: 90 e0 ldi r25, 0x00 ; 0
91c: 9f 93 push r25
91e: 8f 93 push r24
920: 0e 94 e3 06 call 0xdc6 <_printf_P>
break;
924: 0f 90 pop r0
926: 0f 90 pop r0
928: 0f 90 pop r0
92a: 0f 90 pop r0
92c: 1d c0 rjmp .+58 ; 0x968 <__stack+0x109>
case 'D': // Debug Eingangsdaten
Decode64((unsigned char *) &DebugOut,sizeof(DebugOut),3,AnzahlEmpfangsBytes);
92e: 20 91 98 00 lds r18, 0x0098
932: 43 e0 ldi r20, 0x03 ; 3
934: 6a e1 ldi r22, 0x1A ; 26
936: 83 ed ldi r24, 0xD3 ; 211
938: 90 e0 ldi r25, 0x00 ; 0
93a: 0e 94 92 03 call 0x724 <Decode64>
PORTB = DebugOut.Digital[1];
93e: 80 91 d4 00 lds r24, 0x00D4
942: 88 bb out 0x18, r24 ; 24
break;
944: 11 c0 rjmp .+34 ; 0x968 <__stack+0x109>
case 'K': // Debug Eingangsdaten
Decode64(tmp_char_arr3,sizeof(tmp_char_arr3),3,AnzahlEmpfangsBytes);
946: 20 91 98 00 lds r18, 0x0098
94a: 43 e0 ldi r20, 0x03 ; 3
94c: 64 2f mov r22, r20
94e: ce 01 movw r24, r28
950: 8b 96 adiw r24, 0x2b ; 43
952: 0e 94 92 03 call 0x724 <Decode64>
TX_DigTransferKanalL = tmp_char_arr3[0];
956: 8b a5 ldd r24, Y+43 ; 0x2b
958: 80 93 96 00 sts 0x0096, r24
TX_DigTransferKanalH = tmp_char_arr3[1];
95c: 8c a5 ldd r24, Y+44 ; 0x2c
95e: 80 93 95 00 sts 0x0095, r24
TX_DigTransferKanalDaten = tmp_char_arr3[2];
962: 8d a5 ldd r24, Y+45 ; 0x2d
964: 80 93 94 00 sts 0x0094, r24
968: ad 96 adiw r28, 0x2d ; 45
96a: 0f b6 in r0, 0x3f ; 63
96c: f8 94 cli
96e: de bf out 0x3e, r29 ; 62
970: 0f be out 0x3f, r0 ; 63
972: cd bf out 0x3d, r28 ; 61
974: df 91 pop r29
976: cf 91 pop r28
978: 08 95 ret
 
0000097a <uart_putchar>:
//if(RxdBuffer[1] == 'b') LCD_printfxy(0,0,"b:%4d %2x",(int)TX_DigTransferKanalH * 256 + TX_DigTransferKanalL,TX_DigTransferKanalDaten);
//if(RxdBuffer[1] == 'c') LCD_printfxy(0,1,"c:%4d %2x",(int)TX_DigTransferKanalH * 256 + TX_DigTransferKanalL,TX_DigTransferKanalDaten);
break;
/*
unsigned char Digital[13]; // 0 = Taster, Hauptkarte
// 1 + 2 = Debugkanäle
// 3 = Digin, Hauptkarte
// 4 = Relais, Hauptkarte
// 5 + 6 = Extern IO1 (12Bit ein 4 Bit aus)
// 7 + 8 = Extern IO2 (12Bit ein 4 Bit aus)
// 9 + 10 = Extern IO3 (12Bit ein 4 Bit aus)
// 11 + 12= Extern IO4 (12Bit ein 4 Bit aus)
*/
 
/* case 'd': // Debug Eingangsdaten
Decode64((unsigned char *) &DebugIn,sizeof(DebugIn),3,AnzahlEmpfangsBytes);
for(unsigned char i=0; i<4;i++)
{
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2], DebugIn.Analog[i]);
EE_CheckAndWrite(&EE_Buffer[EE_DEBUGWERTE + i*2 + 1], DebugIn.Analog[i] >> 8);
}
break;
case 'g': // "Get"-Anforderung für Debug-Daten // Bei Get werden die vom PC einstellbaren Werte vom PC zurückgelesen
DebugGetAnforderung = 1;
break;
case 'v': // Version-Anforderung und Ausbaustufe
GetVersionAnforderung = 1;
break;
case 'u': // Uhr stellen
Decode64((unsigned char *) &tmp_int_arr2[0],sizeof(tmp_int_arr2),3,AnzahlEmpfangsBytes);
ZEITWERT = tmp_int_arr2[0];
SEK = tmp_int_arr2[1];
make_time_variables(ZEITWERT);
RTC_SetTime(STD, MIN, SEK);
RTC_SetWDay(TAG);
break;
case 'i': // Intervalle für die Datenübertragung
Decode64((unsigned char *) &tmp_int_arr2[0],sizeof(tmp_int_arr2),3,AnzahlEmpfangsBytes);
Debug_Timer_Intervall = tmp_int_arr2[0];
Debug_Display_Intervall = tmp_int_arr2[1];
SendeDummyDaten = 1;
break;
case 's': // single Step 1 = Stop 2 = noch einen Zyklus 3 = noch 2 Zyklen
Decode64((unsigned char *) &tmp_int_arr1[0],sizeof(tmp_int_arr2),3,AnzahlEmpfangsBytes);
SingleStep = tmp_int_arr1[0];
break;
*/
}
}
 
//############################################################################
//Routine für die Serielle Ausgabe
int uart_putchar (char c)
//############################################################################
{
97a: cf 93 push r28
97c: c8 2f mov r28, r24
if (c == '\n')
97e: 8a 30 cpi r24, 0x0A ; 10
980: 19 f4 brne .+6 ; 0x988 <uart_putchar+0xe>
uart_putchar('\r');
982: 8d e0 ldi r24, 0x0D ; 13
984: 0e 94 bd 04 call 0x97a <uart_putchar>
//Warten solange bis Zeichen gesendet wurde
loop_until_bit_is_set(USR, UDRE);
988: 5d 9b sbis 0x0b, 5 ; 11
98a: fe cf rjmp .-4 ; 0x988 <uart_putchar+0xe>
//Ausgabe des Zeichens
UDR = c;
98c: cc b9 out 0x0c, r28 ; 12
return (0);
}
98e: 80 e0 ldi r24, 0x00 ; 0
990: 90 e0 ldi r25, 0x00 ; 0
992: cf 91 pop r28
994: 08 95 ret
 
00000996 <WriteProgramData>:
 
// --------------------------------------------------------------------------
void WriteProgramData(unsigned int pos, unsigned char wert)
{
996: 08 95 ret
 
00000998 <UART_Init>:
//if (ProgramLocation == IN_RAM) Buffer[pos] = wert;
// else eeprom_write_byte(&EE_Buffer[pos], wert);
// Buffer[pos] = wert;
}
 
//############################################################################
//INstallation der Seriellen Schnittstelle
void UART_Init (void)
//############################################################################
{
//Enable TXEN im Register UCR TX-Data Enable & RX Enable
 
UCR=(1 << TXEN) | (1 << RXEN);
998: 88 e1 ldi r24, 0x18 ; 24
99a: 8a b9 out 0x0a, r24 ; 10
// UART Double Speed (U2X)
USR |= (1<<U2X);
99c: 59 9a sbi 0x0b, 1 ; 11
// RX-Interrupt Freigabe
UCSRB |= (1<<RXCIE);
99e: 57 9a sbi 0x0a, 7 ; 10
// TX-Interrupt Freigabe
UCSRB |= (1<<TXCIE);
9a0: 56 9a sbi 0x0a, 6 ; 10
 
//Teiler wird gesetzt
UBRR=(SYSCLK / (BAUD_RATE * 8L) - 1);
9a2: 81 e2 ldi r24, 0x21 ; 33
9a4: 89 b9 out 0x09, r24 ; 9
//UBRR = 33;
//öffnet einen Kanal für printf (STDOUT)
fdevopen (uart_putchar, NULL);
9a6: 60 e0 ldi r22, 0x00 ; 0
9a8: 70 e0 ldi r23, 0x00 ; 0
9aa: 8d eb ldi r24, 0xBD ; 189
9ac: 94 e0 ldi r25, 0x04 ; 4
9ae: 0e 94 71 0c call 0x18e2 <fdevopen>
9b2: 08 95 ret
 
000009b4 <SendeRemoteTasten>:
//sbi(PORTD,4);
}
 
/*
struct str_DebugIn
{
unsigned char Digital[2];
unsigned char RemoteTasten;
unsigned int Analog[4];
};
*/
void SendeRemoteTasten(unsigned char keys)
{
9b4: 98 2f mov r25, r24
while(!UebertragungAbgeschlossen); // evtl warten
9b6: 80 91 6e 00 lds r24, 0x006E
9ba: 88 23 and r24, r24
9bc: e1 f3 breq .-8 ; 0x9b6 <SendeRemoteTasten+0x2>
DebugIn.RemoteTasten = keys;
9be: 90 93 c0 00 sts 0x00C0, r25
DebugIn.Analog[0] = AnalogWerte[0];
9c2: 80 91 ca 01 lds r24, 0x01CA
9c6: 90 91 cb 01 lds r25, 0x01CB
9ca: 90 93 c2 00 sts 0x00C2, r25
9ce: 80 93 c1 00 sts 0x00C1, r24
DebugIn.Analog[1] = AnalogWerte[1];
9d2: 80 91 cc 01 lds r24, 0x01CC
9d6: 90 91 cd 01 lds r25, 0x01CD
9da: 90 93 c4 00 sts 0x00C4, r25
9de: 80 93 c3 00 sts 0x00C3, r24
DebugIn.Analog[2] = AnalogWerte[2];
9e2: 80 91 ce 01 lds r24, 0x01CE
9e6: 90 91 cf 01 lds r25, 0x01CF
9ea: 90 93 c6 00 sts 0x00C6, r25
9ee: 80 93 c5 00 sts 0x00C5, r24
DebugIn.Analog[3] = IR_Code;
9f2: 80 91 c7 01 lds r24, 0x01C7
9f6: 90 91 c8 01 lds r25, 0x01C8
9fa: 90 93 c8 00 sts 0x00C8, r25
9fe: 80 93 c7 00 sts 0x00C7, r24
SendOutData('d',SlaveAdresse,(unsigned char *) &DebugIn,sizeof(DebugIn));
a02: 2b e0 ldi r18, 0x0B ; 11
a04: 4e eb ldi r20, 0xBE ; 190
a06: 50 e0 ldi r21, 0x00 ; 0
a08: 60 91 64 00 lds r22, 0x0064
a0c: 84 e6 ldi r24, 0x64 ; 100
a0e: 0e 94 1e 03 call 0x63c <SendOutData>
a12: 08 95 ret
 
00000a14 <SendIntervalle>:
}
 
void SendIntervalle(unsigned int debug, unsigned int disp)
{
a14: cf 93 push r28
a16: df 93 push r29
a18: cd b7 in r28, 0x3d ; 61
a1a: de b7 in r29, 0x3e ; 62
a1c: 24 97 sbiw r28, 0x04 ; 4
a1e: 0f b6 in r0, 0x3f ; 63
a20: f8 94 cli
a22: de bf out 0x3e, r29 ; 62
a24: 0f be out 0x3f, r0 ; 63
a26: cd bf out 0x3d, r28 ; 61
unsigned int tmp_int_arr2[2];
tmp_int_arr2[0] = debug;
a28: 9a 83 std Y+2, r25 ; 0x02
a2a: 89 83 std Y+1, r24 ; 0x01
tmp_int_arr2[1] = disp;
a2c: 7c 83 std Y+4, r23 ; 0x04
a2e: 6b 83 std Y+3, r22 ; 0x03
while(!UebertragungAbgeschlossen); // evtl warten
a30: 80 91 6e 00 lds r24, 0x006E
a34: 88 23 and r24, r24
a36: e1 f3 breq .-8 ; 0xa30 <SendIntervalle+0x1c>
SendOutData('i',SlaveAdresse,(unsigned char *) &tmp_int_arr2,sizeof(tmp_int_arr2));
a38: 24 e0 ldi r18, 0x04 ; 4
a3a: ae 01 movw r20, r28
a3c: 4f 5f subi r20, 0xFF ; 255
a3e: 5f 4f sbci r21, 0xFF ; 255
a40: 60 91 64 00 lds r22, 0x0064
a44: 89 e6 ldi r24, 0x69 ; 105
a46: 0e 94 1e 03 call 0x63c <SendOutData>
a4a: 24 96 adiw r28, 0x04 ; 4
a4c: 0f b6 in r0, 0x3f ; 63
a4e: f8 94 cli
a50: de bf out 0x3e, r29 ; 62
a52: 0f be out 0x3f, r0 ; 63
a54: cd bf out 0x3d, r28 ; 61
a56: df 91 pop r29
a58: cf 91 pop r28
a5a: 08 95 ret
 
00000a5c <ClearIntervalle>:
}
 
void ClearIntervalle(void)
{
a5c: cf 93 push r28
a5e: df 93 push r29
a60: cd b7 in r28, 0x3d ; 61
a62: de b7 in r29, 0x3e ; 62
a64: 24 97 sbiw r28, 0x04 ; 4
a66: 0f b6 in r0, 0x3f ; 63
a68: f8 94 cli
a6a: de bf out 0x3e, r29 ; 62
a6c: 0f be out 0x3f, r0 ; 63
a6e: cd bf out 0x3d, r28 ; 61
unsigned int tmp_int_arr2[2];
tmp_int_arr2[0] = 0;
a70: 1a 82 std Y+2, r1 ; 0x02
a72: 19 82 std Y+1, r1 ; 0x01
tmp_int_arr2[1] = 0;
a74: 1c 82 std Y+4, r1 ; 0x04
a76: 1b 82 std Y+3, r1 ; 0x03
while(!UebertragungAbgeschlossen); // evtl warten
a78: 80 91 6e 00 lds r24, 0x006E
a7c: 88 23 and r24, r24
a7e: e1 f3 breq .-8 ; 0xa78 <ClearIntervalle+0x1c>
SendOutData('i',0,(unsigned char *) &tmp_int_arr2,sizeof(tmp_int_arr2)); // 0= an alle
a80: 24 e0 ldi r18, 0x04 ; 4
a82: ae 01 movw r20, r28
a84: 4f 5f subi r20, 0xFF ; 255
a86: 5f 4f sbci r21, 0xFF ; 255
a88: 60 e0 ldi r22, 0x00 ; 0
a8a: 89 e6 ldi r24, 0x69 ; 105
a8c: 0e 94 1e 03 call 0x63c <SendOutData>
a90: 24 96 adiw r28, 0x04 ; 4
a92: 0f b6 in r0, 0x3f ; 63
a94: f8 94 cli
a96: de bf out 0x3e, r29 ; 62
a98: 0f be out 0x3f, r0 ; 63
a9a: cd bf out 0x3d, r28 ; 61
a9c: df 91 pop r29
a9e: cf 91 pop r28
aa0: 08 95 ret
 
00000aa2 <DatenUebertragung>:
}
 
void DatenUebertragung(unsigned char key)
{
aa2: cf 93 push r28
aa4: df 93 push r29
aa6: cd b7 in r28, 0x3d ; 61
aa8: de b7 in r29, 0x3e ; 62
aaa: 25 97 sbiw r28, 0x05 ; 5
aac: 0f b6 in r0, 0x3f ; 63
aae: f8 94 cli
ab0: de bf out 0x3e, r29 ; 62
ab2: 0f be out 0x3f, r0 ; 63
ab4: cd bf out 0x3d, r28 ; 61
ab6: 98 2f mov r25, r24
static unsigned char state = 1;
unsigned char temp_1[1];
unsigned char temp_2[2];
unsigned char temp_3[3];
unsigned int tmp_int_arr2[2];
while(!UebertragungAbgeschlossen); // evtl warten
ab8: 80 91 6e 00 lds r24, 0x006E
abc: 88 23 and r24, r24
abe: e1 f3 breq .-8 ; 0xab8 <DatenUebertragung+0x16>
static unsigned char KanalSlave = 1;
 
if(PollDisplay)
ac0: 80 91 ed 00 lds r24, 0x00ED
ac4: 88 23 and r24, r24
ac6: e1 f0 breq .+56 ; 0xb00 <DatenUebertragung+0x5e>
{
temp_2[0] = key;
ac8: 9c 83 std Y+4, r25 ; 0x04
temp_2[1] = 6;
aca: 86 e0 ldi r24, 0x06 ; 6
acc: 8d 83 std Y+5, r24 ; 0x05
if(DisplayZeilen == 4) temp_2[1] = 4 + 9; // anzahl Zeilen --> + 8 bedeutet: ersten Pollingzyklus freilassen
ace: 80 91 65 00 lds r24, 0x0065
ad2: 84 30 cpi r24, 0x04 ; 4
ad4: 11 f4 brne .+4 ; 0xada <DatenUebertragung+0x38>
ad6: 8d e0 ldi r24, 0x0D ; 13
ad8: 01 c0 rjmp .+2 ; 0xadc <DatenUebertragung+0x3a>
else temp_2[1] = 2 + 9;
ada: 8b e0 ldi r24, 0x0B ; 11
adc: 8d 83 std Y+5, r24 ; 0x05
SendOutData('h',SlaveAdresse,(unsigned char *) &temp_2,sizeof(temp_2));
ade: 22 e0 ldi r18, 0x02 ; 2
ae0: ae 01 movw r20, r28
ae2: 4c 5f subi r20, 0xFC ; 252
ae4: 5f 4f sbci r21, 0xFF ; 255
ae6: 60 91 64 00 lds r22, 0x0064
aea: 88 e6 ldi r24, 0x68 ; 104
aec: 0e 94 1e 03 call 0x63c <SendOutData>
ErwarteAntwort = '0';
af0: 80 e3 ldi r24, 0x30 ; 48
af2: 80 93 6d 00 sts 0x006D, r24
DisplayBusy = 90;
af6: 8a e5 ldi r24, 0x5A ; 90
af8: 80 93 93 00 sts 0x0093, r24
PollDisplay = 0;
afc: 10 92 ed 00 sts 0x00ED, r1
}
 
if(!DisplayBusy)
b00: 60 91 93 00 lds r22, 0x0093
b04: 66 23 and r22, r22
b06: e1 f5 brne .+120 ; 0xb80 <DatenUebertragung+0xde>
switch(state)
b08: 80 91 6f 00 lds r24, 0x006F
b0c: 99 27 eor r25, r25
b0e: 81 30 cpi r24, 0x01 ; 1
b10: 91 05 cpc r25, r1
b12: 19 f0 breq .+6 ; 0xb1a <DatenUebertragung+0x78>
b14: 02 97 sbiw r24, 0x02 ; 2
b16: e9 f0 breq .+58 ; 0xb52 <DatenUebertragung+0xb0>
b18: 30 c0 rjmp .+96 ; 0xb7a <DatenUebertragung+0xd8>
{
case 1:// Display
SendOutData('k',KanalSlave,(unsigned char *) &temp_3,sizeof(temp_3));
b1a: 23 e0 ldi r18, 0x03 ; 3
b1c: ae 01 movw r20, r28
b1e: 4f 5f subi r20, 0xFF ; 255
b20: 5f 4f sbci r21, 0xFF ; 255
b22: 60 91 70 00 lds r22, 0x0070
b26: 8b e6 ldi r24, 0x6B ; 107
b28: 0e 94 1e 03 call 0x63c <SendOutData>
ErwarteAntwort = 'K';
b2c: 8b e4 ldi r24, 0x4B ; 75
b2e: 80 93 6d 00 sts 0x006D, r24
if(++KanalSlave > AnzahlTeilnehmer) KanalSlave = 1;
b32: 80 91 70 00 lds r24, 0x0070
b36: 8f 5f subi r24, 0xFF ; 255
b38: 80 93 70 00 sts 0x0070, r24
b3c: 90 91 6c 00 lds r25, 0x006C
b40: 98 17 cp r25, r24
b42: 18 f4 brcc .+6 ; 0xb4a <DatenUebertragung+0xa8>
b44: 81 e0 ldi r24, 0x01 ; 1
b46: 80 93 70 00 sts 0x0070, r24
state++;
b4a: 80 91 6f 00 lds r24, 0x006F
b4e: 8f 5f subi r24, 0xFF ; 255
b50: 15 c0 rjmp .+42 ; 0xb7c <DatenUebertragung+0xda>
break;
case 2:
temp_3[0] = TX_DigTransferKanalL;
b52: 80 91 96 00 lds r24, 0x0096
b56: 89 83 std Y+1, r24 ; 0x01
temp_3[1] = TX_DigTransferKanalH;
b58: 80 91 95 00 lds r24, 0x0095
b5c: 8a 83 std Y+2, r24 ; 0x02
temp_3[2] = TX_DigTransferKanalDaten;
b5e: 80 91 94 00 lds r24, 0x0094
b62: 8b 83 std Y+3, r24 ; 0x03
SendOutData('l',0,(unsigned char *) &temp_3,sizeof(temp_3));
b64: 23 e0 ldi r18, 0x03 ; 3
b66: ae 01 movw r20, r28
b68: 4f 5f subi r20, 0xFF ; 255
b6a: 5f 4f sbci r21, 0xFF ; 255
b6c: 8c e6 ldi r24, 0x6C ; 108
b6e: 0e 94 1e 03 call 0x63c <SendOutData>
AntwortEingetroffen = 1; // erwarte keine Antwort
b72: 81 e0 ldi r24, 0x01 ; 1
b74: 80 93 92 00 sts 0x0092, r24
b78: 01 c0 rjmp .+2 ; 0xb7c <DatenUebertragung+0xda>
state = 1;
break;
 
default: state = 1;
b7a: 81 e0 ldi r24, 0x01 ; 1
b7c: 80 93 6f 00 sts 0x006F, r24
b80: 25 96 adiw r28, 0x05 ; 5
b82: 0f b6 in r0, 0x3f ; 63
b84: f8 94 cli
b86: de bf out 0x3e, r29 ; 62
b88: 0f be out 0x3f, r0 ; 63
b8a: cd bf out 0x3d, r28 ; 61
b8c: df 91 pop r29
b8e: cf 91 pop r28
b90: 08 95 ret
 
00000b92 <_long_delay>:
#include "main.h"
 
void _long_delay(void)
{
long t = 5000;
b92: 88 e8 ldi r24, 0x88 ; 136
b94: 93 e1 ldi r25, 0x13 ; 19
b96: a0 e0 ldi r26, 0x00 ; 0
b98: b0 e0 ldi r27, 0x00 ; 0
while (t--);
b9a: 03 97 sbiw r24, 0x03 ; 3
b9c: a1 09 sbc r26, r1
b9e: b1 09 sbc r27, r1
ba0: 8f 3f cpi r24, 0xFF ; 255
ba2: 2f ef ldi r18, 0xFF ; 255
ba4: 92 07 cpc r25, r18
ba6: 2f ef ldi r18, 0xFF ; 255
ba8: a2 07 cpc r26, r18
baa: 2f ef ldi r18, 0xFF ; 255
bac: b2 07 cpc r27, r18
bae: a9 f7 brne .-22 ; 0xb9a <_long_delay+0x8>
bb0: 08 95 ret
 
00000bb2 <_short_delay>:
}
 
void _short_delay(void)
{
int t = 500;
bb2: 84 ef ldi r24, 0xF4 ; 244
bb4: 91 e0 ldi r25, 0x01 ; 1
while (t--);
bb6: 03 97 sbiw r24, 0x03 ; 3
bb8: 2f ef ldi r18, 0xFF ; 255
bba: 8f 3f cpi r24, 0xFF ; 255
bbc: 92 07 cpc r25, r18
bbe: d9 f7 brne .-10 ; 0xbb6 <_short_delay+0x4>
bc0: 08 95 ret
 
00000bc2 <_lcd_write_command>:
}
 
 
void _lcd_write_command(unsigned char data)
{
bc2: 28 2f mov r18, r24
LCD_PORT_w = (data & 0xf0) | DISPLAY_EN;
bc4: 80 7f andi r24, 0xF0 ; 240
bc6: 98 2f mov r25, r24
bc8: 94 60 ori r25, 0x04 ; 4
bca: 95 bb out 0x15, r25 ; 21
LCD_PORT_w = (data & 0xf0) | DISPLAY_EN;
bcc: 95 bb out 0x15, r25 ; 21
LCD_PORT_w = (data & 0xf0);
bce: 85 bb out 0x15, r24 ; 21
LCD_PORT_w = (data & 0xf0);
bd0: 85 bb out 0x15, r24 ; 21
LCD_PORT_w = (data << 4) | DISPLAY_EN;
bd2: 82 2f mov r24, r18
bd4: 99 27 eor r25, r25
bd6: 34 e0 ldi r19, 0x04 ; 4
bd8: 88 0f add r24, r24
bda: 99 1f adc r25, r25
bdc: 3a 95 dec r19
bde: e1 f7 brne .-8 ; 0xbd8 <_lcd_write_command+0x16>
be0: 84 60 ori r24, 0x04 ; 4
be2: 85 bb out 0x15, r24 ; 21
LCD_PORT_w = (data << 4) | DISPLAY_EN;
be4: 85 bb out 0x15, r24 ; 21
LCD_PORT_w = (data << 4);
be6: 22 95 swap r18
be8: 20 7f andi r18, 0xF0 ; 240
bea: 25 bb out 0x15, r18 ; 21
bec: 08 95 ret
 
00000bee <_lcd_write_4bit>:
}
 
void _lcd_write_4bit(unsigned char data)
{
LCD_PORT_w = (data << 4) | DISPLAY_EN;
bee: 28 2f mov r18, r24
bf0: 33 27 eor r19, r19
bf2: 44 e0 ldi r20, 0x04 ; 4
bf4: 22 0f add r18, r18
bf6: 33 1f adc r19, r19
bf8: 4a 95 dec r20
bfa: e1 f7 brne .-8 ; 0xbf4 <_lcd_write_4bit+0x6>
bfc: 92 2f mov r25, r18
bfe: 94 60 ori r25, 0x04 ; 4
c00: 95 bb out 0x15, r25 ; 21
LCD_PORT_w = (data << 4) | DISPLAY_EN;
c02: 95 bb out 0x15, r25 ; 21
LCD_PORT_w = (data << 4);
c04: 82 95 swap r24
c06: 80 7f andi r24, 0xF0 ; 240
c08: 85 bb out 0x15, r24 ; 21
c0a: 08 95 ret
 
00000c0c <lcd_write_byte>:
}
 
void lcd_write_byte(unsigned char data)
{
c0c: 28 2f mov r18, r24
LCD_PORT_w = (data & 0xf0) | DISPLAY_EN | DISPLAY_RS;
c0e: 80 7f andi r24, 0xF0 ; 240
c10: 98 2f mov r25, r24
c12: 95 60 ori r25, 0x05 ; 5
c14: 95 bb out 0x15, r25 ; 21
LCD_PORT_w = (data & 0xf0) | DISPLAY_RS;
c16: 81 60 ori r24, 0x01 ; 1
c18: 85 bb out 0x15, r24 ; 21
LCD_PORT_w = (data << 4) | DISPLAY_EN | DISPLAY_RS;
c1a: 82 2f mov r24, r18
c1c: 99 27 eor r25, r25
c1e: 54 e0 ldi r21, 0x04 ; 4
c20: 88 0f add r24, r24
c22: 99 1f adc r25, r25
c24: 5a 95 dec r21
c26: e1 f7 brne .-8 ; 0xc20 <lcd_write_byte+0x14>
c28: 28 2f mov r18, r24
c2a: 25 60 ori r18, 0x05 ; 5
c2c: 25 bb out 0x15, r18 ; 21
LCD_PORT_w = (data << 4) | DISPLAY_RS;
c2e: 81 60 ori r24, 0x01 ; 1
c30: 85 bb out 0x15, r24 ; 21
c32: 08 95 ret
 
00000c34 <my_pput>:
}
 
 
int my_pput(int zeichen)
{
lcd_write_byte((char) zeichen);
c34: 0e 94 06 06 call 0xc0c <lcd_write_byte>
return(1);
}
c38: 81 e0 ldi r24, 0x01 ; 1
c3a: 90 e0 ldi r25, 0x00 ; 0
c3c: 08 95 ret
 
00000c3e <LCD_Init>:
 
// initialize the LCD controller
void LCD_Init(void)
{
LCD_PORT_DDR = 0xff;//0xf0 | DISPLAY_RS | DISPLAY_EN;
c3e: 8f ef ldi r24, 0xFF ; 255
c40: 84 bb out 0x14, r24 ; 20
_long_delay();
c42: 0e 94 c9 05 call 0xb92 <_long_delay>
_long_delay();
c46: 0e 94 c9 05 call 0xb92 <_long_delay>
_long_delay();
c4a: 0e 94 c9 05 call 0xb92 <_long_delay>
_lcd_write_4bit(0x03); // noch 8 Bit
c4e: 83 e0 ldi r24, 0x03 ; 3
c50: 0e 94 f7 05 call 0xbee <_lcd_write_4bit>
_long_delay();
c54: 0e 94 c9 05 call 0xb92 <_long_delay>
_lcd_write_4bit(0x03); // noch 8 Bit
c58: 83 e0 ldi r24, 0x03 ; 3
c5a: 0e 94 f7 05 call 0xbee <_lcd_write_4bit>
_long_delay();
c5e: 0e 94 c9 05 call 0xb92 <_long_delay>
_lcd_write_4bit(0x03); // noch 8 Bit
c62: 83 e0 ldi r24, 0x03 ; 3
c64: 0e 94 f7 05 call 0xbee <_lcd_write_4bit>
_long_delay();
c68: 0e 94 c9 05 call 0xb92 <_long_delay>
_lcd_write_4bit(0x02); // jetzt 4 Bit
c6c: 82 e0 ldi r24, 0x02 ; 2
c6e: 0e 94 f7 05 call 0xbee <_lcd_write_4bit>
_long_delay();
c72: 0e 94 c9 05 call 0xb92 <_long_delay>
_lcd_write_command(0x28); // 4 Bit Zweizeilig
c76: 88 e2 ldi r24, 0x28 ; 40
c78: 0e 94 e1 05 call 0xbc2 <_lcd_write_command>
_long_delay();
c7c: 0e 94 c9 05 call 0xb92 <_long_delay>
_lcd_write_command(0x08); // Display aus
c80: 88 e0 ldi r24, 0x08 ; 8
c82: 0e 94 e1 05 call 0xbc2 <_lcd_write_command>
_long_delay();
c86: 0e 94 c9 05 call 0xb92 <_long_delay>
_lcd_write_command(0x01); // Clear
c8a: 81 e0 ldi r24, 0x01 ; 1
c8c: 0e 94 e1 05 call 0xbc2 <_lcd_write_command>
_long_delay();
c90: 0e 94 c9 05 call 0xb92 <_long_delay>
_lcd_write_command(0x06); //Entry mode
c94: 86 e0 ldi r24, 0x06 ; 6
c96: 0e 94 e1 05 call 0xbc2 <_lcd_write_command>
_long_delay();
c9a: 0e 94 c9 05 call 0xb92 <_long_delay>
_lcd_write_command(0x08 + 4); // Display an
c9e: 8c e0 ldi r24, 0x0C ; 12
ca0: 0e 94 e1 05 call 0xbc2 <_lcd_write_command>
_long_delay();
ca4: 0e 94 c9 05 call 0xb92 <_long_delay>
ca8: 08 95 ret
 
00000caa <LCD_Gotoxy>:
}
 
 
void LCD_Gotoxy(unsigned char x , unsigned char y)
{
caa: 1f 93 push r17
cac: cf 93 push r28
cae: c8 2f mov r28, r24
cb0: 16 2f mov r17, r22
_short_delay();
cb2: 0e 94 d9 05 call 0xbb2 <_short_delay>
switch(y)
cb6: 81 2f mov r24, r17
cb8: 99 27 eor r25, r25
cba: 81 30 cpi r24, 0x01 ; 1
cbc: 91 05 cpc r25, r1
cbe: 79 f0 breq .+30 ; 0xcde <LCD_Gotoxy+0x34>
cc0: 82 30 cpi r24, 0x02 ; 2
cc2: 91 05 cpc r25, r1
cc4: 1c f4 brge .+6 ; 0xccc <LCD_Gotoxy+0x22>
cc6: 89 2b or r24, r25
cc8: 39 f0 breq .+14 ; 0xcd8 <LCD_Gotoxy+0x2e>
cca: 13 c0 rjmp .+38 ; 0xcf2 <LCD_Gotoxy+0x48>
ccc: 82 30 cpi r24, 0x02 ; 2
cce: 91 05 cpc r25, r1
cd0: 49 f0 breq .+18 ; 0xce4 <LCD_Gotoxy+0x3a>
cd2: 03 97 sbiw r24, 0x03 ; 3
cd4: 51 f0 breq .+20 ; 0xcea <LCD_Gotoxy+0x40>
cd6: 0d c0 rjmp .+26 ; 0xcf2 <LCD_Gotoxy+0x48>
{ case 0 : _lcd_write_command(x + 0x80); break;
cd8: 8c 2f mov r24, r28
cda: 80 58 subi r24, 0x80 ; 128
cdc: 08 c0 rjmp .+16 ; 0xcee <LCD_Gotoxy+0x44>
case 1 : _lcd_write_command(x + 0xC0); break;
cde: 8c 2f mov r24, r28
ce0: 80 54 subi r24, 0x40 ; 64
ce2: 05 c0 rjmp .+10 ; 0xcee <LCD_Gotoxy+0x44>
case 2 : _lcd_write_command(x + (0x80 + 20)); break;
ce4: 8c 2f mov r24, r28
ce6: 8c 56 subi r24, 0x6C ; 108
ce8: 02 c0 rjmp .+4 ; 0xcee <LCD_Gotoxy+0x44>
case 3 : _lcd_write_command(x + (0xC0 + 20)); break;
cea: 8c 2f mov r24, r28
cec: 8c 52 subi r24, 0x2C ; 44
cee: 0e 94 e1 05 call 0xbc2 <_lcd_write_command>
cf2: cf 91 pop r28
cf4: 1f 91 pop r17
cf6: 08 95 ret
 
00000cf8 <LCD_Write>:
}
}
 
 
void LCD_Write(unsigned char *this_text)
{
cf8: 1f 93 push r17
cfa: cf 93 push r28
cfc: df 93 push r29
cfe: ec 01 movw r28, r24
unsigned char i = 0;
d00: 10 e0 ldi r17, 0x00 ; 0
while(this_text[i] != 0)
{
lcd_write_byte(this_text[i++]);
_long_delay();
d02: 88 81 ld r24, Y
d04: 88 23 and r24, r24
d06: 79 f0 breq .+30 ; 0xd26 <LCD_Write+0x2e>
d08: fe 01 movw r30, r28
d0a: e1 0f add r30, r17
d0c: f1 1d adc r31, r1
d0e: 1f 5f subi r17, 0xFF ; 255
d10: 80 81 ld r24, Z
d12: 0e 94 06 06 call 0xc0c <lcd_write_byte>
d16: 0e 94 c9 05 call 0xb92 <_long_delay>
d1a: fe 01 movw r30, r28
d1c: e1 0f add r30, r17
d1e: f1 1d adc r31, r1
d20: 80 81 ld r24, Z
d22: 88 23 and r24, r24
d24: 89 f7 brne .-30 ; 0xd08 <LCD_Write+0x10>
d26: df 91 pop r29
d28: cf 91 pop r28
d2a: 1f 91 pop r17
d2c: 08 95 ret
 
00000d2e <LCD_Putchar>:
}
}
 
 
char LCD_Putchar(char zeichen)
{
d2e: 1f 93 push r17
d30: 18 2f mov r17, r24
_short_delay();
d32: 0e 94 d9 05 call 0xbb2 <_short_delay>
lcd_write_byte((char) zeichen);
d36: 81 2f mov r24, r17
d38: 0e 94 06 06 call 0xc0c <lcd_write_byte>
return(1);
}
d3c: 81 e0 ldi r24, 0x01 ; 1
d3e: 90 e0 ldi r25, 0x00 ; 0
d40: 1f 91 pop r17
d42: 08 95 ret
 
00000d44 <PRINT>:
#include "old_macros.h"
 
//#define LIGHTPRINTF
 
void PRINT(const char * ptr, unsigned int len) {
d44: 0f 93 push r16
d46: 1f 93 push r17
d48: cf 93 push r28
d4a: df 93 push r29
d4c: 8c 01 movw r16, r24
d4e: eb 01 movw r28, r22
for(;len;len--)
d50: 67 2b or r22, r23
d52: 39 f0 breq .+14 ; 0xd62 <PRINT+0x1e>
LCD_Putchar(*ptr++);
d54: f8 01 movw r30, r16
d56: 81 91 ld r24, Z+
d58: 8f 01 movw r16, r30
d5a: 0e 94 97 06 call 0xd2e <LCD_Putchar>
d5e: 21 97 sbiw r28, 0x01 ; 1
d60: c9 f7 brne .-14 ; 0xd54 <PRINT+0x10>
d62: df 91 pop r29
d64: cf 91 pop r28
d66: 1f 91 pop r17
d68: 0f 91 pop r16
d6a: 08 95 ret
 
00000d6c <PRINTP>:
}
void PRINTP(const char * ptr, unsigned int len) {
d6c: 0f 93 push r16
d6e: 1f 93 push r17
d70: cf 93 push r28
d72: df 93 push r29
d74: 8c 01 movw r16, r24
d76: eb 01 movw r28, r22
for(;len;len--)
d78: 67 2b or r22, r23
d7a: 41 f0 breq .+16 ; 0xd8c <PRINTP+0x20>
// LCD_Putchar(PRG_RDB(ptr++));
LCD_Putchar(pgm_read_byte(ptr++));
d7c: f8 01 movw r30, r16
d7e: 0f 5f subi r16, 0xFF ; 255
d80: 1f 4f sbci r17, 0xFF ; 255
d82: 84 91 lpm r24, Z
d84: 0e 94 97 06 call 0xd2e <LCD_Putchar>
d88: 21 97 sbiw r28, 0x01 ; 1
d8a: c1 f7 brne .-16 ; 0xd7c <PRINTP+0x10>
d8c: df 91 pop r29
d8e: cf 91 pop r28
d90: 1f 91 pop r17
d92: 0f 91 pop r16
d94: 08 95 ret
 
00000d96 <PAD_SP>:
}
 
void PAD_SP(signed char howmany) {
d96: cf 93 push r28
d98: c8 2f mov r28, r24
for(;howmany>0;howmany--)
d9a: 18 16 cp r1, r24
d9c: 34 f4 brge .+12 ; 0xdaa <PAD_SP+0x14>
LCD_Putchar(' ');
d9e: 80 e2 ldi r24, 0x20 ; 32
da0: 0e 94 97 06 call 0xd2e <LCD_Putchar>
da4: c1 50 subi r28, 0x01 ; 1
da6: 1c 16 cp r1, r28
da8: d4 f3 brlt .-12 ; 0xd9e <PAD_SP+0x8>
daa: cf 91 pop r28
dac: 08 95 ret
 
00000dae <PAD_0>:
}
 
void PAD_0(signed char howmany) {
dae: cf 93 push r28
db0: c8 2f mov r28, r24
for(;howmany>0;howmany--)
db2: 18 16 cp r1, r24
db4: 34 f4 brge .+12 ; 0xdc2 <PAD_0+0x14>
LCD_Putchar('0');
db6: 80 e3 ldi r24, 0x30 ; 48
db8: 0e 94 97 06 call 0xd2e <LCD_Putchar>
dbc: c1 50 subi r28, 0x01 ; 1
dbe: 1c 16 cp r1, r28
dc0: d4 f3 brlt .-12 ; 0xdb6 <PAD_0+0x8>
dc2: cf 91 pop r28
dc4: 08 95 ret
 
00000dc6 <_printf_P>:
}
 
#define BUF 40
 
/*
* Macros for converting digits to letters and vice versa
*/
#define to_digit(c) ((c) - '0')
#define is_digit(c) ((c)<='9' && (c)>='0')
#define to_char(n) ((n) + '0')
 
/*
* Flags used during conversion.
*/
#define LONGINT 0x01 /* long integer */
#define LONGDBL 0x02 /* long double; unimplemented */
#define SHORTINT 0x04 /* short integer */
#define ALT 0x08 /* alternate form */
#define LADJUST 0x10 /* left adjustment */
#define ZEROPAD 0x20 /* zero (as opposed to blank) pad */
#define HEXPREFIX 0x40 /* add 0x or 0X prefix */
 
void _printf_P (char const *fmt0, ...) /* Works with string from FLASH */
{
dc6: 2f 92 push r2
dc8: 3f 92 push r3
dca: 4f 92 push r4
dcc: 5f 92 push r5
dce: 6f 92 push r6
dd0: 7f 92 push r7
dd2: 8f 92 push r8
dd4: 9f 92 push r9
dd6: af 92 push r10
dd8: bf 92 push r11
dda: cf 92 push r12
ddc: df 92 push r13
dde: ef 92 push r14
de0: ff 92 push r15
de2: 0f 93 push r16
de4: 1f 93 push r17
de6: cf 93 push r28
de8: df 93 push r29
dea: cd b7 in r28, 0x3d ; 61
dec: de b7 in r29, 0x3e ; 62
dee: e0 97 sbiw r28, 0x30 ; 48
df0: 0f b6 in r0, 0x3f ; 63
df2: f8 94 cli
df4: de bf out 0x3e, r29 ; 62
df6: 0f be out 0x3f, r0 ; 63
df8: cd bf out 0x3d, r28 ; 61
dfa: a5 e4 ldi r26, 0x45 ; 69
dfc: 6a 2e mov r6, r26
dfe: 71 2c mov r7, r1
e00: 6c 0e add r6, r28
e02: 7d 1e adc r7, r29
va_list ap;
register const char *fmt; /* format string */
register char ch; /* character from fmt */
register int n; /* handy integer (short term usage) */
register char *cp; /* handy char pointer (short term usage) */
const char *fmark; /* for remembering a place in fmt */
register unsigned char flags; /* flags as above */
signed char width; /* width from format (%8d), or 0 */
signed char prec; /* precision from format (%.3d), or -1 */
char sign; /* sign prefix (' ', '+', '-', or \0) */
unsigned long _ulong=0; /* integer arguments %[diouxX] */
e04: 1c a6 std Y+44, r1 ; 0x2c
e06: 1d a6 std Y+45, r1 ; 0x2d
e08: 1e a6 std Y+46, r1 ; 0x2e
e0a: 1f a6 std Y+47, r1 ; 0x2f
#define OCT 8
#define DEC 10
#define HEX 16
unsigned char base; /* base for [diouxX] conversion */
signed char dprec; /* a copy of prec if [diouxX], 0 otherwise */
signed char dpad; /* extra 0 padding needed for integers */
signed char fieldsz; /* field size expanded by sign, dpad etc */
/* The initialization of 'size' is to suppress a warning that
'size' might be used unitialized. It seems gcc can't
quite grok this spaghetti code ... */
signed char size = 0; /* size of converted field or string */
char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */
char ox[2]; /* space for 0x hex-prefix */
 
va_start(ap, fmt0);
fmt = fmt0;
e0c: d3 01 movw r26, r6
e0e: ad 90 ld r10, X+
e10: bd 90 ld r11, X+
e12: 3d 01 movw r6, r26
 
/*
* Scan the format for conversions (`%' character).
*/
for (;;) {
for (fmark = fmt; (ch = pgm_read_byte(fmt)) != '\0' && ch != '%'; fmt++)
e14: c5 01 movw r24, r10
e16: 05 c0 rjmp .+10 ; 0xe22 <_printf_P+0x5c>
e18: 05 32 cpi r16, 0x25 ; 37
e1a: 39 f0 breq .+14 ; 0xe2a <_printf_P+0x64>
e1c: 08 94 sec
e1e: a1 1c adc r10, r1
e20: b1 1c adc r11, r1
e22: f5 01 movw r30, r10
e24: 04 91 lpm r16, Z
e26: 00 23 and r16, r16
e28: b9 f7 brne .-18 ; 0xe18 <_printf_P+0x52>
/* void */;
if ((n = fmt - fmark) != 0) {
e2a: b5 01 movw r22, r10
e2c: 68 1b sub r22, r24
e2e: 79 0b sbc r23, r25
e30: 11 f0 breq .+4 ; 0xe36 <_printf_P+0x70>
PRINTP(fmark, n);
e32: 0e 94 b6 06 call 0xd6c <PRINTP>
}
if (ch == '\0')
e36: 00 23 and r16, r16
e38: 09 f4 brne .+2 ; 0xe3c <_printf_P+0x76>
e3a: 30 c2 rjmp .+1120 ; 0x129c <_printf_P+0x4d6>
goto done;
fmt++; /* skip over '%' */
e3c: 08 94 sec
e3e: a1 1c adc r10, r1
e40: b1 1c adc r11, r1
 
flags = 0;
e42: 55 24 eor r5, r5
dprec = 0;
e44: 58 aa std Y+48, r5 ; 0x30
width = 0;
e46: 25 2c mov r2, r5
prec = -1;
e48: 1f ef ldi r17, 0xFF ; 255
sign = '\0';
e4a: 59 a6 std Y+41, r5 ; 0x29
 
rflag: ch = PRG_RDB(fmt++);
e4c: f5 01 movw r30, r10
e4e: 08 94 sec
e50: a1 1c adc r10, r1
e52: b1 1c adc r11, r1
e54: 04 91 lpm r16, Z
reswitch:
#ifdef LIGHTPRINTF
if (ch=='o' || ch=='u' || (ch|0x20)=='x') {
#else
if (ch=='u' || (ch|0x20)=='x') {
e56: 05 37 cpi r16, 0x75 ; 117
e58: 21 f0 breq .+8 ; 0xe62 <_printf_P+0x9c>
e5a: 80 2f mov r24, r16
e5c: 80 62 ori r24, 0x20 ; 32
e5e: 88 37 cpi r24, 0x78 ; 120
e60: f1 f4 brne .+60 ; 0xe9e <_printf_P+0xd8>
#endif
if (flags&LONGINT) {
e62: 50 fe sbrs r5, 0
e64: 0e c0 rjmp .+28 ; 0xe82 <_printf_P+0xbc>
_ulong=va_arg(ap, unsigned long);
e66: f3 01 movw r30, r6
e68: 24 e0 ldi r18, 0x04 ; 4
e6a: 30 e0 ldi r19, 0x00 ; 0
e6c: 62 0e add r6, r18
e6e: 73 1e adc r7, r19
e70: 80 81 ld r24, Z
e72: 91 81 ldd r25, Z+1 ; 0x01
e74: a2 81 ldd r26, Z+2 ; 0x02
e76: b3 81 ldd r27, Z+3 ; 0x03
e78: 8c a7 std Y+44, r24 ; 0x2c
e7a: 9d a7 std Y+45, r25 ; 0x2d
e7c: ae a7 std Y+46, r26 ; 0x2e
e7e: bf a7 std Y+47, r27 ; 0x2f
e80: 0e c0 rjmp .+28 ; 0xe9e <_printf_P+0xd8>
} else {
register unsigned int _d;
_d=va_arg(ap, unsigned int);
e82: f3 01 movw r30, r6
e84: a2 e0 ldi r26, 0x02 ; 2
e86: b0 e0 ldi r27, 0x00 ; 0
e88: 6a 0e add r6, r26
e8a: 7b 1e adc r7, r27
e8c: 80 81 ld r24, Z
e8e: 91 81 ldd r25, Z+1 ; 0x01
_ulong = flags&SHORTINT ? (unsigned long)(unsigned short)_d : (unsigned long)_d;
e90: 9c 01 movw r18, r24
e92: 44 27 eor r20, r20
e94: 55 27 eor r21, r21
e96: 2c a7 std Y+44, r18 ; 0x2c
e98: 3d a7 std Y+45, r19 ; 0x2d
e9a: 4e a7 std Y+46, r20 ; 0x2e
e9c: 5f a7 std Y+47, r21 ; 0x2f
}
}
#ifndef LIGHTPRINTF
if(ch==' ') {
e9e: 00 32 cpi r16, 0x20 ; 32
ea0: 21 f4 brne .+8 ; 0xeaa <_printf_P+0xe4>
/*
* ``If the space and + flags both appear, the space
* flag will be ignored.''
* -- ANSI X3J11
*/
if (!sign)
ea2: 89 a5 ldd r24, Y+41 ; 0x29
ea4: 88 23 and r24, r24
ea6: 91 f6 brne .-92 ; 0xe4c <_printf_P+0x86>
ea8: 1b c0 rjmp .+54 ; 0xee0 <_printf_P+0x11a>
sign = ' ';
goto rflag;
} else if (ch=='#') {
eaa: 03 32 cpi r16, 0x23 ; 35
eac: 11 f4 brne .+4 ; 0xeb2 <_printf_P+0xec>
flags |= ALT;
eae: 38 e0 ldi r19, 0x08 ; 8
eb0: 81 c0 rjmp .+258 ; 0xfb4 <_printf_P+0x1ee>
goto rflag;
} else if (ch=='*'||ch=='-') {
eb2: 0a 32 cpi r16, 0x2A ; 42
eb4: 11 f0 breq .+4 ; 0xeba <_printf_P+0xf4>
eb6: 0d 32 cpi r16, 0x2D ; 45
eb8: 89 f4 brne .+34 ; 0xedc <_printf_P+0x116>
if (ch=='*') {
eba: 0a 32 cpi r16, 0x2A ; 42
ebc: 51 f4 brne .+20 ; 0xed2 <_printf_P+0x10c>
/*
* ``A negative field width argument is taken as a
* - flag followed by a positive field width.''
* -- ANSI X3J11
* They don't exclude field widths read from args.
*/
if ((width = va_arg(ap, int)) >= 0)
ebe: f3 01 movw r30, r6
ec0: 42 e0 ldi r20, 0x02 ; 2
ec2: 50 e0 ldi r21, 0x00 ; 0
ec4: 64 0e add r6, r20
ec6: 75 1e adc r7, r21
ec8: 20 80 ld r2, Z
eca: 22 20 and r2, r2
ecc: 0c f0 brlt .+2 ; 0xed0 <_printf_P+0x10a>
ece: be cf rjmp .-132 ; 0xe4c <_printf_P+0x86>
goto rflag;
width = -width;
ed0: 21 94 neg r2
}
flags |= LADJUST;
ed2: 50 e1 ldi r21, 0x10 ; 16
ed4: 55 2a or r5, r21
flags &= ~ZEROPAD; /* '-' disables '0' */
ed6: 8f ed ldi r24, 0xDF ; 223
ed8: 58 22 and r5, r24
goto rflag;
eda: b8 cf rjmp .-144 ; 0xe4c <_printf_P+0x86>
} else if (ch=='+') {
edc: 0b 32 cpi r16, 0x2B ; 43
ede: 11 f4 brne .+4 ; 0xee4 <_printf_P+0x11e>
sign = '+';
ee0: 09 a7 std Y+41, r16 ; 0x29
goto rflag;
ee2: b4 cf rjmp .-152 ; 0xe4c <_printf_P+0x86>
} else if (ch=='.') {
ee4: 0e 32 cpi r16, 0x2E ; 46
ee6: c1 f5 brne .+112 ; 0xf58 <_printf_P+0x192>
if ((ch = PRG_RDB(fmt++)) == '*') {
ee8: f5 01 movw r30, r10
eea: 08 94 sec
eec: a1 1c adc r10, r1
eee: b1 1c adc r11, r1
ef0: 04 91 lpm r16, Z
ef2: 0a 32 cpi r16, 0x2A ; 42
ef4: 79 f4 brne .+30 ; 0xf14 <_printf_P+0x14e>
n = va_arg(ap, int);
ef6: f3 01 movw r30, r6
ef8: a2 e0 ldi r26, 0x02 ; 2
efa: b0 e0 ldi r27, 0x00 ; 0
efc: 6a 0e add r6, r26
efe: 7b 1e adc r7, r27
f00: 60 81 ld r22, Z
f02: 71 81 ldd r23, Z+1 ; 0x01
prec = n < 0 ? -1 : n;
f04: bf ef ldi r27, 0xFF ; 255
f06: 6f 3f cpi r22, 0xFF ; 255
f08: 7b 07 cpc r23, r27
f0a: 14 f4 brge .+4 ; 0xf10 <_printf_P+0x14a>
f0c: 6f ef ldi r22, 0xFF ; 255
f0e: 7f ef ldi r23, 0xFF ; 255
f10: 16 2f mov r17, r22
goto rflag;
f12: 9c cf rjmp .-200 ; 0xe4c <_printf_P+0x86>
}
n = 0;
f14: 60 e0 ldi r22, 0x00 ; 0
f16: 70 e0 ldi r23, 0x00 ; 0
while (is_digit(ch)) {
n = n*10 + to_digit(ch);
ch = PRG_RDB(fmt++);
f18: 80 2f mov r24, r16
f1a: 80 53 subi r24, 0x30 ; 48
f1c: 8a 30 cpi r24, 0x0A ; 10
f1e: a0 f4 brcc .+40 ; 0xf48 <_printf_P+0x182>
f20: cb 01 movw r24, r22
f22: f3 e0 ldi r31, 0x03 ; 3
f24: 88 0f add r24, r24
f26: 99 1f adc r25, r25
f28: fa 95 dec r31
f2a: e1 f7 brne .-8 ; 0xf24 <_printf_P+0x15e>
f2c: 86 0f add r24, r22
f2e: 97 1f adc r25, r23
f30: 68 0f add r22, r24
f32: 79 1f adc r23, r25
f34: 60 0f add r22, r16
f36: 71 1d adc r23, r1
f38: 60 53 subi r22, 0x30 ; 48
f3a: 70 40 sbci r23, 0x00 ; 0
f3c: f5 01 movw r30, r10
f3e: 08 94 sec
f40: a1 1c adc r10, r1
f42: b1 1c adc r11, r1
f44: 04 91 lpm r16, Z
f46: e8 cf rjmp .-48 ; 0xf18 <_printf_P+0x152>
}
prec = n < 0 ? -1 : n;
f48: ef ef ldi r30, 0xFF ; 255
f4a: 6f 3f cpi r22, 0xFF ; 255
f4c: 7e 07 cpc r23, r30
f4e: 14 f4 brge .+4 ; 0xf54 <_printf_P+0x18e>
f50: 6f ef ldi r22, 0xFF ; 255
f52: 7f ef ldi r23, 0xFF ; 255
f54: 16 2f mov r17, r22
goto reswitch;
f56: 7f cf rjmp .-258 ; 0xe56 <_printf_P+0x90>
} else
#endif /* LIGHTPRINTF */
if (ch=='0') {
f58: 00 33 cpi r16, 0x30 ; 48
f5a: 29 f4 brne .+10 ; 0xf66 <_printf_P+0x1a0>
/*
* ``Note that 0 is taken as a flag, not as the
* beginning of a field width.''
* -- ANSI X3J11
*/
if (!(flags & LADJUST))
f5c: 54 fc sbrc r5, 4
f5e: 76 cf rjmp .-276 ; 0xe4c <_printf_P+0x86>
flags |= ZEROPAD; /* '-' disables '0' */
f60: f0 e2 ldi r31, 0x20 ; 32
f62: 5f 2a or r5, r31
goto rflag;
f64: 73 cf rjmp .-282 ; 0xe4c <_printf_P+0x86>
} else if (ch>='1' && ch<='9') {
f66: 80 2f mov r24, r16
f68: 81 53 subi r24, 0x31 ; 49
f6a: 89 30 cpi r24, 0x09 ; 9
f6c: d8 f4 brcc .+54 ; 0xfa4 <_printf_P+0x1de>
n = 0;
f6e: 60 e0 ldi r22, 0x00 ; 0
f70: 70 e0 ldi r23, 0x00 ; 0
do {
n = 10 * n + to_digit(ch);
f72: cb 01 movw r24, r22
f74: e3 e0 ldi r30, 0x03 ; 3
f76: 88 0f add r24, r24
f78: 99 1f adc r25, r25
f7a: ea 95 dec r30
f7c: e1 f7 brne .-8 ; 0xf76 <_printf_P+0x1b0>
f7e: 86 0f add r24, r22
f80: 97 1f adc r25, r23
f82: 68 0f add r22, r24
f84: 79 1f adc r23, r25
f86: 60 0f add r22, r16
f88: 71 1d adc r23, r1
f8a: 60 53 subi r22, 0x30 ; 48
f8c: 70 40 sbci r23, 0x00 ; 0
ch = PRG_RDB(fmt++);
f8e: f5 01 movw r30, r10
f90: 08 94 sec
f92: a1 1c adc r10, r1
f94: b1 1c adc r11, r1
f96: 04 91 lpm r16, Z
} while (is_digit(ch));
f98: 80 2f mov r24, r16
f9a: 80 53 subi r24, 0x30 ; 48
f9c: 8a 30 cpi r24, 0x0A ; 10
f9e: 48 f3 brcs .-46 ; 0xf72 <_printf_P+0x1ac>
width = n;
fa0: 26 2e mov r2, r22
goto reswitch;
fa2: 59 cf rjmp .-334 ; 0xe56 <_printf_P+0x90>
} else if (ch=='h') {
fa4: 08 36 cpi r16, 0x68 ; 104
fa6: 19 f4 brne .+6 ; 0xfae <_printf_P+0x1e8>
flags |= SHORTINT;
fa8: 24 e0 ldi r18, 0x04 ; 4
faa: 52 2a or r5, r18
goto rflag;
fac: 4f cf rjmp .-354 ; 0xe4c <_printf_P+0x86>
} else if (ch=='l') {
fae: 0c 36 cpi r16, 0x6C ; 108
fb0: 19 f4 brne .+6 ; 0xfb8 <_printf_P+0x1f2>
flags |= LONGINT;
fb2: 31 e0 ldi r19, 0x01 ; 1
fb4: 53 2a or r5, r19
goto rflag;
fb6: 4a cf rjmp .-364 ; 0xe4c <_printf_P+0x86>
} else if (ch=='c') {
fb8: 03 36 cpi r16, 0x63 ; 99
fba: 61 f4 brne .+24 ; 0xfd4 <_printf_P+0x20e>
*(cp = buf) = va_arg(ap, int);
fbc: 4e 01 movw r8, r28
fbe: 08 94 sec
fc0: 81 1c adc r8, r1
fc2: 91 1c adc r9, r1
fc4: f3 01 movw r30, r6
fc6: 42 e0 ldi r20, 0x02 ; 2
fc8: 50 e0 ldi r21, 0x00 ; 0
fca: 64 0e add r6, r20
fcc: 75 1e adc r7, r21
fce: 80 81 ld r24, Z
fd0: 89 83 std Y+1, r24 ; 0x01
fd2: 1b c1 rjmp .+566 ; 0x120a <_printf_P+0x444>
size = 1;
sign = '\0';
} else if (ch=='D'||ch=='d'||ch=='i') {
fd4: 04 34 cpi r16, 0x44 ; 68
fd6: 21 f0 breq .+8 ; 0xfe0 <_printf_P+0x21a>
fd8: 04 36 cpi r16, 0x64 ; 100
fda: 11 f0 breq .+4 ; 0xfe0 <_printf_P+0x21a>
fdc: 09 36 cpi r16, 0x69 ; 105
fde: b1 f5 brne .+108 ; 0x104c <_printf_P+0x286>
if(ch=='D')
fe0: 04 34 cpi r16, 0x44 ; 68
fe2: 11 f4 brne .+4 ; 0xfe8 <_printf_P+0x222>
flags |= LONGINT;
fe4: 51 e0 ldi r21, 0x01 ; 1
fe6: 55 2a or r5, r21
if (flags&LONGINT) {
fe8: 50 fe sbrs r5, 0
fea: 0a c0 rjmp .+20 ; 0x1000 <_printf_P+0x23a>
_ulong=va_arg(ap, long);
fec: f3 01 movw r30, r6
fee: 84 e0 ldi r24, 0x04 ; 4
ff0: 90 e0 ldi r25, 0x00 ; 0
ff2: 68 0e add r6, r24
ff4: 79 1e adc r7, r25
ff6: 20 81 ld r18, Z
ff8: 31 81 ldd r19, Z+1 ; 0x01
ffa: 42 81 ldd r20, Z+2 ; 0x02
ffc: 53 81 ldd r21, Z+3 ; 0x03
ffe: 0c c0 rjmp .+24 ; 0x1018 <_printf_P+0x252>
} else {
register int _d;
_d=va_arg(ap, int);
1000: f3 01 movw r30, r6
1002: 42 e0 ldi r20, 0x02 ; 2
1004: 50 e0 ldi r21, 0x00 ; 0
1006: 64 0e add r6, r20
1008: 75 1e adc r7, r21
100a: 80 81 ld r24, Z
100c: 91 81 ldd r25, Z+1 ; 0x01
_ulong = flags&SHORTINT ? (long)(short)_d : (long)_d;
100e: 9c 01 movw r18, r24
1010: 44 27 eor r20, r20
1012: 37 fd sbrc r19, 7
1014: 40 95 com r20
1016: 54 2f mov r21, r20
1018: 2c a7 std Y+44, r18 ; 0x2c
101a: 3d a7 std Y+45, r19 ; 0x2d
101c: 4e a7 std Y+46, r20 ; 0x2e
101e: 5f a7 std Y+47, r21 ; 0x2f
}
if ((long)_ulong < 0) {
1020: 8c a5 ldd r24, Y+44 ; 0x2c
1022: 9d a5 ldd r25, Y+45 ; 0x2d
1024: ae a5 ldd r26, Y+46 ; 0x2e
1026: bf a5 ldd r27, Y+47 ; 0x2f
1028: b7 ff sbrs r27, 7
102a: 0d c0 rjmp .+26 ; 0x1046 <_printf_P+0x280>
_ulong = -_ulong;
102c: b0 95 com r27
102e: a0 95 com r26
1030: 90 95 com r25
1032: 81 95 neg r24
1034: 9f 4f sbci r25, 0xFF ; 255
1036: af 4f sbci r26, 0xFF ; 255
1038: bf 4f sbci r27, 0xFF ; 255
103a: 8c a7 std Y+44, r24 ; 0x2c
103c: 9d a7 std Y+45, r25 ; 0x2d
103e: ae a7 std Y+46, r26 ; 0x2e
1040: bf a7 std Y+47, r27 ; 0x2f
sign = '-';
1042: 8d e2 ldi r24, 0x2D ; 45
1044: 89 a7 std Y+41, r24 ; 0x29
}
base = DEC;
1046: 7a e0 ldi r23, 0x0A ; 10
1048: 47 2e mov r4, r23
goto number;
104a: 7b c0 rjmp .+246 ; 0x1142 <_printf_P+0x37c>
} else
/*
if (ch=='n') {
if (flags & LONGINT)
*va_arg(ap, long *) = ret;
else if (flags & SHORTINT)
*va_arg(ap, short *) = ret;
else
*va_arg(ap, int *) = ret;
continue; // no output
} else
*/
#ifndef LIGHTPRINTF
if (ch=='O'||ch=='o') {
104c: 0f 34 cpi r16, 0x4F ; 79
104e: 11 f0 breq .+4 ; 0x1054 <_printf_P+0x28e>
1050: 0f 36 cpi r16, 0x6F ; 111
1052: 39 f4 brne .+14 ; 0x1062 <_printf_P+0x29c>
if (ch=='O')
1054: 0f 34 cpi r16, 0x4F ; 79
1056: 11 f4 brne .+4 ; 0x105c <_printf_P+0x296>
flags |= LONGINT;
1058: 91 e0 ldi r25, 0x01 ; 1
105a: 59 2a or r5, r25
base = OCT;
105c: 68 e0 ldi r22, 0x08 ; 8
105e: 46 2e mov r4, r22
goto nosign;
1060: 6f c0 rjmp .+222 ; 0x1140 <_printf_P+0x37a>
} else if (ch=='p') {
1062: 00 37 cpi r16, 0x70 ; 112
1064: a1 f4 brne .+40 ; 0x108e <_printf_P+0x2c8>
/*
* ``The argument shall be a pointer to void. The
* value of the pointer is converted to a sequence
* of printable characters, in an implementation-
* defined manner.''
* -- ANSI X3J11
*/
/* NOSTRICT */
_ulong = (unsigned int)va_arg(ap, void *);
1066: f3 01 movw r30, r6
1068: a2 e0 ldi r26, 0x02 ; 2
106a: b0 e0 ldi r27, 0x00 ; 0
106c: 6a 0e add r6, r26
106e: 7b 1e adc r7, r27
1070: 80 81 ld r24, Z
1072: 91 81 ldd r25, Z+1 ; 0x01
1074: 9c 01 movw r18, r24
1076: 44 27 eor r20, r20
1078: 55 27 eor r21, r21
107a: 2c a7 std Y+44, r18 ; 0x2c
107c: 3d a7 std Y+45, r19 ; 0x2d
107e: 4e a7 std Y+46, r20 ; 0x2e
1080: 5f a7 std Y+47, r21 ; 0x2f
base = HEX;
1082: 50 e1 ldi r21, 0x10 ; 16
1084: 45 2e mov r4, r21
flags |= HEXPREFIX;
1086: 30 e4 ldi r19, 0x40 ; 64
1088: 53 2a or r5, r19
ch = 'x';
108a: 08 e7 ldi r16, 0x78 ; 120
goto nosign;
108c: 59 c0 rjmp .+178 ; 0x1140 <_printf_P+0x37a>
} else if (ch=='s') { // print a string from RAM
108e: 03 37 cpi r16, 0x73 ; 115
1090: c1 f5 brne .+112 ; 0x1102 <_printf_P+0x33c>
if ((cp = va_arg(ap, char *)) == NULL) {
1092: f3 01 movw r30, r6
1094: 42 e0 ldi r20, 0x02 ; 2
1096: 50 e0 ldi r21, 0x00 ; 0
1098: 64 0e add r6, r20
109a: 75 1e adc r7, r21
109c: 80 80 ld r8, Z
109e: 91 80 ldd r9, Z+1 ; 0x01
10a0: 81 14 cp r8, r1
10a2: 91 04 cpc r9, r1
10a4: 89 f4 brne .+34 ; 0x10c8 <_printf_P+0x302>
cp=buf;
10a6: 4e 01 movw r8, r28
10a8: 08 94 sec
10aa: 81 1c adc r8, r1
10ac: 91 1c adc r9, r1
cp[0] = '(';
10ae: 88 e2 ldi r24, 0x28 ; 40
10b0: 89 83 std Y+1, r24 ; 0x01
cp[1] = 'n';
10b2: 8e e6 ldi r24, 0x6E ; 110
10b4: f4 01 movw r30, r8
10b6: 81 83 std Z+1, r24 ; 0x01
cp[2] = 'u';
10b8: 85 e7 ldi r24, 0x75 ; 117
10ba: 8b 83 std Y+3, r24 ; 0x03
cp[4] = cp[3] = 'l';
10bc: 8c e6 ldi r24, 0x6C ; 108
10be: 8c 83 std Y+4, r24 ; 0x04
10c0: 8d 83 std Y+5, r24 ; 0x05
cp[5] = ')';
10c2: 89 e2 ldi r24, 0x29 ; 41
10c4: 8e 83 std Y+6, r24 ; 0x06
cp[6] = '\0';
10c6: 1f 82 std Y+7, r1 ; 0x07
}
if (prec >= 0) {
10c8: 17 fd sbrc r17, 7
10ca: 13 c0 rjmp .+38 ; 0x10f2 <_printf_P+0x32c>
/*
* can't use strlen; can only look for the
* NUL in the first `prec' characters, and
* strlen() will go further.
*/
char *p = (char*)memchr(cp, 0, prec);
10cc: 81 2f mov r24, r17
10ce: 99 27 eor r25, r25
10d0: 87 fd sbrc r24, 7
10d2: 90 95 com r25
10d4: ac 01 movw r20, r24
10d6: 60 e0 ldi r22, 0x00 ; 0
10d8: 70 e0 ldi r23, 0x00 ; 0
10da: c4 01 movw r24, r8
10dc: 0e 94 64 0c call 0x18c8 <memchr>
 
if (p != NULL) {
10e0: 00 97 sbiw r24, 0x00 ; 0
10e2: 29 f0 breq .+10 ; 0x10ee <_printf_P+0x328>
size = p - cp;
10e4: d8 2e mov r13, r24
10e6: d8 18 sub r13, r8
if (size > prec)
10e8: 1d 15 cp r17, r13
10ea: 0c f0 brlt .+2 ; 0x10ee <_printf_P+0x328>
10ec: 90 c0 rjmp .+288 ; 0x120e <_printf_P+0x448>
size = prec;
} else
size = prec;
10ee: d1 2e mov r13, r17
10f0: 8e c0 rjmp .+284 ; 0x120e <_printf_P+0x448>
} else
size = strlen(cp);
10f2: f4 01 movw r30, r8
10f4: 01 90 ld r0, Z+
10f6: 00 20 and r0, r0
10f8: e9 f7 brne .-6 ; 0x10f4 <_printf_P+0x32e>
10fa: 31 97 sbiw r30, 0x01 ; 1
10fc: de 2e mov r13, r30
10fe: d8 18 sub r13, r8
1100: 86 c0 rjmp .+268 ; 0x120e <_printf_P+0x448>
sign = '\0';
} else
#endif /* LIGHTPRINTF */
if(ch=='U'||ch=='u') {
1102: 05 35 cpi r16, 0x55 ; 85
1104: 11 f0 breq .+4 ; 0x110a <_printf_P+0x344>
1106: 05 37 cpi r16, 0x75 ; 117
1108: 39 f4 brne .+14 ; 0x1118 <_printf_P+0x352>
if (ch=='U')
110a: 05 35 cpi r16, 0x55 ; 85
110c: 11 f4 brne .+4 ; 0x1112 <_printf_P+0x34c>
flags |= LONGINT;
110e: f1 e0 ldi r31, 0x01 ; 1
1110: 5f 2a or r5, r31
base = DEC;
1112: 4a e0 ldi r20, 0x0A ; 10
1114: 44 2e mov r4, r20
goto nosign;
1116: 14 c0 rjmp .+40 ; 0x1140 <_printf_P+0x37a>
} else if (ch=='X'||ch=='x') {
1118: 08 35 cpi r16, 0x58 ; 88
111a: 19 f0 breq .+6 ; 0x1122 <_printf_P+0x35c>
111c: 08 37 cpi r16, 0x78 ; 120
111e: 09 f0 breq .+2 ; 0x1122 <_printf_P+0x35c>
1120: 6c c0 rjmp .+216 ; 0x11fa <_printf_P+0x434>
base = HEX;
1122: 30 e1 ldi r19, 0x10 ; 16
1124: 43 2e mov r4, r19
/* leading 0x/X only if non-zero */
if (flags & ALT && _ulong != 0)
1126: 53 fe sbrs r5, 3
1128: 0b c0 rjmp .+22 ; 0x1140 <_printf_P+0x37a>
112a: 2c a5 ldd r18, Y+44 ; 0x2c
112c: 3d a5 ldd r19, Y+45 ; 0x2d
112e: 4e a5 ldd r20, Y+46 ; 0x2e
1130: 5f a5 ldd r21, Y+47 ; 0x2f
1132: 21 15 cp r18, r1
1134: 31 05 cpc r19, r1
1136: 41 05 cpc r20, r1
1138: 51 05 cpc r21, r1
113a: 11 f0 breq .+4 ; 0x1140 <_printf_P+0x37a>
flags |= HEXPREFIX;
113c: 30 e4 ldi r19, 0x40 ; 64
113e: 53 2a or r5, r19
 
/* unsigned conversions */
nosign: sign = '\0';
1140: 19 a6 std Y+41, r1 ; 0x29
/*
* ``... diouXx conversions ... if a precision is
* specified, the 0 flag will be ignored.''
* -- ANSI X3J11
*/
number: if ((dprec = prec) >= 0)
1142: 18 ab std Y+48, r17 ; 0x30
1144: 17 fd sbrc r17, 7
1146: 02 c0 rjmp .+4 ; 0x114c <_printf_P+0x386>
flags &= ~ZEROPAD;
1148: 4f ed ldi r20, 0xDF ; 223
114a: 54 22 and r5, r20
 
/*
* ``The result of converting a zero value with an
* explicit precision of zero is no characters.''
* -- ANSI X3J11
*/
cp = buf + BUF;
114c: 29 e2 ldi r18, 0x29 ; 41
114e: 82 2e mov r8, r18
1150: 91 2c mov r9, r1
1152: 8c 0e add r8, r28
1154: 9d 1e adc r9, r29
if (_ulong != 0 || prec != 0) {
1156: 8c a5 ldd r24, Y+44 ; 0x2c
1158: 9d a5 ldd r25, Y+45 ; 0x2d
115a: ae a5 ldd r26, Y+46 ; 0x2e
115c: bf a5 ldd r27, Y+47 ; 0x2f
115e: 00 97 sbiw r24, 0x00 ; 0
1160: a1 05 cpc r26, r1
1162: b1 05 cpc r27, r1
1164: 21 f4 brne .+8 ; 0x116e <_printf_P+0x3a8>
1166: 98 a9 ldd r25, Y+48 ; 0x30
1168: 99 23 and r25, r25
116a: 09 f4 brne .+2 ; 0x116e <_printf_P+0x3a8>
116c: 3f c0 rjmp .+126 ; 0x11ec <_printf_P+0x426>
116e: c4 2c mov r12, r4
1170: dd 24 eor r13, r13
1172: ee 24 eor r14, r14
1174: ff 24 eor r15, r15
register unsigned char _d,notlastdigit;
do {
notlastdigit=(_ulong>=base);
1176: 33 24 eor r3, r3
1178: 2c a5 ldd r18, Y+44 ; 0x2c
117a: 3d a5 ldd r19, Y+45 ; 0x2d
117c: 4e a5 ldd r20, Y+46 ; 0x2e
117e: 5f a5 ldd r21, Y+47 ; 0x2f
1180: 2c 15 cp r18, r12
1182: 3d 05 cpc r19, r13
1184: 4e 05 cpc r20, r14
1186: 5f 05 cpc r21, r15
1188: 10 f0 brcs .+4 ; 0x118e <_printf_P+0x3c8>
118a: 91 e0 ldi r25, 0x01 ; 1
118c: 39 2e mov r3, r25
_d = _ulong % base;
118e: 6c a5 ldd r22, Y+44 ; 0x2c
1190: 7d a5 ldd r23, Y+45 ; 0x2d
1192: 8e a5 ldd r24, Y+46 ; 0x2e
1194: 9f a5 ldd r25, Y+47 ; 0x2f
1196: a7 01 movw r20, r14
1198: 96 01 movw r18, r12
119a: 0e 94 d4 0d call 0x1ba8 <__udivmodsi4>
119e: dc 01 movw r26, r24
11a0: cb 01 movw r24, r22
11a2: 18 2f mov r17, r24
 
if (_d<10) {
11a4: 8a 30 cpi r24, 0x0A ; 10
11a6: 10 f4 brcc .+4 ; 0x11ac <_printf_P+0x3e6>
_d+='0';
11a8: 10 5d subi r17, 0xD0 ; 208
11aa: 04 c0 rjmp .+8 ; 0x11b4 <_printf_P+0x3ee>
} else {
_d+='a'-10;
11ac: 19 5a subi r17, 0xA9 ; 169
if (ch=='X') _d&=~0x20;
11ae: 08 35 cpi r16, 0x58 ; 88
11b0: 09 f4 brne .+2 ; 0x11b4 <_printf_P+0x3ee>
11b2: 1f 7d andi r17, 0xDF ; 223
}
*--cp=_d;
11b4: d4 01 movw r26, r8
11b6: 1e 93 st -X, r17
11b8: 4d 01 movw r8, r26
_ulong /= base;
11ba: 6c a5 ldd r22, Y+44 ; 0x2c
11bc: 7d a5 ldd r23, Y+45 ; 0x2d
11be: 8e a5 ldd r24, Y+46 ; 0x2e
11c0: 9f a5 ldd r25, Y+47 ; 0x2f
11c2: a7 01 movw r20, r14
11c4: 96 01 movw r18, r12
11c6: 0e 94 d4 0d call 0x1ba8 <__udivmodsi4>
11ca: 2c a7 std Y+44, r18 ; 0x2c
11cc: 3d a7 std Y+45, r19 ; 0x2d
11ce: 4e a7 std Y+46, r20 ; 0x2e
11d0: 5f a7 std Y+47, r21 ; 0x2f
} while (notlastdigit);
11d2: 33 20 and r3, r3
11d4: 81 f6 brne .-96 ; 0x1176 <_printf_P+0x3b0>
#ifndef LIGHTPRINTF
// handle octal leading 0
if (base==OCT && flags & ALT && *cp != '0')
11d6: b8 e0 ldi r27, 0x08 ; 8
11d8: 4b 16 cp r4, r27
11da: 41 f4 brne .+16 ; 0x11ec <_printf_P+0x426>
11dc: 53 fe sbrs r5, 3
11de: 06 c0 rjmp .+12 ; 0x11ec <_printf_P+0x426>
11e0: 10 33 cpi r17, 0x30 ; 48
11e2: 21 f0 breq .+8 ; 0x11ec <_printf_P+0x426>
*--cp = '0';
11e4: 80 e3 ldi r24, 0x30 ; 48
11e6: f4 01 movw r30, r8
11e8: 82 93 st -Z, r24
11ea: 4f 01 movw r8, r30
#endif
}
 
size = buf + BUF - cp;
11ec: ce 01 movw r24, r28
11ee: 01 96 adiw r24, 0x01 ; 1
11f0: d8 2e mov r13, r24
11f2: d8 18 sub r13, r8
11f4: f8 e2 ldi r31, 0x28 ; 40
11f6: df 0e add r13, r31
11f8: 0b c0 rjmp .+22 ; 0x1210 <_printf_P+0x44a>
} else { //default
/* "%?" prints ?, unless ? is NUL */
if (ch == '\0')
11fa: 00 23 and r16, r16
11fc: 09 f4 brne .+2 ; 0x1200 <_printf_P+0x43a>
11fe: 4e c0 rjmp .+156 ; 0x129c <_printf_P+0x4d6>
goto done;
/* pretend it was %c with argument ch */
cp = buf;
1200: 4e 01 movw r8, r28
1202: 08 94 sec
1204: 81 1c adc r8, r1
1206: 91 1c adc r9, r1
*cp = ch;
1208: 09 83 std Y+1, r16 ; 0x01
size = 1;
120a: 81 e0 ldi r24, 0x01 ; 1
120c: d8 2e mov r13, r24
sign = '\0';
120e: 19 a6 std Y+41, r1 ; 0x29
}
 
/*
* All reasonable formats wind up here. At this point,
* `cp' points to a string which (if not flags&LADJUST)
* should be padded out to `width' places. If
* flags&ZEROPAD, it should first be prefixed by any
* sign or other prefix; otherwise, it should be blank
* padded before the prefix is emitted. After any
* left-hand padding and prefixing, emit zeroes
* required by a decimal [diouxX] precision, then print
* the string proper, then emit zeroes required by any
* leftover floating precision; finally, if LADJUST,
* pad with blanks.
*/
 
/*
* compute actual size, so we know how much to pad.
*/
fieldsz = size;
1210: 1d 2d mov r17, r13
 
dpad = dprec - size;
1212: c8 a8 ldd r12, Y+48 ; 0x30
1214: cd 18 sub r12, r13
if (dpad < 0)
1216: c7 fc sbrc r12, 7
dpad = 0;
1218: cc 24 eor r12, r12
 
if (sign)
121a: 89 a5 ldd r24, Y+41 ; 0x29
121c: 88 23 and r24, r24
121e: 11 f0 breq .+4 ; 0x1224 <_printf_P+0x45e>
fieldsz++;
1220: 1f 5f subi r17, 0xFF ; 255
1222: 02 c0 rjmp .+4 ; 0x1228 <_printf_P+0x462>
else if (flags & HEXPREFIX)
1224: 56 fc sbrc r5, 6
fieldsz += 2;
1226: 1e 5f subi r17, 0xFE ; 254
fieldsz += dpad;
1228: 1c 0d add r17, r12
 
/* right-adjusting blank padding */
if ((flags & (LADJUST|ZEROPAD)) == 0)
122a: e5 2c mov r14, r5
122c: ff 24 eor r15, r15
122e: c7 01 movw r24, r14
1230: 80 73 andi r24, 0x30 ; 48
1232: 90 70 andi r25, 0x00 ; 0
1234: 89 2b or r24, r25
1236: 21 f4 brne .+8 ; 0x1240 <_printf_P+0x47a>
PAD_SP(width - fieldsz);
1238: 82 2d mov r24, r2
123a: 81 1b sub r24, r17
123c: 0e 94 cb 06 call 0xd96 <PAD_SP>
 
/* prefix */
if (sign) {
1240: 89 a5 ldd r24, Y+41 ; 0x29
1242: 88 23 and r24, r24
1244: 29 f0 breq .+10 ; 0x1250 <_printf_P+0x48a>
PRINT(&sign, 1);
1246: 61 e0 ldi r22, 0x01 ; 1
1248: 70 e0 ldi r23, 0x00 ; 0
124a: ce 01 movw r24, r28
124c: 89 96 adiw r24, 0x29 ; 41
124e: 09 c0 rjmp .+18 ; 0x1262 <_printf_P+0x49c>
} else if (flags & HEXPREFIX) {
1250: e6 fe sbrs r14, 6
1252: 09 c0 rjmp .+18 ; 0x1266 <_printf_P+0x4a0>
ox[0] = '0';
1254: 80 e3 ldi r24, 0x30 ; 48
1256: 8a a7 std Y+42, r24 ; 0x2a
ox[1] = ch;
1258: 0b a7 std Y+43, r16 ; 0x2b
PRINT(ox, 2);
125a: 62 e0 ldi r22, 0x02 ; 2
125c: 70 e0 ldi r23, 0x00 ; 0
125e: ce 01 movw r24, r28
1260: 8a 96 adiw r24, 0x2a ; 42
1262: 0e 94 a2 06 call 0xd44 <PRINT>
}
 
/* right-adjusting zero padding */
if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD)
1266: c7 01 movw r24, r14
1268: 80 73 andi r24, 0x30 ; 48
126a: 90 70 andi r25, 0x00 ; 0
126c: 80 97 sbiw r24, 0x20 ; 32
126e: 21 f4 brne .+8 ; 0x1278 <_printf_P+0x4b2>
PAD_0(width - fieldsz);
1270: 82 2d mov r24, r2
1272: 81 1b sub r24, r17
1274: 0e 94 d7 06 call 0xdae <PAD_0>
 
/* leading zeroes from decimal precision */
PAD_0(dpad);
1278: 8c 2d mov r24, r12
127a: 0e 94 d7 06 call 0xdae <PAD_0>
 
/* the string or number proper */
PRINT(cp, size);
127e: 8d 2d mov r24, r13
1280: 99 27 eor r25, r25
1282: 87 fd sbrc r24, 7
1284: 90 95 com r25
1286: bc 01 movw r22, r24
1288: c4 01 movw r24, r8
128a: 0e 94 a2 06 call 0xd44 <PRINT>
 
/* left-adjusting padding (always blank) */
if (flags & LADJUST)
128e: e4 fe sbrs r14, 4
1290: c1 cd rjmp .-1150 ; 0xe14 <_printf_P+0x4e>
PAD_SP(width - fieldsz);
1292: 82 2d mov r24, r2
1294: 81 1b sub r24, r17
1296: 0e 94 cb 06 call 0xd96 <PAD_SP>
129a: bc cd rjmp .-1160 ; 0xe14 <_printf_P+0x4e>
129c: e0 96 adiw r28, 0x30 ; 48
129e: 0f b6 in r0, 0x3f ; 63
12a0: f8 94 cli
12a2: de bf out 0x3e, r29 ; 62
12a4: 0f be out 0x3f, r0 ; 63
12a6: cd bf out 0x3d, r28 ; 61
12a8: df 91 pop r29
12aa: cf 91 pop r28
12ac: 1f 91 pop r17
12ae: 0f 91 pop r16
12b0: ff 90 pop r15
12b2: ef 90 pop r14
12b4: df 90 pop r13
12b6: cf 90 pop r12
12b8: bf 90 pop r11
12ba: af 90 pop r10
12bc: 9f 90 pop r9
12be: 8f 90 pop r8
12c0: 7f 90 pop r7
12c2: 6f 90 pop r6
12c4: 5f 90 pop r5
12c6: 4f 90 pop r4
12c8: 3f 90 pop r3
12ca: 2f 90 pop r2
12cc: 08 95 ret
 
000012ce <__vector_9>:
};
 
 
SIGNAL (SIG_OVERFLOW1)
{
12ce: 1f 92 push r1
12d0: 0f 92 push r0
12d2: 0f b6 in r0, 0x3f ; 63
12d4: 0f 92 push r0
12d6: 11 24 eor r1, r1
12d8: 8f 93 push r24
12da: 9f 93 push r25
static unsigned char cnt_10ms = 0;
TCNT1 -= TIMER_RELOAD_VALUE;
12dc: 8c b5 in r24, 0x2c ; 44
12de: 9d b5 in r25, 0x2d ; 45
12e0: 8a 5f subi r24, 0xFA ; 250
12e2: 90 40 sbci r25, 0x00 ; 0
12e4: 9d bd out 0x2d, r25 ; 45
12e6: 8c bd out 0x2c, r24 ; 44
CountMilliseconds++;
12e8: 80 91 a5 00 lds r24, 0x00A5
12ec: 90 91 a6 00 lds r25, 0x00A6
12f0: 01 96 adiw r24, 0x01 ; 1
12f2: 90 93 a6 00 sts 0x00A6, r25
12f6: 80 93 a5 00 sts 0x00A5, r24
if(DisplayBusy) DisplayBusy--;
12fa: 80 91 93 00 lds r24, 0x0093
12fe: 88 23 and r24, r24
1300: 29 f0 breq .+10 ; 0x130c <__vector_9+0x3e>
1302: 80 91 93 00 lds r24, 0x0093
1306: 81 50 subi r24, 0x01 ; 1
1308: 80 93 93 00 sts 0x0093, r24
if(LoescheIrCodeTimer)
130c: 80 91 7c 00 lds r24, 0x007C
1310: 90 91 7d 00 lds r25, 0x007D
1314: 00 97 sbiw r24, 0x00 ; 0
1316: 59 f0 breq .+22 ; 0x132e <__vector_9+0x60>
{
if(--LoescheIrCodeTimer == 0) IR_Code = 0;
1318: 01 97 sbiw r24, 0x01 ; 1
131a: 90 93 7d 00 sts 0x007D, r25
131e: 80 93 7c 00 sts 0x007C, r24
1322: 00 97 sbiw r24, 0x00 ; 0
1324: 21 f4 brne .+8 ; 0x132e <__vector_9+0x60>
1326: 90 93 c8 01 sts 0x01C8, r25
132a: 80 93 c7 01 sts 0x01C7, r24
132e: 9f 91 pop r25
1330: 8f 91 pop r24
1332: 0f 90 pop r0
1334: 0f be out 0x3f, r0 ; 63
1336: 0f 90 pop r0
1338: 1f 90 pop r1
133a: 18 95 reti
 
0000133c <Timer1_Init>:
}
}
 
 
void Timer1_Init(void)
{
 
TCCR1B = TIMER_TEILER;
133c: 83 e0 ldi r24, 0x03 ; 3
133e: 8e bd out 0x2e, r24 ; 46
TCNT1 = -TIMER_RELOAD_VALUE; // reload
1340: 86 e0 ldi r24, 0x06 ; 6
1342: 9f ef ldi r25, 0xFF ; 255
1344: 9d bd out 0x2d, r25 ; 45
1346: 8c bd out 0x2c, r24 ; 44
//OCR1 = 0x00;
// Timer(s)/Counter(s) Interrupt(s) initialization
#if defined (__AVR_ATmega32__)
TIMSK |= 0x04;
1348: 89 b7 in r24, 0x39 ; 57
134a: 84 60 ori r24, 0x04 ; 4
134c: 89 bf out 0x39, r24 ; 57
134e: 08 95 ret
 
00001350 <SetDelay>:
#endif
 
#if defined (__AVR_ATmega644__)
TIMSK1 |= _BV(TOIE1);
#endif
}
 
 
unsigned int SetDelay (unsigned int t)
{
return(CountMilliseconds + t - 1);
1350: 20 91 a5 00 lds r18, 0x00A5
1354: 30 91 a6 00 lds r19, 0x00A6
1358: 28 0f add r18, r24
135a: 39 1f adc r19, r25
}
135c: c9 01 movw r24, r18
135e: 01 97 sbiw r24, 0x01 ; 1
1360: 08 95 ret
 
00001362 <CheckDelay>:
 
char CheckDelay (unsigned int t)
{
return(((t - CountMilliseconds) & 0x8000) >> 8);
1362: 20 91 a5 00 lds r18, 0x00A5
1366: 30 91 a6 00 lds r19, 0x00A6
136a: 82 1b sub r24, r18
136c: 93 0b sbc r25, r19
136e: 89 2f mov r24, r25
1370: 99 27 eor r25, r25
1372: 80 78 andi r24, 0x80 ; 128
}
1374: 99 27 eor r25, r25
1376: 08 95 ret
 
00001378 <Delay_ms>:
 
void Delay_ms(unsigned int w)
{
1378: cf 93 push r28
137a: df 93 push r29
unsigned int akt;
akt = SetDelay(w);
137c: 0e 94 a8 09 call 0x1350 <SetDelay>
1380: ec 01 movw r28, r24
while (!CheckDelay(akt));
1382: ce 01 movw r24, r28
1384: 0e 94 b1 09 call 0x1362 <CheckDelay>
1388: 88 23 and r24, r24
138a: d9 f3 breq .-10 ; 0x1382 <Delay_ms+0xa>
138c: df 91 pop r29
138e: cf 91 pop r28
1390: 08 95 ret
 
00001392 <Keyboard_Init>:
unsigned int KeyTimer = 0;
 
void Keyboard_Init(void)
{
KeyTimer = SetDelay(KEY_DELAY_MS);
1392: 82 e3 ldi r24, 0x32 ; 50
1394: 90 e0 ldi r25, 0x00 ; 0
1396: 0e 94 a8 09 call 0x1350 <SetDelay>
139a: 90 93 a9 00 sts 0x00A9, r25
139e: 80 93 a8 00 sts 0x00A8, r24
13a2: 08 95 ret
 
000013a4 <GetKeyboard>:
}
 
unsigned char GetKeyboard(void)
{
13a4: cf 93 push r28
static char taste1 = 0, taste2 = 0,taste3 = 0,taste4 = 0,taste5 = 0;
unsigned char ret = 0;
13a6: c0 e0 ldi r28, 0x00 ; 0
if(CheckDelay(KeyTimer))
13a8: 80 91 a8 00 lds r24, 0x00A8
13ac: 90 91 a9 00 lds r25, 0x00A9
13b0: 0e 94 b1 09 call 0x1362 <CheckDelay>
13b4: 88 23 and r24, r24
13b6: 09 f4 brne .+2 ; 0x13ba <GetKeyboard+0x16>
13b8: 76 c0 rjmp .+236 ; 0x14a6 <GetKeyboard+0x102>
{
if(_TASTE1) { if(taste1++ == 0 || taste1 == CNT_TASTE) ret |= KEY1; if(taste1 == CNT_TASTE) taste1 = CNT_TASTE-CNT_TASTE/3;} else taste1 = 0;
13ba: cf 9b sbis 0x19, 7 ; 25
13bc: 12 c0 rjmp .+36 ; 0x13e2 <GetKeyboard+0x3e>
13be: 80 91 aa 00 lds r24, 0x00AA
13c2: 8f 5f subi r24, 0xFF ; 255
13c4: 80 93 aa 00 sts 0x00AA, r24
13c8: 81 30 cpi r24, 0x01 ; 1
13ca: 11 f0 breq .+4 ; 0x13d0 <GetKeyboard+0x2c>
13cc: 8a 30 cpi r24, 0x0A ; 10
13ce: 09 f4 brne .+2 ; 0x13d2 <GetKeyboard+0x2e>
13d0: c1 e0 ldi r28, 0x01 ; 1
13d2: 80 91 aa 00 lds r24, 0x00AA
13d6: 8a 30 cpi r24, 0x0A ; 10
13d8: 31 f4 brne .+12 ; 0x13e6 <GetKeyboard+0x42>
13da: 87 e0 ldi r24, 0x07 ; 7
13dc: 80 93 aa 00 sts 0x00AA, r24
13e0: 02 c0 rjmp .+4 ; 0x13e6 <GetKeyboard+0x42>
13e2: c0 93 aa 00 sts 0x00AA, r28
if(_TASTE2) { if(taste2++ == 0 || taste2 == CNT_TASTE) ret |= KEY2; if(taste2 == CNT_TASTE) taste2 = CNT_TASTE-CNT_TASTE/3;} else taste2 = 0;
13e6: ce 9b sbis 0x19, 6 ; 25
13e8: 12 c0 rjmp .+36 ; 0x140e <GetKeyboard+0x6a>
13ea: 80 91 ab 00 lds r24, 0x00AB
13ee: 8f 5f subi r24, 0xFF ; 255
13f0: 80 93 ab 00 sts 0x00AB, r24
13f4: 81 30 cpi r24, 0x01 ; 1
13f6: 11 f0 breq .+4 ; 0x13fc <GetKeyboard+0x58>
13f8: 8a 30 cpi r24, 0x0A ; 10
13fa: 09 f4 brne .+2 ; 0x13fe <GetKeyboard+0x5a>
13fc: c2 60 ori r28, 0x02 ; 2
13fe: 80 91 ab 00 lds r24, 0x00AB
1402: 8a 30 cpi r24, 0x0A ; 10
1404: 31 f4 brne .+12 ; 0x1412 <GetKeyboard+0x6e>
1406: 87 e0 ldi r24, 0x07 ; 7
1408: 80 93 ab 00 sts 0x00AB, r24
140c: 02 c0 rjmp .+4 ; 0x1412 <GetKeyboard+0x6e>
140e: 10 92 ab 00 sts 0x00AB, r1
if(_TASTE3) { if(taste3++ == 0 || taste3 == CNT_TASTE) ret |= KEY3; if(taste3 == CNT_TASTE) taste3 = CNT_TASTE-CNT_TASTE/3;} else taste3 = 0;
1412: cd 9b sbis 0x19, 5 ; 25
1414: 12 c0 rjmp .+36 ; 0x143a <GetKeyboard+0x96>
1416: 80 91 ac 00 lds r24, 0x00AC
141a: 8f 5f subi r24, 0xFF ; 255
141c: 80 93 ac 00 sts 0x00AC, r24
1420: 81 30 cpi r24, 0x01 ; 1
1422: 11 f0 breq .+4 ; 0x1428 <GetKeyboard+0x84>
1424: 8a 30 cpi r24, 0x0A ; 10
1426: 09 f4 brne .+2 ; 0x142a <GetKeyboard+0x86>
1428: c4 60 ori r28, 0x04 ; 4
142a: 80 91 ac 00 lds r24, 0x00AC
142e: 8a 30 cpi r24, 0x0A ; 10
1430: 31 f4 brne .+12 ; 0x143e <GetKeyboard+0x9a>
1432: 87 e0 ldi r24, 0x07 ; 7
1434: 80 93 ac 00 sts 0x00AC, r24
1438: 02 c0 rjmp .+4 ; 0x143e <GetKeyboard+0x9a>
143a: 10 92 ac 00 sts 0x00AC, r1
if(_TASTE4) { if(taste4++ == 0 || taste4 == CNT_TASTE) ret |= KEY4; if(taste4 == CNT_TASTE) taste4 = CNT_TASTE-CNT_TASTE/3;} else taste4 = 0;
143e: cc 9b sbis 0x19, 4 ; 25
1440: 12 c0 rjmp .+36 ; 0x1466 <GetKeyboard+0xc2>
1442: 80 91 ad 00 lds r24, 0x00AD
1446: 8f 5f subi r24, 0xFF ; 255
1448: 80 93 ad 00 sts 0x00AD, r24
144c: 81 30 cpi r24, 0x01 ; 1
144e: 11 f0 breq .+4 ; 0x1454 <GetKeyboard+0xb0>
1450: 8a 30 cpi r24, 0x0A ; 10
1452: 09 f4 brne .+2 ; 0x1456 <GetKeyboard+0xb2>
1454: c8 60 ori r28, 0x08 ; 8
1456: 80 91 ad 00 lds r24, 0x00AD
145a: 8a 30 cpi r24, 0x0A ; 10
145c: 31 f4 brne .+12 ; 0x146a <GetKeyboard+0xc6>
145e: 87 e0 ldi r24, 0x07 ; 7
1460: 80 93 ad 00 sts 0x00AD, r24
1464: 02 c0 rjmp .+4 ; 0x146a <GetKeyboard+0xc6>
1466: 10 92 ad 00 sts 0x00AD, r1
if(_TASTE5) { if(taste5++ == 0 || taste5 == CNT_TASTE) ret |= KEY5; if(taste5 == CNT_TASTE) taste5 = CNT_TASTE-CNT_TASTE/3;} else taste5 = 0;
146a: cb 9b sbis 0x19, 3 ; 25
146c: 12 c0 rjmp .+36 ; 0x1492 <GetKeyboard+0xee>
146e: 80 91 ae 00 lds r24, 0x00AE
1472: 8f 5f subi r24, 0xFF ; 255
1474: 80 93 ae 00 sts 0x00AE, r24
1478: 81 30 cpi r24, 0x01 ; 1
147a: 11 f0 breq .+4 ; 0x1480 <GetKeyboard+0xdc>
147c: 8a 30 cpi r24, 0x0A ; 10
147e: 09 f4 brne .+2 ; 0x1482 <GetKeyboard+0xde>
1480: c0 61 ori r28, 0x10 ; 16
1482: 80 91 ae 00 lds r24, 0x00AE
1486: 8a 30 cpi r24, 0x0A ; 10
1488: 31 f4 brne .+12 ; 0x1496 <GetKeyboard+0xf2>
148a: 87 e0 ldi r24, 0x07 ; 7
148c: 80 93 ae 00 sts 0x00AE, r24
1490: 02 c0 rjmp .+4 ; 0x1496 <GetKeyboard+0xf2>
1492: 10 92 ae 00 sts 0x00AE, r1
KeyTimer = SetDelay(KEY_DELAY_MS);
1496: 82 e3 ldi r24, 0x32 ; 50
1498: 90 e0 ldi r25, 0x00 ; 0
149a: 0e 94 a8 09 call 0x1350 <SetDelay>
149e: 90 93 a9 00 sts 0x00A9, r25
14a2: 80 93 a8 00 sts 0x00A8, r24
}
return(ret);
}
14a6: 8c 2f mov r24, r28
14a8: 99 27 eor r25, r25
14aa: cf 91 pop r28
14ac: 08 95 ret
 
000014ae <GetKeyboard2>:
 
unsigned char GetKeyboard2(void)
{
unsigned char ret = 0;
14ae: 80 e0 ldi r24, 0x00 ; 0
if(_TASTE1) ret |= KEY1;
14b0: cf 99 sbic 0x19, 7 ; 25
14b2: 81 e0 ldi r24, 0x01 ; 1
if(_TASTE2) ret |= KEY2;
14b4: ce 99 sbic 0x19, 6 ; 25
14b6: 82 60 ori r24, 0x02 ; 2
if(_TASTE3) ret |= KEY3;
14b8: cd 99 sbic 0x19, 5 ; 25
14ba: 84 60 ori r24, 0x04 ; 4
if(_TASTE4) ret |= KEY4;
14bc: cc 99 sbic 0x19, 4 ; 25
14be: 88 60 ori r24, 0x08 ; 8
if(_TASTE5) ret |= KEY5;
14c0: cb 99 sbic 0x19, 3 ; 25
14c2: 80 61 ori r24, 0x10 ; 16
return(ret);
}
14c4: 99 27 eor r25, r25
14c6: 08 95 ret
 
000014c8 <Menu>:
unsigned char KanalVon[MAX_KANAL];
unsigned char KanalAn[MAX_KANAL];
 
void Menu(unsigned char key)
{
14c8: 0f 93 push r16
14ca: 1f 93 push r17
14cc: cf 93 push r28
14ce: df 93 push r29
static unsigned int arr = 0;
static unsigned char MaxMenue = 2,MenuePunkt=0;
unsigned char kanal = 0;
if(key & KEY1) { if(MenuePunkt) MenuePunkt--; else MenuePunkt = MaxMenue; LCD_Clear; }
14d0: c8 2f mov r28, r24
14d2: dd 27 eor r29, r29
14d4: c0 ff sbrs r28, 0
14d6: 0f c0 rjmp .+30 ; 0x14f6 <Menu+0x2e>
14d8: 80 91 b3 00 lds r24, 0x00B3
14dc: 88 23 and r24, r24
14de: 11 f0 breq .+4 ; 0x14e4 <Menu+0x1c>
14e0: 81 50 subi r24, 0x01 ; 1
14e2: 02 c0 rjmp .+4 ; 0x14e8 <Menu+0x20>
14e4: 80 91 7b 00 lds r24, 0x007B
14e8: 80 93 b3 00 sts 0x00B3, r24
14ec: 81 e0 ldi r24, 0x01 ; 1
14ee: 0e 94 e1 05 call 0xbc2 <_lcd_write_command>
14f2: 0e 94 c9 05 call 0xb92 <_long_delay>
if(key & KEY2) { MenuePunkt++; LCD_Clear; }
14f6: 8e 01 movw r16, r28
14f8: 02 70 andi r16, 0x02 ; 2
14fa: 10 70 andi r17, 0x00 ; 0
14fc: c1 ff sbrs r28, 1
14fe: 0a c0 rjmp .+20 ; 0x1514 <Menu+0x4c>
1500: 80 91 b3 00 lds r24, 0x00B3
1504: 8f 5f subi r24, 0xFF ; 255
1506: 80 93 b3 00 sts 0x00B3, r24
150a: 81 e0 ldi r24, 0x01 ; 1
150c: 0e 94 e1 05 call 0xbc2 <_lcd_write_command>
1510: 0e 94 c9 05 call 0xb92 <_long_delay>
if((key & KEY1) && (key & KEY2)) MenuePunkt = 0;
1514: c0 ff sbrs r28, 0
1516: 04 c0 rjmp .+8 ; 0x1520 <Menu+0x58>
1518: 01 2b or r16, r17
151a: 11 f0 breq .+4 ; 0x1520 <Menu+0x58>
151c: 10 92 b3 00 sts 0x00B3, r1
// LCD_printfxy(13,0,"[%i]",MenuePunkt);
switch(MenuePunkt)
1520: 20 91 b3 00 lds r18, 0x00B3
1524: 82 2f mov r24, r18
1526: 99 27 eor r25, r25
1528: 81 30 cpi r24, 0x01 ; 1
152a: 91 05 cpc r25, r1
152c: 09 f4 brne .+2 ; 0x1530 <Menu+0x68>
152e: 41 c0 rjmp .+130 ; 0x15b2 <Menu+0xea>
1530: 82 30 cpi r24, 0x02 ; 2
1532: 91 05 cpc r25, r1
1534: 1c f4 brge .+6 ; 0x153c <Menu+0x74>
1536: 89 2b or r24, r25
1538: 49 f0 breq .+18 ; 0x154c <Menu+0x84>
153a: bf c0 rjmp .+382 ; 0x16ba <Menu+0x1f2>
153c: 82 30 cpi r24, 0x02 ; 2
153e: 91 05 cpc r25, r1
1540: 09 f4 brne .+2 ; 0x1544 <Menu+0x7c>
1542: 6a c0 rjmp .+212 ; 0x1618 <Menu+0x150>
1544: 03 97 sbiw r24, 0x03 ; 3
1546: 09 f4 brne .+2 ; 0x154a <Menu+0x82>
1548: 8e c0 rjmp .+284 ; 0x1666 <Menu+0x19e>
154a: b7 c0 rjmp .+366 ; 0x16ba <Menu+0x1f2>
{
case 0:
LCD_printfxy(0,0,"Verbinden mit");
154c: 60 e0 ldi r22, 0x00 ; 0
154e: 86 2f mov r24, r22
1550: 0e 94 55 06 call 0xcaa <LCD_Gotoxy>
1554: 84 eb ldi r24, 0xB4 ; 180
1556: 90 e0 ldi r25, 0x00 ; 0
1558: 9f 93 push r25
155a: 8f 93 push r24
155c: 0e 94 e3 06 call 0xdc6 <_printf_P>
LCD_printfxy(0,1,"MicroSPS:%2i ",SlaveAdresse);
1560: 61 e0 ldi r22, 0x01 ; 1
1562: 80 e0 ldi r24, 0x00 ; 0
1564: 0e 94 55 06 call 0xcaa <LCD_Gotoxy>
1568: 0f 90 pop r0
156a: 0f 90 pop r0
156c: 80 91 64 00 lds r24, 0x0064
1570: 99 27 eor r25, r25
1572: 9f 93 push r25
1574: 8f 93 push r24
1576: 82 ec ldi r24, 0xC2 ; 194
1578: 90 e0 ldi r25, 0x00 ; 0
157a: 9f 93 push r25
157c: 8f 93 push r24
157e: 0e 94 e3 06 call 0xdc6 <_printf_P>
if(key & KEY3 && SlaveAdresse > 1) SlaveAdresse--;
1582: 0f 90 pop r0
1584: 0f 90 pop r0
1586: 0f 90 pop r0
1588: 0f 90 pop r0
158a: c2 ff sbrs r28, 2
158c: 07 c0 rjmp .+14 ; 0x159c <Menu+0xd4>
158e: 80 91 64 00 lds r24, 0x0064
1592: 82 30 cpi r24, 0x02 ; 2
1594: 18 f0 brcs .+6 ; 0x159c <Menu+0xd4>
1596: 81 50 subi r24, 0x01 ; 1
1598: 80 93 64 00 sts 0x0064, r24
if(key & KEY4 && SlaveAdresse < 26) SlaveAdresse++;
159c: c3 ff sbrs r28, 3
159e: 92 c0 rjmp .+292 ; 0x16c4 <Menu+0x1fc>
15a0: 80 91 64 00 lds r24, 0x0064
15a4: 8a 31 cpi r24, 0x1A ; 26
15a6: 08 f0 brcs .+2 ; 0x15aa <Menu+0xe2>
15a8: 8d c0 rjmp .+282 ; 0x16c4 <Menu+0x1fc>
15aa: 8f 5f subi r24, 0xFF ; 255
15ac: 80 93 64 00 sts 0x0064, r24
break;
15b0: 89 c0 rjmp .+274 ; 0x16c4 <Menu+0x1fc>
case 1:
LCD_printfxy(0,0,"Max Adresse");
15b2: 60 e0 ldi r22, 0x00 ; 0
15b4: 86 2f mov r24, r22
15b6: 0e 94 55 06 call 0xcaa <LCD_Gotoxy>
15ba: 80 ed ldi r24, 0xD0 ; 208
15bc: 90 e0 ldi r25, 0x00 ; 0
15be: 9f 93 push r25
15c0: 8f 93 push r24
15c2: 0e 94 e3 06 call 0xdc6 <_printf_P>
LCD_printfxy(0,1,"%2i ",AnzahlTeilnehmer);
15c6: 61 e0 ldi r22, 0x01 ; 1
15c8: 80 e0 ldi r24, 0x00 ; 0
15ca: 0e 94 55 06 call 0xcaa <LCD_Gotoxy>
15ce: 0f 90 pop r0
15d0: 0f 90 pop r0
15d2: 80 91 6c 00 lds r24, 0x006C
15d6: 99 27 eor r25, r25
15d8: 9f 93 push r25
15da: 8f 93 push r24
15dc: 8c ed ldi r24, 0xDC ; 220
15de: 90 e0 ldi r25, 0x00 ; 0
15e0: 9f 93 push r25
15e2: 8f 93 push r24
15e4: 0e 94 e3 06 call 0xdc6 <_printf_P>
if(key & KEY3 && AnzahlTeilnehmer > 1) AnzahlTeilnehmer--;
15e8: 0f 90 pop r0
15ea: 0f 90 pop r0
15ec: 0f 90 pop r0
15ee: 0f 90 pop r0
15f0: c2 ff sbrs r28, 2
15f2: 07 c0 rjmp .+14 ; 0x1602 <Menu+0x13a>
15f4: 80 91 6c 00 lds r24, 0x006C
15f8: 82 30 cpi r24, 0x02 ; 2
15fa: 18 f0 brcs .+6 ; 0x1602 <Menu+0x13a>
15fc: 81 50 subi r24, 0x01 ; 1
15fe: 80 93 6c 00 sts 0x006C, r24
if(key & KEY4 && AnzahlTeilnehmer < 26) AnzahlTeilnehmer++;
1602: c3 ff sbrs r28, 3
1604: 5f c0 rjmp .+190 ; 0x16c4 <Menu+0x1fc>
1606: 80 91 6c 00 lds r24, 0x006C
160a: 8a 31 cpi r24, 0x1A ; 26
160c: 08 f0 brcs .+2 ; 0x1610 <Menu+0x148>
160e: 5a c0 rjmp .+180 ; 0x16c4 <Menu+0x1fc>
1610: 8f 5f subi r24, 0xFF ; 255
1612: 80 93 6c 00 sts 0x006C, r24
break;
1616: 56 c0 rjmp .+172 ; 0x16c4 <Menu+0x1fc>
case 2:
LCD_printfxy(0,0,"Checksum");
1618: 60 e0 ldi r22, 0x00 ; 0
161a: 86 2f mov r24, r22
161c: 0e 94 55 06 call 0xcaa <LCD_Gotoxy>
1620: 81 ee ldi r24, 0xE1 ; 225
1622: 90 e0 ldi r25, 0x00 ; 0
1624: 9f 93 push r25
1626: 8f 93 push r24
1628: 0e 94 e3 06 call 0xdc6 <_printf_P>
LCD_printfxy(0,1,"Errors:%5i ",CntCrcError);
162c: 61 e0 ldi r22, 0x01 ; 1
162e: 80 e0 ldi r24, 0x00 ; 0
1630: 0e 94 55 06 call 0xcaa <LCD_Gotoxy>
1634: 0f 90 pop r0
1636: 0f 90 pop r0
1638: 80 91 99 00 lds r24, 0x0099
163c: 90 91 9a 00 lds r25, 0x009A
1640: 9f 93 push r25
1642: 8f 93 push r24
1644: 8a ee ldi r24, 0xEA ; 234
1646: 90 e0 ldi r25, 0x00 ; 0
1648: 9f 93 push r25
164a: 8f 93 push r24
164c: 0e 94 e3 06 call 0xdc6 <_printf_P>
if(key & KEY3) CntCrcError = 0;
1650: 0f 90 pop r0
1652: 0f 90 pop r0
1654: 0f 90 pop r0
1656: 0f 90 pop r0
1658: c2 ff sbrs r28, 2
165a: 34 c0 rjmp .+104 ; 0x16c4 <Menu+0x1fc>
165c: 10 92 9a 00 sts 0x009A, r1
1660: 10 92 99 00 sts 0x0099, r1
break;
1664: 2f c0 rjmp .+94 ; 0x16c4 <Menu+0x1fc>
case 3:
LCD_printfxy(0,0,"Display");
1666: 60 e0 ldi r22, 0x00 ; 0
1668: 86 2f mov r24, r22
166a: 0e 94 55 06 call 0xcaa <LCD_Gotoxy>
166e: 86 ef ldi r24, 0xF6 ; 246
1670: 90 e0 ldi r25, 0x00 ; 0
1672: 9f 93 push r25
1674: 8f 93 push r24
1676: 0e 94 e3 06 call 0xdc6 <_printf_P>
LCD_printfxy(0,1,"Zeilen:%1i ",DisplayZeilen);
167a: 61 e0 ldi r22, 0x01 ; 1
167c: 80 e0 ldi r24, 0x00 ; 0
167e: 0e 94 55 06 call 0xcaa <LCD_Gotoxy>
1682: 0f 90 pop r0
1684: 0f 90 pop r0
1686: 80 91 65 00 lds r24, 0x0065
168a: 99 27 eor r25, r25
168c: 9f 93 push r25
168e: 8f 93 push r24
1690: 8e ef ldi r24, 0xFE ; 254
1692: 90 e0 ldi r25, 0x00 ; 0
1694: 9f 93 push r25
1696: 8f 93 push r24
1698: 0e 94 e3 06 call 0xdc6 <_printf_P>
if(key & KEY3) DisplayZeilen = 4;
169c: 0f 90 pop r0
169e: 0f 90 pop r0
16a0: 0f 90 pop r0
16a2: 0f 90 pop r0
16a4: c2 ff sbrs r28, 2
16a6: 03 c0 rjmp .+6 ; 0x16ae <Menu+0x1e6>
16a8: 84 e0 ldi r24, 0x04 ; 4
16aa: 80 93 65 00 sts 0x0065, r24
if(key & KEY4) DisplayZeilen = 2;
16ae: c3 ff sbrs r28, 3
16b0: 09 c0 rjmp .+18 ; 0x16c4 <Menu+0x1fc>
16b2: 82 e0 ldi r24, 0x02 ; 2
16b4: 80 93 65 00 sts 0x0065, r24
break;
16b8: 05 c0 rjmp .+10 ; 0x16c4 <Menu+0x1fc>
 
 
/* case 1:
case 2:
case 3:
case 4:
kanal = MenuePunkt - 1;
LCD_printfxy(0,0,"Datenkanal:%2i",kanal);
LCD_printfxy(0,1,"Von:%2i an %2i ",KanalVon[kanal],KanalAn[kanal]);
if(key & KEY3) KanalVon[kanal]++;
if(key & KEY4) KanalAn[kanal]++;
KanalVon[kanal] % MAX_KANAL;
KanalAn[kanal] % MAX_KANAL;
break;
*/
/*
case 1:
LCD_printfxy(0,0,"Intervall");
LCD_printfxy(0,1,"Display:%3ims ",IntervallDisplay);
if(key & KEY3 && IntervallDisplay > 25) IntervallDisplay -= 5;
if(key & KEY4 && IntervallDisplay < 990) IntervallDisplay += 5;
break;
case 2:
LCD_printfxy(0,0,"Intervall");
LCD_printfxy(0,1,"Debug:%3ims ",IntervallDebug);
if(key & KEY3 && IntervallDebug > 25) IntervallDebug -= 5;
if(key & KEY4 && IntervallDebug < 990) IntervallDebug += 5;
break;
 
case 1:
LCD_printfxy(0,0,"Time");
LCD_printfxy(0,1,"%3i:%02i",Minute,Sekunde);
if(key & KEY3) if(Minute) Minute--;
if(key & KEY4) Minute++;
if(key & KEY5) Sekunde = 0;
break;
case 2:
LCD_printfxy(0,0,"Testvariable");
LCD_printfxy(0,1,"TestInt:%5i",TestInt);
if(key & KEY3) TestInt--;
if(key & KEY4) TestInt++;
break;
case 3:
LCD_printfxy(0,0,"Testarray");
LCD_printfxy(0,1,"Array[%i]=%3i",arr,Array[arr]);
if(key & KEY5) if(++arr == ARRAYGROESSE) arr = 0;
if(key & KEY3) Array[arr]--;
if(key & KEY4) Array[arr]++;
break;
case 4:
LCD_printfxy(0,0,"Infrarot RC5:");
LCD_printfxy(0,1,"Adr:%2i Cmd:%3i",(IR_Code >> 8), IR_Code & 0xff);
break;
*/
default: MaxMenue = MenuePunkt - 1;
16ba: 21 50 subi r18, 0x01 ; 1
16bc: 20 93 7b 00 sts 0x007B, r18
MenuePunkt = 0;
16c0: 10 92 b3 00 sts 0x00B3, r1
16c4: df 91 pop r29
16c6: cf 91 pop r28
16c8: 1f 91 pop r17
16ca: 0f 91 pop r16
16cc: 08 95 ret
 
000016ce <InitIR>:
// Init IR
// ************************************************************************
void InitIR(void)
{
INT0_ENABLE; // ext. Int0 enable
16ce: 8b b7 in r24, 0x3b ; 59
16d0: 80 64 ori r24, 0x40 ; 64
16d2: 8b bf out 0x3b, r24 ; 59
CLR_INT0_FLAG; // war |= 0x40
16d4: 8a b7 in r24, 0x3a ; 58
16d6: 8f 7b andi r24, 0xBF ; 191
16d8: 8a bf out 0x3a, r24 ; 58
INIT_INT0_FLANKE;
16da: 85 b7 in r24, 0x35 ; 53
16dc: 8c 7f andi r24, 0xFC ; 252
16de: 85 bf out 0x35, r24 ; 53
16e0: 85 b7 in r24, 0x35 ; 53
16e2: 82 60 ori r24, 0x02 ; 2
16e4: 85 bf out 0x35, r24 ; 53
TIMER0_PRESCALER = 0x04; // Timer0: Clk div 256
16e6: 84 e0 ldi r24, 0x04 ; 4
16e8: 83 bf out 0x33, r24 ; 51
Decodierung_Lauft = 0;
16ea: 10 92 c9 01 sts 0x01C9, r1
New_IR_Code = 0;
16ee: 10 92 c6 01 sts 0x01C6, r1
IR_Code = 0;
16f2: 10 92 c8 01 sts 0x01C8, r1
16f6: 10 92 c7 01 sts 0x01C7, r1
16fa: 08 95 ret
 
000016fc <__vector_1>:
 
 
}
// **************************************************************************
// * aufgerufen durch: externer Interrupt
// **************************************************************************
// * Die Funktion wird durch einen externen Interrupt aufgerufen.
// * Sie dient nur zum Starten der Abtastsequenz und zum Triggern auf die
// * Signalflanken in der Mitte der Daten.
// **************************************************************************
SIGNAL (SIG_INTERRUPT0)
{
16fc: 1f 92 push r1
16fe: 0f 92 push r0
1700: 0f b6 in r0, 0x3f ; 63
1702: 0f 92 push r0
1704: 11 24 eor r1, r1
1706: 8f 93 push r24
// Zeitbasis fuer Timer einstellen
// Entspricht 1,5 mal einer Bitlaenge
// PORTB++;
TCNT0 = -41;
1708: 87 ed ldi r24, 0xD7 ; 215
170a: 82 bf out 0x32, r24 ; 50
TIM0_START; // Timer 0 starten,
170c: 89 b7 in r24, 0x39 ; 57
170e: 81 60 ori r24, 0x01 ; 1
1710: 89 bf out 0x39, r24 ; 57
if(Decodierung_Lauft) INT0_DISABLE; // die erneute Int.-Ausl”sung soll
1712: 80 91 c9 01 lds r24, 0x01C9
1716: 88 23 and r24, r24
1718: 19 f0 breq .+6 ; 0x1720 <__vector_1+0x24>
171a: 8b b7 in r24, 0x3b ; 59
171c: 8f 7b andi r24, 0xBF ; 191
171e: 8b bf out 0x3b, r24 ; 59
1720: 8f 91 pop r24
1722: 0f 90 pop r0
1724: 0f be out 0x3f, r0 ; 63
1726: 0f 90 pop r0
1728: 1f 90 pop r1
172a: 18 95 reti
 
0000172c <__vector_11>:
// nur die Timer-Routine erlauben
 
}
 
// **************************************************************************
// * aufgerufen durch: Timerueberlauf Timer 0
// **************************************************************************
// * Die Funktion wird durch einen Timer0-Interrupt aufgerufen.
// * Der Timer wird vom ext. Int0 gestartet.
// * Das Infrarotsignal wird hier abgetastet und die Wertigkeiten der
// * Bits entsprechend aufaddiert. Das empfangende Zeichen wird in der
// * globalen Variablen IR_Code gespeichert. Nach Empfang wird das Bit
// * Neues_Zeichen gesetzt.
// **************************************************************************
SIGNAL (SIG_OVERFLOW0)
{
172c: 1f 92 push r1
172e: 0f 92 push r0
1730: 0f b6 in r0, 0x3f ; 63
1732: 0f 92 push r0
1734: 11 24 eor r1, r1
1736: 2f 93 push r18
1738: 3f 93 push r19
173a: 4f 93 push r20
173c: 8f 93 push r24
173e: 9f 93 push r25
 
static unsigned int Shift,IR_Code_tmp;
static unsigned char IR_Zaehler=0,IRSperrCounter=0;
// Reinitialize Timer's 0 value
TCNT1 = -41;
1740: 87 ed ldi r24, 0xD7 ; 215
1742: 9f ef ldi r25, 0xFF ; 255
1744: 9d bd out 0x2d, r25 ; 45
1746: 8c bd out 0x2c, r24 ; 44
if (IRSperrCounter)
1748: 80 91 b9 00 lds r24, 0x00B9
174c: 88 23 and r24, r24
174e: 69 f0 breq .+26 ; 0x176a <__vector_11+0x3e>
{ IRSperrCounter--;
1750: 81 50 subi r24, 0x01 ; 1
1752: 80 93 b9 00 sts 0x00B9, r24
if (!IRSperrCounter)
1756: 88 23 and r24, r24
1758: 09 f0 breq .+2 ; 0x175c <__vector_11+0x30>
175a: 8a c0 rjmp .+276 ; 0x1870 <__vector_11+0x144>
{
TIM0_STOPP; // Timer0 sperre wird durch ExtInt0 gestartet
175c: 89 b7 in r24, 0x39 ; 57
175e: 8e 7f andi r24, 0xFE ; 254
1760: 89 bf out 0x39, r24 ; 57
CLR_INT0_FLAG; // IntFlag Loeschen
1762: 8a b7 in r24, 0x3a ; 58
1764: 8f 7b andi r24, 0xBF ; 191
1766: 8a bf out 0x3a, r24 ; 58
1768: 80 c0 rjmp .+256 ; 0x186a <__vector_11+0x13e>
INT0_ENABLE; // externen Interrupt wieder freigenben
}
}
else
{
if(IR_Zaehler > 1)
176a: 40 91 b8 00 lds r20, 0x00B8
176e: 42 30 cpi r20, 0x02 ; 2
1770: 88 f0 brcs .+34 ; 0x1794 <__vector_11+0x68>
{
Decodierung_Lauft = 1;
1772: 81 e0 ldi r24, 0x01 ; 1
1774: 80 93 c9 01 sts 0x01C9, r24
{
CLR_INT0_FLAG; // Interrupt Flag loeschen
1778: 8a b7 in r24, 0x3a ; 58
177a: 8f 7b andi r24, 0xBF ; 191
177c: 8a bf out 0x3a, r24 ; 58
if(IR_PP) INT0_NEG_FLANKE; // naechste fallende Flanke soll Int0 ausloesen
177e: 82 9b sbis 0x10, 2 ; 16
1780: 03 c0 rjmp .+6 ; 0x1788 <__vector_11+0x5c>
1782: 85 b7 in r24, 0x35 ; 53
1784: 8e 7f andi r24, 0xFE ; 254
1786: 02 c0 rjmp .+4 ; 0x178c <__vector_11+0x60>
else INT0_POS_FLANKE; // naechste steigende Flanke soll Int0 ausloesen
1788: 85 b7 in r24, 0x35 ; 53
178a: 81 60 ori r24, 0x01 ; 1
178c: 85 bf out 0x35, r24 ; 53
INT0_ENABLE; // externen Int frei
178e: 8b b7 in r24, 0x3b ; 59
1790: 80 64 ori r24, 0x40 ; 64
1792: 8b bf out 0x3b, r24 ; 59
}
}
if(!IR_Zaehler) // es beginnt eine neue Abtastung
1794: 44 23 and r20, r20
1796: 59 f4 brne .+22 ; 0x17ae <__vector_11+0x82>
{ // es handelt sich um das 1. Sync-Bit
IR_Code_tmp=0; // Merker löschen
1798: 10 92 b7 00 sts 0x00B7, r1
179c: 10 92 b6 00 sts 0x00B6, r1
Shift=0x8000; //;8192; // Maske auf MSB
17a0: 80 e0 ldi r24, 0x00 ; 0
17a2: 90 e8 ldi r25, 0x80 ; 128
17a4: 90 93 b5 00 sts 0x00B5, r25
17a8: 80 93 b4 00 sts 0x00B4, r24
17ac: 14 c0 rjmp .+40 ; 0x17d6 <__vector_11+0xaa>
}
else
if(IR_PP==1) // das empfangende Bit ist logisch High
17ae: 82 9b sbis 0x10, 2 ; 16
17b0: 10 c0 rjmp .+32 ; 0x17d2 <__vector_11+0xa6>
{ if(IR_Zaehler>2) // (IR_Zaehler ist gleich 1 beim 2. Sync-Bit)
17b2: 43 30 cpi r20, 0x03 ; 3
17b4: 70 f0 brcs .+28 ; 0x17d2 <__vector_11+0xa6>
{ // 2 --> Toggle-Bit (wird übersprungen)
IR_Code_tmp |= Shift; // entsprechendse Bit setzen
17b6: 80 91 b6 00 lds r24, 0x00B6
17ba: 90 91 b7 00 lds r25, 0x00B7
17be: 20 91 b4 00 lds r18, 0x00B4
17c2: 30 91 b5 00 lds r19, 0x00B5
17c6: 82 2b or r24, r18
17c8: 93 2b or r25, r19
17ca: 90 93 b7 00 sts 0x00B7, r25
17ce: 80 93 b6 00 sts 0x00B6, r24
}
}
if ((IR_Zaehler < 2) && !(IR_PP==1)) // startbits überprüfen
17d2: 42 30 cpi r20, 0x02 ; 2
17d4: 20 f4 brcc .+8 ; 0x17de <__vector_11+0xb2>
17d6: 82 99 sbic 0x10, 2 ; 16
17d8: 02 c0 rjmp .+4 ; 0x17de <__vector_11+0xb2>
{
IR_Zaehler = 0;
17da: 10 92 b8 00 sts 0x00B8, r1
}
Shift >>=1; // Shiftregister um 1 nach rechts schieben
17de: 80 91 b4 00 lds r24, 0x00B4
17e2: 90 91 b5 00 lds r25, 0x00B5
17e6: 96 95 lsr r25
17e8: 87 95 ror r24
17ea: 90 93 b5 00 sts 0x00B5, r25
17ee: 80 93 b4 00 sts 0x00B4, r24
// (für das nächste empf. Bit
if (Shift == 128) Shift = 32; // Adresse ins HighByte, Kommando ins LowByte
17f2: 80 38 cpi r24, 0x80 ; 128
17f4: 91 05 cpc r25, r1
17f6: 31 f4 brne .+12 ; 0x1804 <__vector_11+0xd8>
17f8: 80 e2 ldi r24, 0x20 ; 32
17fa: 90 e0 ldi r25, 0x00 ; 0
17fc: 90 93 b5 00 sts 0x00B5, r25
1800: 80 93 b4 00 sts 0x00B4, r24
if(IR_Zaehler++==15) // Das IR-Wort wurde vollstaendig abgetastet
1804: 80 91 b8 00 lds r24, 0x00B8
1808: 8f 5f subi r24, 0xFF ; 255
180a: 80 93 b8 00 sts 0x00B8, r24
180e: 80 31 cpi r24, 0x10 ; 16
1810: 79 f5 brne .+94 ; 0x1870 <__vector_11+0x144>
{
CLR_INT0_FLAG; // IntFlag Loeschen
1812: 8a b7 in r24, 0x3a ; 58
1814: 8f 7b andi r24, 0xBF ; 191
1816: 8a bf out 0x3a, r24 ; 58
INT0_NEG_FLANKE; // fallende Flanke
1818: 85 b7 in r24, 0x35 ; 53
181a: 8e 7f andi r24, 0xFE ; 254
181c: 85 bf out 0x35, r24 ; 53
IR_Zaehler = 0;
181e: 10 92 b8 00 sts 0x00B8, r1
Decodierung_Lauft=0;
1822: 10 92 c9 01 sts 0x01C9, r1
/* if ((HIGH(IR_Code_tmp)==ALLOWED1)|| (HIGH(IR_Code_tmp)==ALLOWED2)||
(HIGH(IR_Code_tmp)==ALLOWED3)||(HIGH(IR_Code_tmp)==ALLOWED4)||
(HIGH(IR_Code_tmp)==ALLOWED5) )
if ((HIGH(IR_Code_tmp)< 10))*/
if ((HIGH(IR_Code_tmp)< 10 ) && (LOW(IR_Code_tmp)!=0x3F) )
1826: 80 91 b7 00 lds r24, 0x00B7
182a: 8a 30 cpi r24, 0x0A ; 10
182c: d8 f4 brcc .+54 ; 0x1864 <__vector_11+0x138>
182e: 80 91 b6 00 lds r24, 0x00B6
1832: 8f 33 cpi r24, 0x3F ; 63
1834: b9 f0 breq .+46 ; 0x1864 <__vector_11+0x138>
{ // nur erlaubt Adressen werden akzepetiert
IR_Code=IR_Code_tmp; // IR-Wort in die globale Variable schreiben
1836: 80 91 b6 00 lds r24, 0x00B6
183a: 90 91 b7 00 lds r25, 0x00B7
183e: 90 93 c8 01 sts 0x01C8, r25
1842: 80 93 c7 01 sts 0x01C7, r24
New_IR_Code = 1; // Es ist ein neues Zeichen eingetragen worden
1846: 81 e0 ldi r24, 0x01 ; 1
1848: 80 93 c6 01 sts 0x01C6, r24
IRSperrCounter = 4; // weitere Kommandos für 200 * 1,3ms unterdrücken
184c: 84 e0 ldi r24, 0x04 ; 4
184e: 80 93 b9 00 sts 0x00B9, r24
INT0_ENABLE; // externen Interrupt wieder freigenben
1852: 8b b7 in r24, 0x3b ; 59
1854: 80 64 ori r24, 0x40 ; 64
1856: 8b bf out 0x3b, r24 ; 59
LoescheIrCodeTimer = 250;
1858: 8a ef ldi r24, 0xFA ; 250
185a: 90 e0 ldi r25, 0x00 ; 0
185c: 90 93 7d 00 sts 0x007D, r25
1860: 80 93 7c 00 sts 0x007C, r24
}
IRSperrCounter = 4; // weitere Kommandos für 200 * 1,3ms unterdrücken
1864: 84 e0 ldi r24, 0x04 ; 4
1866: 80 93 b9 00 sts 0x00B9, r24
INT0_ENABLE; // externen Interrupt wieder freigenben
186a: 8b b7 in r24, 0x3b ; 59
186c: 80 64 ori r24, 0x40 ; 64
186e: 8b bf out 0x3b, r24 ; 59
1870: 9f 91 pop r25
1872: 8f 91 pop r24
1874: 4f 91 pop r20
1876: 3f 91 pop r19
1878: 2f 91 pop r18
187a: 0f 90 pop r0
187c: 0f be out 0x3f, r0 ; 63
187e: 0f 90 pop r0
1880: 1f 90 pop r1
1882: 18 95 reti
 
00001884 <ADC_Init>:
 
// ---------------------------------------------------------------------------------------
void ADC_Init(void)
{
ADMUX = 0;
1884: 17 b8 out 0x07, r1 ; 7
ADCSRA = 0x86;
1886: 86 e8 ldi r24, 0x86 ; 134
1888: 86 b9 out 0x06, r24 ; 6
188a: 08 95 ret
 
0000188c <ReadADC>:
}
 
// ---------------------------------------------------------------------------------------
unsigned int ReadADC(unsigned char adc_input)
{
ADMUX = adc_input;
188c: 87 b9 out 0x07, r24 ; 7
ADCSRA |= 0x40;
188e: 36 9a sbi 0x06, 6 ; 6
//Delay_ms(10);
while ((ADCSRA & 0x10) == 0);
1890: 34 9b sbis 0x06, 4 ; 6
1892: fe cf rjmp .-4 ; 0x1890 <ReadADC+0x4>
ADCSRA |= 0x10;
1894: 34 9a sbi 0x06, 4 ; 6
return ADCW; // read ad and calc. temp.
1896: 84 b1 in r24, 0x04 ; 4
1898: 95 b1 in r25, 0x05 ; 5
189a: 08 95 ret
 
0000189c <GetAnalogWerte>:
}
 
void GetAnalogWerte(void)
{
AnalogWerte[0] = ReadADC(0);
189c: 80 e0 ldi r24, 0x00 ; 0
189e: 0e 94 46 0c call 0x188c <ReadADC>
18a2: 90 93 cb 01 sts 0x01CB, r25
18a6: 80 93 ca 01 sts 0x01CA, r24
AnalogWerte[1] = ReadADC(1);
18aa: 81 e0 ldi r24, 0x01 ; 1
18ac: 0e 94 46 0c call 0x188c <ReadADC>
18b0: 90 93 cd 01 sts 0x01CD, r25
18b4: 80 93 cc 01 sts 0x01CC, r24
AnalogWerte[2] = ReadADC(2);
18b8: 82 e0 ldi r24, 0x02 ; 2
18ba: 0e 94 46 0c call 0x188c <ReadADC>
18be: 90 93 cf 01 sts 0x01CF, r25
18c2: 80 93 ce 01 sts 0x01CE, r24
18c6: 08 95 ret
 
000018c8 <memchr>:
18c8: fc 01 movw r30, r24
18ca: 41 50 subi r20, 0x01 ; 1
18cc: 50 40 sbci r21, 0x00 ; 0
18ce: 30 f0 brcs .+12 ; 0x18dc <memchr+0x14>
18d0: 01 90 ld r0, Z+
18d2: 06 16 cp r0, r22
18d4: d1 f7 brne .-12 ; 0x18ca <memchr+0x2>
18d6: 31 97 sbiw r30, 0x01 ; 1
18d8: cf 01 movw r24, r30
18da: 08 95 ret
18dc: 88 27 eor r24, r24
18de: 99 27 eor r25, r25
18e0: 08 95 ret
 
000018e2 <fdevopen>:
18e2: 0f 93 push r16
18e4: 1f 93 push r17
18e6: cf 93 push r28
18e8: df 93 push r29
18ea: 8c 01 movw r16, r24
18ec: eb 01 movw r28, r22
18ee: 00 97 sbiw r24, 0x00 ; 0
18f0: 11 f4 brne .+4 ; 0x18f6 <fdevopen+0x14>
18f2: 67 2b or r22, r23
18f4: c1 f1 breq .+112 ; 0x1966 <fdevopen+0x84>
18f6: 6e e0 ldi r22, 0x0E ; 14
18f8: 70 e0 ldi r23, 0x00 ; 0
18fa: 81 e0 ldi r24, 0x01 ; 1
18fc: 90 e0 ldi r25, 0x00 ; 0
18fe: 0e 94 b8 0c call 0x1970 <calloc>
1902: fc 01 movw r30, r24
1904: 89 2b or r24, r25
1906: 71 f1 breq .+92 ; 0x1964 <fdevopen+0x82>
1908: 80 e8 ldi r24, 0x80 ; 128
190a: 83 83 std Z+3, r24 ; 0x03
190c: 20 97 sbiw r28, 0x00 ; 0
190e: 71 f0 breq .+28 ; 0x192c <fdevopen+0x4a>
1910: d3 87 std Z+11, r29 ; 0x0b
1912: c2 87 std Z+10, r28 ; 0x0a
1914: 81 e8 ldi r24, 0x81 ; 129
1916: 83 83 std Z+3, r24 ; 0x03
1918: 80 91 d0 01 lds r24, 0x01D0
191c: 90 91 d1 01 lds r25, 0x01D1
1920: 89 2b or r24, r25
1922: 21 f4 brne .+8 ; 0x192c <fdevopen+0x4a>
1924: f0 93 d1 01 sts 0x01D1, r31
1928: e0 93 d0 01 sts 0x01D0, r30
192c: 01 15 cp r16, r1
192e: 11 05 cpc r17, r1
1930: c9 f0 breq .+50 ; 0x1964 <fdevopen+0x82>
1932: 11 87 std Z+9, r17 ; 0x09
1934: 00 87 std Z+8, r16 ; 0x08
1936: 83 81 ldd r24, Z+3 ; 0x03
1938: 82 60 ori r24, 0x02 ; 2
193a: 83 83 std Z+3, r24 ; 0x03
193c: 80 91 d2 01 lds r24, 0x01D2
1940: 90 91 d3 01 lds r25, 0x01D3
1944: 89 2b or r24, r25
1946: 71 f4 brne .+28 ; 0x1964 <fdevopen+0x82>
1948: f0 93 d3 01 sts 0x01D3, r31
194c: e0 93 d2 01 sts 0x01D2, r30
1950: 80 91 d4 01 lds r24, 0x01D4
1954: 90 91 d5 01 lds r25, 0x01D5
1958: 89 2b or r24, r25
195a: 21 f4 brne .+8 ; 0x1964 <fdevopen+0x82>
195c: f0 93 d5 01 sts 0x01D5, r31
1960: e0 93 d4 01 sts 0x01D4, r30
1964: cf 01 movw r24, r30
1966: df 91 pop r29
1968: cf 91 pop r28
196a: 1f 91 pop r17
196c: 0f 91 pop r16
196e: 08 95 ret
 
00001970 <calloc>:
1970: 0f 93 push r16
1972: 1f 93 push r17
1974: cf 93 push r28
1976: df 93 push r29
1978: 86 9f mul r24, r22
197a: 80 01 movw r16, r0
197c: 87 9f mul r24, r23
197e: 10 0d add r17, r0
1980: 96 9f mul r25, r22
1982: 10 0d add r17, r0
1984: 11 24 eor r1, r1
1986: c8 01 movw r24, r16
1988: 0e 94 d4 0c call 0x19a8 <malloc>
198c: ec 01 movw r28, r24
198e: 00 97 sbiw r24, 0x00 ; 0
1990: 29 f0 breq .+10 ; 0x199c <calloc+0x2c>
1992: a8 01 movw r20, r16
1994: 60 e0 ldi r22, 0x00 ; 0
1996: 70 e0 ldi r23, 0x00 ; 0
1998: 0e 94 ca 0d call 0x1b94 <memset>
199c: ce 01 movw r24, r28
199e: df 91 pop r29
19a0: cf 91 pop r28
19a2: 1f 91 pop r17
19a4: 0f 91 pop r16
19a6: 08 95 ret
 
000019a8 <malloc>:
19a8: cf 93 push r28
19aa: df 93 push r29
19ac: ac 01 movw r20, r24
19ae: 02 97 sbiw r24, 0x02 ; 2
19b0: 10 f4 brcc .+4 ; 0x19b6 <malloc+0xe>
19b2: 42 e0 ldi r20, 0x02 ; 2
19b4: 50 e0 ldi r21, 0x00 ; 0
19b6: 20 e0 ldi r18, 0x00 ; 0
19b8: 30 e0 ldi r19, 0x00 ; 0
19ba: a0 91 d8 01 lds r26, 0x01D8
19be: b0 91 d9 01 lds r27, 0x01D9
19c2: bd 01 movw r22, r26
19c4: f9 01 movw r30, r18
19c6: 10 97 sbiw r26, 0x00 ; 0
19c8: 09 f4 brne .+2 ; 0x19cc <malloc+0x24>
19ca: 4c c0 rjmp .+152 ; 0x1a64 <malloc+0xbc>
19cc: 8d 91 ld r24, X+
19ce: 9c 91 ld r25, X
19d0: 11 97 sbiw r26, 0x01 ; 1
19d2: 84 17 cp r24, r20
19d4: 95 07 cpc r25, r21
19d6: 31 f1 breq .+76 ; 0x1a24 <malloc+0x7c>
19d8: 48 17 cp r20, r24
19da: 59 07 cpc r21, r25
19dc: 38 f4 brcc .+14 ; 0x19ec <malloc+0x44>
19de: 21 15 cp r18, r1
19e0: 31 05 cpc r19, r1
19e2: 19 f0 breq .+6 ; 0x19ea <malloc+0x42>
19e4: 82 17 cp r24, r18
19e6: 93 07 cpc r25, r19
19e8: 08 f4 brcc .+2 ; 0x19ec <malloc+0x44>
19ea: 9c 01 movw r18, r24
19ec: fd 01 movw r30, r26
19ee: a2 81 ldd r26, Z+2 ; 0x02
19f0: b3 81 ldd r27, Z+3 ; 0x03
19f2: 10 97 sbiw r26, 0x00 ; 0
19f4: 59 f7 brne .-42 ; 0x19cc <malloc+0x24>
19f6: 21 15 cp r18, r1
19f8: 31 05 cpc r19, r1
19fa: a1 f1 breq .+104 ; 0x1a64 <malloc+0xbc>
19fc: c9 01 movw r24, r18
19fe: 84 1b sub r24, r20
1a00: 95 0b sbc r25, r21
1a02: 04 97 sbiw r24, 0x04 ; 4
1a04: 08 f4 brcc .+2 ; 0x1a08 <malloc+0x60>
1a06: a9 01 movw r20, r18
1a08: db 01 movw r26, r22
1a0a: e0 e0 ldi r30, 0x00 ; 0
1a0c: f0 e0 ldi r31, 0x00 ; 0
1a0e: 10 97 sbiw r26, 0x00 ; 0
1a10: 49 f1 breq .+82 ; 0x1a64 <malloc+0xbc>
1a12: 8d 91 ld r24, X+
1a14: 9c 91 ld r25, X
1a16: 11 97 sbiw r26, 0x01 ; 1
1a18: 82 17 cp r24, r18
1a1a: 93 07 cpc r25, r19
1a1c: f9 f4 brne .+62 ; 0x1a5c <malloc+0xb4>
1a1e: 42 17 cp r20, r18
1a20: 53 07 cpc r21, r19
1a22: 79 f4 brne .+30 ; 0x1a42 <malloc+0x9a>
1a24: ed 01 movw r28, r26
1a26: 8a 81 ldd r24, Y+2 ; 0x02
1a28: 9b 81 ldd r25, Y+3 ; 0x03
1a2a: 30 97 sbiw r30, 0x00 ; 0
1a2c: 19 f0 breq .+6 ; 0x1a34 <malloc+0x8c>
1a2e: 93 83 std Z+3, r25 ; 0x03
1a30: 82 83 std Z+2, r24 ; 0x02
1a32: 04 c0 rjmp .+8 ; 0x1a3c <malloc+0x94>
1a34: 90 93 d9 01 sts 0x01D9, r25
1a38: 80 93 d8 01 sts 0x01D8, r24
1a3c: cd 01 movw r24, r26
1a3e: 02 96 adiw r24, 0x02 ; 2
1a40: 4a c0 rjmp .+148 ; 0x1ad6 <malloc+0x12e>
1a42: 24 1b sub r18, r20
1a44: 35 0b sbc r19, r21
1a46: fd 01 movw r30, r26
1a48: e2 0f add r30, r18
1a4a: f3 1f adc r31, r19
1a4c: 41 93 st Z+, r20
1a4e: 51 93 st Z+, r21
1a50: 22 50 subi r18, 0x02 ; 2
1a52: 30 40 sbci r19, 0x00 ; 0
1a54: 2d 93 st X+, r18
1a56: 3c 93 st X, r19
1a58: cf 01 movw r24, r30
1a5a: 3d c0 rjmp .+122 ; 0x1ad6 <malloc+0x12e>
1a5c: fd 01 movw r30, r26
1a5e: a2 81 ldd r26, Z+2 ; 0x02
1a60: b3 81 ldd r27, Z+3 ; 0x03
1a62: d5 cf rjmp .-86 ; 0x1a0e <malloc+0x66>
1a64: 80 91 d6 01 lds r24, 0x01D6
1a68: 90 91 d7 01 lds r25, 0x01D7
1a6c: 89 2b or r24, r25
1a6e: 41 f4 brne .+16 ; 0x1a80 <malloc+0xd8>
1a70: 80 91 80 00 lds r24, 0x0080
1a74: 90 91 81 00 lds r25, 0x0081
1a78: 90 93 d7 01 sts 0x01D7, r25
1a7c: 80 93 d6 01 sts 0x01D6, r24
1a80: e0 91 7e 00 lds r30, 0x007E
1a84: f0 91 7f 00 lds r31, 0x007F
1a88: 30 97 sbiw r30, 0x00 ; 0
1a8a: 41 f4 brne .+16 ; 0x1a9c <malloc+0xf4>
1a8c: ed b7 in r30, 0x3d ; 61
1a8e: fe b7 in r31, 0x3e ; 62
1a90: 80 91 82 00 lds r24, 0x0082
1a94: 90 91 83 00 lds r25, 0x0083
1a98: e8 1b sub r30, r24
1a9a: f9 0b sbc r31, r25
1a9c: a0 91 d6 01 lds r26, 0x01D6
1aa0: b0 91 d7 01 lds r27, 0x01D7
1aa4: 9f 01 movw r18, r30
1aa6: 2a 1b sub r18, r26
1aa8: 3b 0b sbc r19, r27
1aaa: 24 17 cp r18, r20
1aac: 35 07 cpc r19, r21
1aae: 88 f0 brcs .+34 ; 0x1ad2 <malloc+0x12a>
1ab0: ca 01 movw r24, r20
1ab2: 02 96 adiw r24, 0x02 ; 2
1ab4: 28 17 cp r18, r24
1ab6: 39 07 cpc r19, r25
1ab8: 60 f0 brcs .+24 ; 0x1ad2 <malloc+0x12a>
1aba: cd 01 movw r24, r26
1abc: 84 0f add r24, r20
1abe: 95 1f adc r25, r21
1ac0: 02 96 adiw r24, 0x02 ; 2
1ac2: 90 93 d7 01 sts 0x01D7, r25
1ac6: 80 93 d6 01 sts 0x01D6, r24
1aca: 4d 93 st X+, r20
1acc: 5d 93 st X+, r21
1ace: cd 01 movw r24, r26
1ad0: 02 c0 rjmp .+4 ; 0x1ad6 <malloc+0x12e>
1ad2: 80 e0 ldi r24, 0x00 ; 0
1ad4: 90 e0 ldi r25, 0x00 ; 0
1ad6: df 91 pop r29
1ad8: cf 91 pop r28
1ada: 08 95 ret
 
00001adc <free>:
1adc: cf 93 push r28
1ade: df 93 push r29
1ae0: 00 97 sbiw r24, 0x00 ; 0
1ae2: 09 f4 brne .+2 ; 0x1ae6 <free+0xa>
1ae4: 54 c0 rjmp .+168 ; 0x1b8e <free+0xb2>
1ae6: dc 01 movw r26, r24
1ae8: 12 97 sbiw r26, 0x02 ; 2
1aea: ed 01 movw r28, r26
1aec: 1b 82 std Y+3, r1 ; 0x03
1aee: 1a 82 std Y+2, r1 ; 0x02
1af0: 80 91 d8 01 lds r24, 0x01D8
1af4: 90 91 d9 01 lds r25, 0x01D9
1af8: 00 97 sbiw r24, 0x00 ; 0
1afa: 21 f1 breq .+72 ; 0x1b44 <free+0x68>
1afc: fc 01 movw r30, r24
1afe: 40 e0 ldi r20, 0x00 ; 0
1b00: 50 e0 ldi r21, 0x00 ; 0
1b02: ea 17 cp r30, r26
1b04: fb 07 cpc r31, r27
1b06: 18 f1 brcs .+70 ; 0x1b4e <free+0x72>
1b08: ed 01 movw r28, r26
1b0a: fb 83 std Y+3, r31 ; 0x03
1b0c: ea 83 std Y+2, r30 ; 0x02
1b0e: 2d 91 ld r18, X+
1b10: 3c 91 ld r19, X
1b12: 11 97 sbiw r26, 0x01 ; 1
1b14: c2 0f add r28, r18
1b16: d3 1f adc r29, r19
1b18: ce 01 movw r24, r28
1b1a: 02 96 adiw r24, 0x02 ; 2
1b1c: 8e 17 cp r24, r30
1b1e: 9f 07 cpc r25, r31
1b20: 71 f4 brne .+28 ; 0x1b3e <free+0x62>
1b22: 8a 81 ldd r24, Y+2 ; 0x02
1b24: 9b 81 ldd r25, Y+3 ; 0x03
1b26: 28 0f add r18, r24
1b28: 39 1f adc r19, r25
1b2a: 2e 5f subi r18, 0xFE ; 254
1b2c: 3f 4f sbci r19, 0xFF ; 255
1b2e: 11 96 adiw r26, 0x01 ; 1
1b30: 3c 93 st X, r19
1b32: 2e 93 st -X, r18
1b34: 82 81 ldd r24, Z+2 ; 0x02
1b36: 93 81 ldd r25, Z+3 ; 0x03
1b38: fd 01 movw r30, r26
1b3a: 93 83 std Z+3, r25 ; 0x03
1b3c: 82 83 std Z+2, r24 ; 0x02
1b3e: 41 15 cp r20, r1
1b40: 51 05 cpc r21, r1
1b42: 59 f4 brne .+22 ; 0x1b5a <free+0x7e>
1b44: b0 93 d9 01 sts 0x01D9, r27
1b48: a0 93 d8 01 sts 0x01D8, r26
1b4c: 20 c0 rjmp .+64 ; 0x1b8e <free+0xb2>
1b4e: af 01 movw r20, r30
1b50: 02 80 ldd r0, Z+2 ; 0x02
1b52: f3 81 ldd r31, Z+3 ; 0x03
1b54: e0 2d mov r30, r0
1b56: 30 97 sbiw r30, 0x00 ; 0
1b58: a1 f6 brne .-88 ; 0x1b02 <free+0x26>
1b5a: ea 01 movw r28, r20
1b5c: bb 83 std Y+3, r27 ; 0x03
1b5e: aa 83 std Y+2, r26 ; 0x02
1b60: ca 01 movw r24, r20
1b62: 02 96 adiw r24, 0x02 ; 2
1b64: 28 81 ld r18, Y
1b66: 39 81 ldd r19, Y+1 ; 0x01
1b68: 82 0f add r24, r18
1b6a: 93 1f adc r25, r19
1b6c: 8a 17 cp r24, r26
1b6e: 9b 07 cpc r25, r27
1b70: 71 f4 brne .+28 ; 0x1b8e <free+0xb2>
1b72: 8d 91 ld r24, X+
1b74: 9c 91 ld r25, X
1b76: 11 97 sbiw r26, 0x01 ; 1
1b78: 28 0f add r18, r24
1b7a: 39 1f adc r19, r25
1b7c: 2e 5f subi r18, 0xFE ; 254
1b7e: 3f 4f sbci r19, 0xFF ; 255
1b80: 39 83 std Y+1, r19 ; 0x01
1b82: 28 83 st Y, r18
1b84: fd 01 movw r30, r26
1b86: 82 81 ldd r24, Z+2 ; 0x02
1b88: 93 81 ldd r25, Z+3 ; 0x03
1b8a: 9b 83 std Y+3, r25 ; 0x03
1b8c: 8a 83 std Y+2, r24 ; 0x02
1b8e: df 91 pop r29
1b90: cf 91 pop r28
1b92: 08 95 ret
 
00001b94 <memset>:
1b94: dc 01 movw r26, r24
1b96: 40 ff sbrs r20, 0
1b98: 03 c0 rjmp .+6 ; 0x1ba0 <memset+0xc>
1b9a: 01 c0 rjmp .+2 ; 0x1b9e <memset+0xa>
1b9c: 6d 93 st X+, r22
1b9e: 6d 93 st X+, r22
1ba0: 42 50 subi r20, 0x02 ; 2
1ba2: 50 40 sbci r21, 0x00 ; 0
1ba4: d8 f7 brcc .-10 ; 0x1b9c <memset+0x8>
1ba6: 08 95 ret
 
00001ba8 <__udivmodsi4>:
1ba8: a1 e2 ldi r26, 0x21 ; 33
1baa: 1a 2e mov r1, r26
1bac: aa 1b sub r26, r26
1bae: bb 1b sub r27, r27
1bb0: fd 01 movw r30, r26
1bb2: 0d c0 rjmp .+26 ; 0x1bce <__udivmodsi4_ep>
 
00001bb4 <__udivmodsi4_loop>:
1bb4: aa 1f adc r26, r26
1bb6: bb 1f adc r27, r27
1bb8: ee 1f adc r30, r30
1bba: ff 1f adc r31, r31
1bbc: a2 17 cp r26, r18
1bbe: b3 07 cpc r27, r19
1bc0: e4 07 cpc r30, r20
1bc2: f5 07 cpc r31, r21
1bc4: 20 f0 brcs .+8 ; 0x1bce <__udivmodsi4_ep>
1bc6: a2 1b sub r26, r18
1bc8: b3 0b sbc r27, r19
1bca: e4 0b sbc r30, r20
1bcc: f5 0b sbc r31, r21
 
00001bce <__udivmodsi4_ep>:
1bce: 66 1f adc r22, r22
1bd0: 77 1f adc r23, r23
1bd2: 88 1f adc r24, r24
1bd4: 99 1f adc r25, r25
1bd6: 1a 94 dec r1
1bd8: 69 f7 brne .-38 ; 0x1bb4 <__udivmodsi4_loop>
1bda: 60 95 com r22
1bdc: 70 95 com r23
1bde: 80 95 com r24
1be0: 90 95 com r25
1be2: 9b 01 movw r18, r22
1be4: ac 01 movw r20, r24
1be6: bd 01 movw r22, r26
1be8: cf 01 movw r24, r30
1bea: 08 95 ret
/tags/V0.14
New file
Property changes:
Added: tsvn:logminsize
## -0,0 +1 ##
+8
\ No newline at end of property