Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


AVR32: portEnterCritical vs DisableInterrupts

Posted by Jeff Henshaw on June 19, 2009
vportEnterCritical() disables all interrupts and then increments ulCriticalNesting.

My question is when should I use one versus the other? I'm not sure what ulCriticalNesting is for, there's a number of things in the AVR32 port that don't match the documentation. Probably because the AVR32 is kinda weird. :-)

Also, any issues using vportEnterCritical() before the scheduler is running?

Thanks !

RE: AVR32: portEnterCritical vs DisableInterr

Posted by Richard on June 19, 2009
The only method of disabling and enabling interrupts that should be used are calls to taskENTER_CRITICAL() and taskEXIT_CRITICAL() as these maintain a nesting count. You should not manipulate ulCriticalNesting directly, it is purely for use of the kernel.

It is fine to use the macros before the scheduler has started, but interrupts will remain disabled until the scheduler has been started.

Also note that some ports don't disable all interrupts, but only those up to the priority used by the kernel.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

Version 10.1.0 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner