Fix decimate filter for testing on VxWorks

Also adds checks to all filter tests to abort if they
can't continue because their filter wasn't registered.
This commit is contained in:
Andrew Johnson
2022-07-08 15:55:14 -05:00
parent 83a685867c
commit 5f02bad3fc
5 changed files with 23 additions and 9 deletions
+9 -5
View File
@@ -19,6 +19,7 @@
#include "freeList.h"
#include "db_field_log.h"
#include "chfPlugin.h"
#include "epicsExit.h"
#include "epicsExport.h"
typedef struct myStruct {
@@ -102,17 +103,20 @@ static chfPluginIf pif = {
NULL /* channel_close */
};
static void decShutdown(void *ignore)
{
if (myStructFreeList)
freeListCleanup(myStructFreeList);
myStructFreeList = NULL;
}
static void decInitialize(void)
{
static int firstTime = 1;
if (!firstTime) return;
firstTime = 0;
if (!myStructFreeList)
freeListInitPvt(&myStructFreeList, sizeof(myStruct), 64);
chfPluginRegister("dec", &pif, opts);
epicsAtExit(decShutdown, NULL);
}
epicsExportRegistrar(decInitialize);