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

Submitted by:  Bradley Jarvis <bradley_jarvis>
Submitted on:  Mon Feb 14 05:48:37 2011  
Category: NonePriority: 5 - Normal
Status: Wont DoPrivacy: Public
Assigned to: Joerg Wunsch <joerg_wunsch>Open/Closed: Closed

Fri May 3 14:17:23 2013, 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

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

Joerg Wunsch <joerg_wunsch>
Project AdministratorIn charge of this item.
Tue May 24 04:46:20 2011, 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 May 23 19:57:58 2011, 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>
Project AdministratorIn charge of this item.
Fri May 13 03:40:00 2011, 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 Feb 14 05:48:37 2011, 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>


Attached Files
file #22698:  iom168p_h_patch added by bradley_jarvis (17kB - application/octet-stream - Updated patch that has relative directory paths)
file #22682:  iom168p_h_patch added by bradley_jarvis (17kB - 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
  • -unavailable- added by joerg_wunsch (Posted a comment)
  • -unavailable- added by bradley_jarvis (Submitted the item)
  • -unavailable- added by bradley_jarvis

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri May 3 14:17:39 2013joerg_wunschStatusNeed Info=>Wont Do
    Mon May 23 19:57:58 2011joerg_wunschStatusNone=>Need Info
      Assigned toNone=>joerg_wunsch
    Wed Feb 16 12:27:23 2011bradley_jarvisAttached File-=>Added iom168p_h_patch, #22698
    Mon Feb 14 05:48:37 2011bradley_jarvisAttached File-=>Added iom168p_h_patch, #22682
      Carbon-Copy-=>Added bradley_jarvis

    Back to the top

    Powered by Savane 3.1-cleanup1