[Feature Request] Hook function after xTaskResumeAll in IDLE task

Aperta
#349 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
c

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
C
Stelle
4.6k
Fork
1.6k
Merge medio
2g 22h
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di FreeRTOS/FreeRTOS-Kernel

Tutte le issue di FreeRTOS/FreeRTOS-Kernel

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.