Skip to content
Snippets Groups Projects
Commit 4982a630 authored by Andrew Johnson's avatar Andrew Johnson
Browse files

db: Don't call epicsPrintf() from callbackRequest()

The callbackRequest() routine can be called from an ISR,
so use epicsInterruptContextMessage() to print errors.
parent 243baddb
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "cantProceed.h"
#include "dbDefs.h"
......@@ -152,12 +153,12 @@ void callbackRequest(CALLBACK *pcallback)
int lockKey;
if (!pcallback) {
epicsPrintf("callbackRequest called with NULL pcallback\n");
epicsInterruptContextMessage("callbackRequest: pcallback was NULL\n");
return;
}
priority = pcallback->priority;
if (priority < 0 || priority >= NUM_CALLBACK_PRIORITIES) {
epicsPrintf("callbackRequest called with invalid priority\n");
epicsInterruptContextMessage("callbackRequest: Bad priority\n");
return;
}
if (ringOverflow[priority]) return;
......@@ -167,8 +168,11 @@ void callbackRequest(CALLBACK *pcallback)
epicsInterruptUnlock(lockKey);
if (!pushOK) {
errlogPrintf("callbackRequest: %s ring buffer full\n",
threadName[priority]);
char msg[48] = "callbackRequest: ";
strcat(msg, threadName[priority]);
strcat(msg, " ring buffer full\n");
epicsInterruptContextMessage(msg);
ringOverflow[priority] = TRUE;
}
epicsEventSignal(callbackSem[priority]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment