tests: Update them so they work...
authorMichel Pollet <buserror@gmail.com>
Thu, 2 Sep 2010 12:01:25 +0000 (13:01 +0100)
committerMichel Pollet <buserror@gmail.com>
Thu, 2 Sep 2010 12:01:25 +0000 (13:01 +0100)
They relied on bugs that were fixed in simavr since..

Signed-off-by: Michel Pollet <buserror@gmail.com>
tests/atmega644_adc_test.c
tests/atmega88_uart_echo.c

index 8b7c7b3..82c6688 100644 (file)
@@ -89,7 +89,7 @@ int main(void)
        ADCSRA &= ~(1 << ADIE); // remove interrupt
 
        // 1.1 reference voltage, left aligned
-       ADMUX = (ADMUX & ~0x1f)| (1 << ADLAR) | 0x1e;
+       ADMUX = (ADMUX & ~0x1f)| (0 << ADLAR) | 0x1e;
        ADCSRA |= (1 << ADSC) ; // start conversion
        while (ADCSRA & (1 << ADSC))
                ;
index c904013..8d1adbe 100644 (file)
@@ -25,7 +25,7 @@ AVR_MCU(F_CPU, "atmega88");
 AVR_MCU_SIMAVR_COMMAND(&GPIOR0);
 
 static int uart_putchar(char c, FILE *stream) {
-  if (c == '\n')
+  if (c == '\r')
     uart_putchar('\r', stream);
   loop_until_bit_is_set(UCSR0A, UDRE0);
   UDR0 = c;