avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [bug #22870] Error in wdt.h and ATmega164P


From: Sebastian Sohn
Subject: [avr-libc-dev] [bug #22870] Error in wdt.h and ATmega164P
Date: Mon, 07 Apr 2008 18:12:15 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13

URL:
  <http://savannah.nongnu.org/bugs/?22870>

                 Summary: Error in wdt.h and ATmega164P
                 Project: AVR C Runtime Library
            Submitted by: lm331
            Submitted on: Monday 04/07/2008 at 18:12
                Category: Library
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
        Percent Complete: 0%
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 1.6.2
           Fixed Release: None

    _______________________________________________________

Details:

Tried to compile my current project (ATmega164P) with WinAVR20080402.
Compiling stopped at the line wdt_disable();

main.c:128: warning: asm operand 0 probably doesn't match constraints
main.c:128: error: impossible constraint in 'asm'

In main.i I found this:
__asm__ __volatile__ ( "in __tmp_reg__, __SREG__" "\n\t" "cli" "\n\t" "out
%0, %1" "\n\t" "out %0, __zero_reg__" "\n\t" "out __SREG__,__tmp_reg__" "\n\t"
: : "I" ((((uint16_t) &((*(volatile uint8_t *)(0x60)))) - 0x20)), "r"
((uint8_t)((1 << (4)) | (1 << (3)))) : "r0" );
The WDTCSR is located at address 0x60, thus unavailable for the OUT
instruction.

The wdt.h contains two macros one with the STS instruction and one with the
OUT instruction. The STS version should be used if the expression
__AVR_ATmega164__ is defined.

I've added this code to wdt.h:
#ifndef __AVR_ATmega164__
#error ERROR NOT COMPILING FOR ATMEGA164P
#endif

Now compiling is aborted with the message ERROR NOT COMPILING FOR
ATMEGA164P.

I'm using the standard MFile makefile with
MCU = atmega164p

Many thanks for your efforts!




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?22870>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]