bugAVR Downloader/UploaDEr - Bugs: bug #35186, inverting pins with "~"...


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

bug #35186: inverting pins with "~" doesn't work for pin lists (i.e. vcc)

Submitted by:  None
Submitted on:  Wed 28 Dec 2011 11:47:52 AM UTC  
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedPrivacy: Public
Assigned to: Rene Liebscher <rliebscher>Originator Name: Tibor Palinkas
Originator Email: -unavailable-Open/Closed: Closed
Release: NoneProgrammer hardware: 
Device type: 

Tue 13 Nov 2012 09:48:09 PM UTC, comment #3:

Implemented in svn revision 1106.

One pin can be inverted by ~ <num>.
More pins can be inverted by ~ ( <num> , <num> , ... ).

There is no possibility at the moment to have inverted some pins and others not.

Rene Liebscher <rliebscher>
Project MemberIn charge of this item.
Sun 22 Jan 2012 06:58:23 PM UTC, comment #2:

WORD_BIT is not defined by the C standard, so I wouldn't want
to use it.

Since, as you mention, AVRDUDE assumes an `int' is at least
32 bits wide, I think it would even be safe to say

#define PIN_MASK (1u << 31)

Alternatively, use the UINT_MAX-based definitions.

Joerg Wunsch <joerg_wunsch>
Project Administrator
Sun 22 Jan 2012 02:11:10 PM UTC, comment #1:

This patch does not work if the pin list contains pin 8 as the current definition of PIN_INVERSE (in pindefs.h) is as follows:

Better we change the definition to:

WORD_BIT is the number of bits in an int. (This is 32 or even more. In case it is only 16 this would break a lot more things in avrdude.)
UINT_MAX is 0xFFFFFFFF for 32 bit unsigned integer.


Also I think extending the grammar to allow "~ (1,2,3)" instead of the proposed "~ 1,2,3" would be safer in case there will be implemented later pin lists with only some pins inverted. Then the proposed solution would potential break the connected hardware if pin lists are not corrected in the config file.

Rene Liebscher <rliebscher>
Project MemberIn charge of this item.
Wed 28 Dec 2011 11:47:52 AM UTC, original submission:


for my current parport programmer I need to apply vcc inverted. After
looking around in svn trunk, I figured there are two reasons it can't
do it at the moment:

- grammar doesn't allow it
- par_setmany truncates any attribute from pin numbers

The attached patch attempts to fix both problems. It's been tested.

The syntax may be a bit odd, as with the current infrastructure pins
can be inverted only in an "all or none" basis. With the patch if
the pin list is prefixed with ~, all pins are assumed to be inverted
(that should be the most common use case anyway).





Attached Files
file #24704:  pinlist-inversion.patch added by None (2KiB - text/x-diff)


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 rliebscher (Posted a comment)
  • -unavailable- added by None (Submitted the item)

    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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 03 Sep 2013 07:59:05 PM UTCrliebscherStatusReady For Test=>Fixed
    Tue 13 Nov 2012 09:48:09 PM UTCrliebscherStatusNone=>Ready For Test
      Assigned toNone=>rliebscher
    Wed 28 Dec 2011 11:47:52 AM UTCNoneAttached File-=>Added pinlist-inversion.patch, #24704

    Back to the top

    Powered by Savane 3.1-cleanup1