Nachtrag:
Damit wirklich nur das eingebunden wird, was auch benötigt wird, habe ich eben die Funktionen aus der Asurolib zusammengetragen und mit einem _ versehen,
Code:
#include <asuro.h>
void Uart_Putc (char zeichen)
{
UCSRB = 0x08; // enable transmitter
UCSRA |= 0x40; // clear transmitter flag
while (!(UCSRA & 0x20)) // wait for empty transmit buffer
;
UDR = zeichen;
while (!(UCSRA & 0x40)) // Wait for transmit complete flag (TXC)
;
}
/*void Ser_Print(char *data)
{
unsigned char i = 0;
while (data [i] != 0x00)
Uart_Putc (data [i++]);
}
void Print_Int(int wert) {
char text [7]; // "-12345"
itoa (wert, text, 10);
Ser_Print(text);
}*/
void PrintChar(int x)
{
int b=0;
if (x < 0) {
Uart_Putc('-');
x = -x;
}
if (x >= 10) {
while (x >= 10) {
b++;
x -=10;
}
PrintChar(b);
}
Uart_Putc(x + '0');
}
int main(void)
{
Init();
while(1)
{
// Print_Int(-1000);
PrintChar(-1000);
}
return 0;
}
Stand 928-744 = 184 Bytes
Lesezeichen