ACS ACR89U-A1 User Manual Page 70

  • Download
  • Add to my manuals
  • Print
  • Page
    / 115
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 69
Document Title Here
Document Title Here
Document Title Here
ACR89U-A1 Application Programming Interface
Version 1.00
Page 70 of 115
info@acs.com.hk
www.acs.com.hk
6.4.4. vTaskSuspendAll
This function suspends all real time kernel activity while keeping interrupts (including the kernel tick)
enabled. After calling vTaskSuspendAll () the calling task will continue to execute without the risk of
being swapped out until a call to xTaskResumeAll ( ) has been made. API functions that have the
potential to cause a context switch (for example, vTaskDelayUntill ( ), xQueueSend ( ), etc.) must
not be called while the scheduler is suspended.
[task.h]
void vTaskSuspendAll( void );
Example usage:
void vTask1( void * pvParameters )
{
for( ;; )
{
// Task code goes here.
// ...
// At some point the task wants to perform a long operation during
// which it does not want to get swapped out. It cannot use
// taskENTER_CRITICAL ()/taskEXIT_CRITICAL () as the length of the
// operation may cause interrupts to be missed - including the
// ticks.
// Prevent the real time kernel swapping out the task.
vTaskSuspendAll ();
// Perform the operation here. There is no need to use critical
// sections as we have all the microcontroller processing time.
// During this time interrupts will still operate and the kernel
// tick count will be maintained.
// ...
// The operation is complete. Restart the kernel.
xTaskResumeAll ();
}
}
Page view 69
1 2 ... 65 66 67 68 69 70 71 72 73 74 75 ... 114 115

Comments to this Manuals

No comments