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
This commit is contained in:
rlar 2018-03-08 19:33:59 +01:00
parent b33f47242b
commit 5a6aef4732
2 changed files with 8 additions and 0 deletions

View File

@ -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;

View File

@ -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;