2014-09-29 20:39:23 +02:00
|
|
|
#include <avr/io.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2014-09-29 22:59:42 +02:00
|
|
|
char buffer[30];
|
|
|
|
|
|
|
|
volatile char buf[3];
|
|
|
|
|
|
|
|
static int uart_putchar(char c, FILE *stream);
|
|
|
|
static FILE mystdout = FDEV_SETUP_STREAM(uart_putchar, NULL,
|
|
|
|
_FDEV_SETUP_WRITE);
|
|
|
|
static int
|
|
|
|
uart_putchar(char c, FILE *stream)
|
|
|
|
{
|
|
|
|
UDR = c;
|
|
|
|
return 0;
|
|
|
|
}
|
2014-09-29 20:39:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
main(void)
|
|
|
|
{
|
2014-09-29 22:59:42 +02:00
|
|
|
stdout = &mystdout;
|
|
|
|
|
|
|
|
buf[0] = 'x';
|
|
|
|
buf[1] = 'y';
|
|
|
|
buf[2] = '\0';
|
|
|
|
|
|
|
|
puts(buf);
|
|
|
|
|
|
|
|
|
2014-09-29 20:39:23 +02:00
|
|
|
asm volatile("break;");
|
|
|
|
|
2014-09-29 22:59:42 +02:00
|
|
|
printf(":%c", buf[0]);
|
2014-09-29 20:39:23 +02:00
|
|
|
|
|
|
|
asm volatile("break;");
|
|
|
|
|
2014-09-29 22:59:42 +02:00
|
|
|
printf(":%d:", buf[1]);
|
|
|
|
|
|
|
|
asm volatile("break;");
|
|
|
|
|
|
|
|
volatile float x=0.23;
|
|
|
|
printf(":%.2f:", x);
|
|
|
|
|
|
|
|
asm volatile("break;");
|
2014-09-29 20:39:23 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
check-name: Print to Stdout
|
2014-09-29 22:59:42 +02:00
|
|
|
compiler-opts: -Wl,-u,vfprintf -lm -lprintf_flt
|
2014-09-29 20:39:23 +02:00
|
|
|
check-start:
|
|
|
|
|
|
|
|
\avr@instr@stepn{100000}
|
2014-09-29 22:59:42 +02:00
|
|
|
\avr@test@UDR{xy^10} % ^10 == \n
|
|
|
|
\def\avr@UDR{}
|
|
|
|
|
|
|
|
\avr@instr@stepn{100000}
|
|
|
|
\avr@test@UDR{:x}
|
|
|
|
|
2014-09-29 20:39:23 +02:00
|
|
|
\avr@instr@stepn{100000}
|
2014-09-29 22:59:42 +02:00
|
|
|
\avr@test@UDR{:121:}
|
2014-09-29 20:39:23 +02:00
|
|
|
|
2014-09-29 22:59:42 +02:00
|
|
|
\avr@instr@stepn{100000}
|
|
|
|
\avr@test@UDR{:0.23:}
|
2014-09-29 20:39:23 +02:00
|
|
|
|
|
|
|
check-end:
|
|
|
|
**/
|