Hot!Remove OSAL?

Author
LJSteve
Senior Member
  • Total Posts : 121
  • Reward points : 0
  • Joined: 2010/04/11 06:32:56
  • Location: 0
  • Status: offline
2018/05/11 13:16:45 (permalink)
0

Remove OSAL?

Can the OSAL be removed?
 
My project needs to keep a high priority interrupt on. Many calls from USB and TCPIP use OSAL to turn off global interrupts. 
 
A lot of the interrupt disables seem unnecessary. Like this one:
 
/* Prevent other tasks pre-empting this sequence of code */
IntState = OSAL_CRIT_Enter(OSAL_CRIT_TYPE_HIGH);
(thisEndpointQueueSize->qSizeCurrentEpRead)++;
OSAL_CRIT_Leave(OSAL_CRIT_TYPE_HIGH, IntState);
 
It looks like disabling USB interrupts would be enough.
#1

7 Replies Related Threads

    friesen
    Super Member
    • Total Posts : 1883
    • Reward points : 0
    • Joined: 2008/05/08 05:23:35
    • Location: Indiana, USA
    • Status: offline
    Re: Remove OSAL? 2018/05/11 15:04:11 (permalink)
    0
    If you ever use an RTOS you probably shouldn't change anything to do with this.

    Erik Friesen
    #2
    LJSteve
    Senior Member
    • Total Posts : 121
    • Reward points : 0
    • Joined: 2010/04/11 06:32:56
    • Location: 0
    • Status: offline
    Re: Remove OSAL? 2018/05/11 15:42:04 (permalink)
    0
    No operating systems for this project. Or any planned projects.
    #3
    RISC
    Super Member
    • Total Posts : 5114
    • Reward points : 0
    • Status: offline
    Re: Remove OSAL? 2018/05/12 05:47:21 (permalink)
    5 (1)
    Hi,
    If your project does not use any OS, you should not see any OSAL APis....
    Check the MHCconfiguration and make sure that the OS is not selected.
    Or maybe you started from an existing Harmony example which used FreeRTOS ?
    Regards
    #4
    LJSteve
    Senior Member
    • Total Posts : 121
    • Reward points : 0
    • Joined: 2010/04/11 06:32:56
    • Location: 0
    • Status: offline
    Re: Remove OSAL? 2018/05/14 09:53:32 (permalink)
    0
    My harmony configuration does not have the RTOS option selected. Looking around in the USB and TCPIP stacks they do not appear to have switches to disable the OSAL calls. It appears that OSAL is used whether or not an RTOS is used.
    #5
    friesen
    Super Member
    • Total Posts : 1883
    • Reward points : 0
    • Joined: 2008/05/08 05:23:35
    • Location: Indiana, USA
    • Status: offline
    Re: Remove OSAL? 2018/05/14 10:04:32 (permalink)
    0
    Why not write your own OSAL calls and override the harmony ones?  That way you could do a custom implementation that would leave your ISR alone.  Without some study I wouldn't be sure that some form of it is needed for those stacks.

    Erik Friesen
    #6
    jcandle
    Super Member
    • Total Posts : 312
    • Reward points : 0
    • Joined: 2011/09/19 22:01:53
    • Location: 0
    • Status: offline
    Re: Remove OSAL? 2018/05/17 04:51:00 (permalink)
    5 (1)
    I don't know what could go wrong in PIC32, specifically, but if the interrupts are higher than the highest RTOS level AND you do not use any ports of SFR's that another function may have non-atomic use of, then it should be workable.
     
    That said, thread and safe often form a programmers worst oxymoron :)
    #7
    muellernick
    Super Member
    • Total Posts : 382
    • Reward points : 0
    • Joined: 2015/01/06 23:58:23
    • Location: Germany
    • Status: offline
    Re: Remove OSAL? 2018/05/23 01:31:55 (permalink)
    0
    All OSAL_xxx calls are macros. If you follow them, they all should result in no code.
     
    Nick
    #8
    Jump to:
    © 2018 APG vNext Trial Version 4.5