2014-09-29 20:39:23 +02:00
|
|
|
#include <avr/io.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
volatile uint16_t xxx = 65;
|
|
|
|
|
|
|
|
int
|
|
|
|
main(void)
|
|
|
|
{
|
|
|
|
stdout = &mystdout;
|
|
|
|
|
2014-09-29 22:59:42 +02:00
|
|
|
volatile float a = 0.23;
|
|
|
|
volatile float b = 0.43;
|
2014-09-29 20:39:23 +02:00
|
|
|
|
2014-09-29 22:59:42 +02:00
|
|
|
printf("%.2f", 1/ (a * b * 3));
|
2014-09-29 20:39:23 +02:00
|
|
|
asm volatile("break;");
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2014-09-29 22:59:42 +02:00
|
|
|
check-name: Calculate with floats
|
|
|
|
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{3.37}
|
2014-09-29 20:39:23 +02:00
|
|
|
|
|
|
|
check-end:
|
|
|
|
**/
|