patchAVR C Runtime Library - Patches: patch #7464, Fix iom168p.h to be compatible...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #7464: Fix iom168p.h to be compatible with iom168.h

Submitter:  Bradley Jarvis <bradley_jarvis>
Submitted:  Mon 14 Feb 2011 05:48:37 AM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Wont Do Privacy:  Public
Assigned to:  joerg_wunsch Open/Closed:  Closed

Fri 03 May 2013 02:17:23 PM UTC, comment #4: 


> There is a problem however with the port bit names though. iom168.h
> (or iomx8.h) names them PA0 PB0 etc, iom168p.h names them PORTA0
> PORTB0 etc. and neither file have the other definition.


All these portpin definitions are supplied from a central include
file named <avr/portpins.h>, in order to not having to duplicate
them in each individual file.  I just compiled the following test
code:


#include <avr/io.h>

int
main(void)
{
        DDRB = _BV(PB5);
        for (;;)
                PORTB = _BV(PORTB5);
}


using both, -mmcu=atmega168 and -mmcu=atmega168p.  It compiles
without any complaint, and both compilations yield the same code.

Joerg Wunsch <joerg_wunsch>
Group administrator
Tue 24 May 2011 04:46:20 AM UTC, comment #3: 

Ok then, I did not realise that iom186p.h is auto generated. My problem is that I have a board that started development life with an atmega168 on it, since it is now hard to get it has been replaced with the atmega168p (and there is also a atmega168v) I have updated to the newer chip. There are several differences with names between the iom168.h and iom168p.h that have caused re-compilation problems. One was the vector names, I though that SIG_ were the newer ones not the ones that have been replaced, no problems I can update my code for this to work. There is a problem however with the port bit names though. iom168.h (or iomx8.h) names them PA0 PB0 etc, iom168p.h names them PORTA0 PORTB0 etc. and neither file have the other definition.

Maybe a better fix then for this instance is to add the PORTA0, PORTB0 etc #defines to the iomx8.h file. I can make this change and update the patch files to add the PORTxx #define if you want.

Bradley Jarvis <bradley_jarvis>
Mon 23 May 2011 07:57:58 PM UTC, comment #2: 

I don't really follow what's your actual problem with the existing
iom168p.h.  There are no deprecated names in it; the vector names
ending in vect are the current ones, vector names prefixed with SIG
have been deprecated for 5 years now (and should probably have never
been used with an ATmega168 from the beginning).

The iom168p.h file has been autogenerated, and we won't revert it to
use the hand-crafted iomx8.h file.  If you think something is wrong
with the existing iom168p.h file, please tell us what is wrong with
it, so we can handle that.

Joerg Wunsch <joerg_wunsch>
Group administrator
Fri 13 May 2011 03:40:00 AM UTC, comment #1: 

I have noticed that this patch has not yet been acted upon, just a note that at the moment the current atmega168p header file is using depreciated names for port registers and interrupt vectors that makes compiling code written for a atmega168 need source code changes when ported to atmega168p which is the current hardware upgrade path for this processor series.

Bradley Jarvis <bradley_jarvis>
Mon 14 Feb 2011 05:48:37 AM UTC, original submission:  

The patch makes the iom168p.h use iomx8.h like iom168.h . The difference between the parts is the P has some extra bits in the MCUCR register to handle brown out detection. iomx8.h has to be updated to handle handle _AVR_ATmega168P_. This patch allows code compiled for a ATmega168 to work without change to compile for the ATmega168P.

Bradley Jarvis <bradley_jarvis>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #22698:  iom168p_h_patch added by bradley_jarvis (17KiB - application/octet-stream - Updated patch that has relative directory paths)
file #22682:  iom168p_h_patch added by bradley_jarvis (17KiB - application/octet-stream - patch for iomx8.h and iom168p.h)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by joerg_wunsch (Posted a comment)
  • -email is unavailable- added by bradley_jarvis (Submitted the item)
  • -email is unavailable- added by bradley_jarvis
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-05-03 joerg_wunsch StatusNeed Info Wont Do
        Open/ClosedOpen Closed
    2011-05-23 joerg_wunsch StatusNone Need Info
        Assigned toNone joerg_wunsch
    2011-02-16 bradley_jarvis Attached File- Added iom168p_h_patch, #22698
    2011-02-14 bradley_jarvis Attached File- Added iom168p_h_patch, #22682
        Carbon-Copy- Added bradley_jarvis

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code