• AVR Freaks

Hot!Converting my old code to Harmony is not working

Author
NotTooSmart
Junior Member
  • Total Posts : 94
  • Reward points : 0
  • Joined: 2011/11/15 11:19:37
  • Location: 0
  • Status: offline
2019/04/03 13:36:24 (permalink)
0

Converting my old code to Harmony is not working

Hi There,
I am using PIC32MX440F128H, but transferring from my old code to Harmony, it does not like: 
  newx_enco=(PORTReadBits(IOPORT_E,BIT_6|BIT_7));
The editor does not recognize PORTReadBits(IOPORT_E,BIT_6|BIT_7). What would be the proper nomenclature? Please help. Thanks
NotTooSmart
 

Attached Image(s)

#1

6 Replies Related Threads

    NKurzman
    A Guy on the Net
    • Total Posts : 17349
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Converting my old code to Harmony is not working 2019/04/03 14:24:19 (permalink)
    0
    plib_ports.h
    PLIB_PORTS_PinGet()
    PLIB_PORTS_PinSet()
    PLIB_PORTS_PinClear()
    #2
    NotTooSmart
    Junior Member
    • Total Posts : 94
    • Reward points : 0
    • Joined: 2011/11/15 11:19:37
    • Location: 0
    • Status: offline
    Re: Converting my old code to Harmony is not working 2019/06/10 09:33:19 (permalink)
    0
    Thanks NKurzman, I have the ports under control.
     
    Here is another issue. I am using Harmony V2_06:
     
    #define indexd1 PORT_CHANNEL_D,BIT_1
    ...
    if (!PORTReadBits(indexd1))....
     
    I defined "indexd1" but the compiler gives me this  error:
    40:42: error: macro "PORTReadBits" requires 2 arguments, but only 1 given
     
    Indexd1 has 2 arguments separated by a comma. What may be the problem?
    Please help
     
    #3
    1and0
    Access is Denied
    • Total Posts : 9221
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: Converting my old code to Harmony is not working 2019/06/10 09:48:32 (permalink)
    5 (1)
    PORTReadBits() is the old PLIB.  Try
     
    PLIB_PORTS_PinGet(PORTS_ID_0, PORT_CHANNEL_D, PORTS_BIT_POS_1);
     
    post edited by 1and0 - 2019/06/10 09:59:03
    #4
    NotTooSmart
    Junior Member
    • Total Posts : 94
    • Reward points : 0
    • Joined: 2011/11/15 11:19:37
    • Location: 0
    • Status: offline
    Re: Converting my old code to Harmony is not working 2019/06/10 14:00:30 (permalink)
    0
    But the compiles does recognize  PORTReadBits(PORT_CHANNEL_D,BIT_1), it does work.
    What is not working is #define indexd1 PORT_CHANNEL_D,BIT_1
    I should be able to write PORTReadBits(indexd1)  
    Is there a reason for the compiler error?
    #5
    1and0
    Access is Denied
    • Total Posts : 9221
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: Converting my old code to Harmony is not working 2019/06/10 14:33:22 (permalink)
    0
    Try
    #define indexd1  IOPORT_D, BIT_1

    #6
    NotTooSmart
    Junior Member
    • Total Posts : 94
    • Reward points : 0
    • Joined: 2011/11/15 11:19:37
    • Location: 0
    • Status: offline
    Re: Converting my old code to Harmony is not working 2019/06/10 15:58:57 (permalink)
    0
    It did compile, thanks!
    It is hard to believe that a space character will make a difference...
    #7
    Jump to:
    © 2019 APG vNext Commercial Version 4.5