00001 /****************************************************************************/ 00048 /***************************************************************************** 00049 * * 00050 * This program is free software; you can redistribute it and/or modify * 00051 * it under the terms of the GNU General Public License as published by * 00052 * the Free Software Foundation; either version 2 of the License, or * 00053 * any later version. * 00054 * * 00055 *****************************************************************************/ 00056 #include "asuro.h" 00057 00058 00059 00060 /****************************************************************************/ 00099 void PrintInt ( 00100 int wert) 00101 { 00102 char text [7]; // "-12345" 00103 00104 itoa (wert, text, 10); 00105 SerPrint (text); 00106 } 00107 00108 00109 00110 /****************************************************************************/ 00138 void PrintLong ( 00139 long wert) 00140 { 00141 char text [12]; // '-'1234567891'\0' 00142 00143 ltoa (wert, text, 10); 00144 SerPrint (text); 00145 } 00146 00147 00148 00149 /****************************************************************************/ 00176 void UartPutc ( 00177 unsigned char zeichen) 00178 { 00179 UCSRB = 0x08; // enable transmitter 00180 UCSRA |= 0x40; // clear transmitter flag 00181 while (!(UCSRA & 0x20)) // wait for empty transmit buffer 00182 ; 00183 UDR = zeichen; 00184 while (!(UCSRA & 0x40)) // Wait for transmit complete flag (TXC) 00185 ; 00186 UCSRB = 0x00; // disable transmitter / powersave 00187 } 00188 00189 00190 00191 /****************************************************************************/ 00221 void SerPrint ( 00222 char *data) 00223 { 00224 unsigned char i = 0; 00225 00226 while (data [i] != 0x00) 00227 UartPutc (data [i++]); 00228 }