Release notes, add a drvet to the example template

This commit is contained in:
Andrew Johnson authored and Dirk Zimoch committed 2026-11-03 16:17:59 +01:00
1 parent 31cff0592e
commit 05c17f08f4
4 files changed
+68 -29

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
### Fix registration of DRVETs
The C++ code generated in an IOC's `RecordDeviceDriver.cpp` file can fail
to compile if the Makefile building the IOC defines the `USE_TYPED_DRVET`
macro. Compiler errors caused by this bug will look something like this:
```
test_registerRecordDeviceDriver.cpp:198:15: error:
typedef 'drvet' cannot be referenced with the 'struct' specifier
198 | static struct drvet *drvsl[] = {
| ^
/epics/base-7.0/include/drvSup.h:38:21: note: declared here
38 | typedef typed_drvet drvet;
| ^
1 error generated.
```
[This PR](https://github.com/epics-base/epics-base/pull/902)
modifies the generated C++ code to resolve that problem, and adds a
driver to the example IOC template to catch regressions.
@@ -9,7 +9,7 @@ include $(TOP)/configure/CONFIG
# ADD MACRO DEFINITIONS BELOW HERE
# Use typed rset structure (see 3.16.1 release notes)
USR_CPPFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSET
USR_CPPFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSET -DUSE_TYPED_DRVET
# xxxRecord.h will be created from xxxRecord.dbd
DBDINC += xxxRecord
@@ -1,50 +1,67 @@
/* SPDX-FileCopyrightText: 1998 Argonne National Laboratory */
/* SPDX-FileCopyrightText: 2026 UChicago Argonne LLC */
/* SPDX-License-Identifier: EPICS */
/* devXxxSoft.c */
/* Example device support module */
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
/* Sample device & driver support interfaces */
#include "alarm.h"
#include "cvtTable.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "link.h"
#include <dbAccess.h>
#include <dbDefs.h>
#include <devSup.h>
#include <drvSup.h>
#include <epicsStdio.h>
#include <link.h>
#include <recGbl.h>
#include "xxxRecord.h"
#include "epicsExport.h"
#include <epicsExport.h>
static long init_record(dbCommon *prec)
/* Device Support Routines */
static long init_record(dbCommon *pcommon)
{
struct xxxRecord *pxxx = (struct xxxRecord *) prec;
struct xxxRecord *prec = (struct xxxRecord *) pcommon;
if (recGblInitConstantLink(&pxxx->inp, DBF_DOUBLE, &pxxx->val))
pxxx->udf = FALSE;
if (recGblInitConstantLink(&prec->inp, DBF_DOUBLE, &prec->val))
prec->udf = FALSE;
return 0;
}
static long read_xxx(struct xxxRecord *pxxx)
{
long status = dbGetLink(&(pxxx->inp), DBF_DOUBLE, &(pxxx->val), 0, 0);
/* If get was successful VAL is now defined */
static long read_xxx(struct xxxRecord *prec)
{
long status = dbGetLink(&prec->inp, DBF_DOUBLE, &prec->val, 0, 0);
/* If get was successful VAL is now defined */
if (!status)
pxxx->udf = FALSE;
prec->udf = FALSE;
return 0;
}
/*Create the dset for devXxxSoft */
/* devXxxSoft Device Entry Table */
xxxdset devXxxSoft = {
{ 5, NULL, NULL, init_record, NULL },
{ 5, NULL /* report */, NULL /* init */,
init_record, NULL /* get_ioint_info */ },
read_xxx,
};
epicsExportAddress(dset, devXxxSoft);
/* Driver Routines */
/* The report method is called by the iocsh command 'dbior'.
* Use level to show more or different information about
* the state of the driver software, connections etc.
*/
static long xxxReport(int level) {
printf("xxxDriver: Report called, level %d\n", level);
return 0;
}
/* xxxDriver Entry Table */
drvet xxxDriver = {
2,
xxxReport,
NULL /* init, rarely used */
};
epicsExportAddress(drvet, xxxDriver);
@@ -2,5 +2,7 @@
#
# SPDX-License-Identifier: EPICS
driver(xxxDriver)
include "xxxRecord.dbd"
device(xxx,CONSTANT,devXxxSoft,"Soft Channel")