[Feature Request] Hook function after xTaskResumeAll in IDLE task

Ouverte
#349 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 3 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
25/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
c

Piste de recherche

The change belongs in prvIdleTask in tasks.c, just after the xTaskResumeAll() call, and it would be gated by a new configUSE_IDLE_RESUMED_HOOK macro whose default lives in the config header. Read how the existing vApplicationIdleHook call is guarded, then check the idle task's behaviour around tickless sleep. Done means the hook is called once per idle pass when the flag is set, and the code builds with the flag off. Expect the maintainers to weigh in on whether this is wanted, since the thread has been idle for years.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

enhancement

Is your feature request related to a problem? Please describe.

On ARM Cortex-M SoC (not sure for other systems),
for tickless idle feature, developers can define generally one hook and three functions:

  • vApplicationIdleHook
  • PreSuppressTicksAndSleepProcessing
  • PreSleepProcessing
  • PostSleepProcessing

In PostSleepProcessing, the whole system continues its processing, and some OS APIs are quite likely to be called here. But, at this moment, OS is suspended, only a small portion of
APIs are allowed.

Describe the solution you'd like

Suggest to add a hook after xTaskResumeAll() in prvIdleTask:

https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/bad8f01afd2554d6f673f4ea9ea7adb51cd9da33/tasks.c#L3537

#if ( configUSE_IDLE_RESUMED_HOOK == 1 )
{
    extern void vApplicationIdleResumedHook( void );

    /* Call the user defined function from within the idle task.  This
    allows the application designer to add background functionality
    without the overhead of a separate task.
    */
    vApplicationIdleResumedHook();
}
#endif /* configUSE_IDLE_RESUMED_HOOK */

Describe alternatives you've considered

Use xSemaphoreGiveFromISR in PostSleepProcessing to notify a another task.
This is not convenient.

Langage dominant
C
Étoiles
4.6k
Forks
1.6k
Merge moyen
2 j 22 h
PR mergées (30 j)
4

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de FreeRTOS/FreeRTOS-Kernel

Toutes les issues de FreeRTOS/FreeRTOS-Kernel

Issues similaires

Plus d'issues C

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.