From 5a6aef47320be62d4ec8d143a5e45130875bcf25 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 8 Mar 2018 19:33:59 +0100 Subject: [PATCH] rewrite-sw, unify CKTstates[] access do it the same way as the other devices do access CKTstates[] via CKTstate0 CKTstate1 macros access device "slots" via descriptive macros --- src/spicelib/devices/csw/cswdefs.h | 4 ++++ src/spicelib/devices/sw/swdefs.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/spicelib/devices/csw/cswdefs.h b/src/spicelib/devices/csw/cswdefs.h index 898d9a41b..0b1a214c8 100644 --- a/src/spicelib/devices/csw/cswdefs.h +++ b/src/spicelib/devices/csw/cswdefs.h @@ -58,6 +58,10 @@ typedef struct sCSWinstance { #define CSW_OFF_CONDUCTANCE ckt->CKTgmin /* default off conductance */ #define CSW_NUM_STATES 2 +#define CSWswitchstate CSWstate+0 +#define CSWctrlvalue CSWstate+1 + + typedef struct sCSWmodel { /* model structure for a switch */ struct GENmodel gen; diff --git a/src/spicelib/devices/sw/swdefs.h b/src/spicelib/devices/sw/swdefs.h index fe7576e72..981abe1e6 100644 --- a/src/spicelib/devices/sw/swdefs.h +++ b/src/spicelib/devices/sw/swdefs.h @@ -57,6 +57,10 @@ typedef struct sSWinstance { #define SW_OFF_CONDUCTANCE ckt->CKTgmin /* default off conductance */ #define SW_NUM_STATES 2 +#define SWswitchstate SWstate+0 +#define SWctrlvalue SWstate+1 + + typedef struct sSWmodel { /* model structure for a switch */ struct GENmodel gen;