fork download
  1. void IRQHandler() {
  2. if (cond) {
  3. xTaskNotifyGiveFromISR(task_handler, &xHigherPriorityTaskWoken);
  4. }
  5. }
  6.  
  7. void func() {
  8. // Clear all pending notifications
  9. // while (ulTaskNotifyTake(pdTRUE, 0)){} works
  10. // xTaskNotifyStateClear(NULL) does not
  11. start(); // does something that eventually triggers an interrupt
  12. ulTaskNotifyTake(pdTRUE, pdMS_TO_TICKS(100));
  13. // continue
  14. // eventually a second interrupt may occurs and an unreceived notification is generated
  15. }
  16.  
  17. void task(void* params) {
  18. for (;;) {
  19. func();
  20. }
  21. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘IRQHandler’:
prog.c:2:6: error: ‘cond’ undeclared (first use in this function); did you mean ‘void’?
  if (cond) {
      ^~~~
      void
prog.c:2:6: note: each undeclared identifier is reported only once for each function it appears in
prog.c:3:3: warning: implicit declaration of function ‘xTaskNotifyGiveFromISR’ [-Wimplicit-function-declaration]
   xTaskNotifyGiveFromISR(task_handler, &xHigherPriorityTaskWoken);
   ^~~~~~~~~~~~~~~~~~~~~~
prog.c:3:26: error: ‘task_handler’ undeclared (first use in this function); did you mean ‘IRQHandler’?
   xTaskNotifyGiveFromISR(task_handler, &xHigherPriorityTaskWoken);
                          ^~~~~~~~~~~~
                          IRQHandler
prog.c:3:41: error: ‘xHigherPriorityTaskWoken’ undeclared (first use in this function)
   xTaskNotifyGiveFromISR(task_handler, &xHigherPriorityTaskWoken);
                                         ^~~~~~~~~~~~~~~~~~~~~~~~
prog.c: In function ‘func’:
prog.c:9:2: warning: implicit declaration of function ‘ulTaskNotifyTake’ [-Wimplicit-function-declaration]
  ulTaskNotifyTake(pdTRUE, pdMS_TO_TICKS(100));
  ^~~~~~~~~~~~~~~~
prog.c:9:19: error: ‘pdTRUE’ undeclared (first use in this function)
  ulTaskNotifyTake(pdTRUE, pdMS_TO_TICKS(100));
                   ^~~~~~
prog.c:9:27: warning: implicit declaration of function ‘pdMS_TO_TICKS’ [-Wimplicit-function-declaration]
  ulTaskNotifyTake(pdTRUE, pdMS_TO_TICKS(100));
                           ^~~~~~~~~~~~~
stdout
Standard output is empty