From: yu.dongliang <18588496441@163.com> Date: Tue, 5 Sep 2023 12:09:26 +0000 (+0800) Subject: tmp X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=5f45cee18d4477a180429a097ff42c01f78ebe13;p=ses.git tmp --- diff --git a/ses_step_battery.c b/ses_step_battery.c index 6f3c617..af66bdc 100644 --- a/ses_step_battery.c +++ b/ses_step_battery.c @@ -20,11 +20,13 @@ static int _battery_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx_ p->v = 6; el = f->elines[p->lid]; el->v = 6; + el->vconst = 1; p = c->pins[SCF_EDA_Battery_NEG]; p ->v = 0; el = f->elines[p->lid]; el->v = 0; + el->vconst = 1; return 0; } diff --git a/ses_step_dc_diode.c b/ses_step_dc_diode.c index 0f342e8..63d9a45 100644 --- a/ses_step_dc_diode.c +++ b/ses_step_dc_diode.c @@ -44,8 +44,9 @@ static int _dc_diode_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx el1 = f->elines[p1->lid]; if (el1->v < SCF_EDA_V_MIN || el1->v >= p1->v) { - el1->v = p1->v; - c->status = SCF_EDA_Status_ON; + el1->v = p1->v; + el1->vconst = 1; + c->status = SCF_EDA_Status_ON; } else c->status = SCF_EDA_Status_OFF; } diff --git a/ses_step_dc_input.c b/ses_step_dc_input.c index 30b9657..2a28043 100644 --- a/ses_step_dc_input.c +++ b/ses_step_dc_input.c @@ -18,7 +18,7 @@ static int _dc_input_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx if (SCF_EDA_PIN_IN & el->flags) { el->v = (rand() & 0x1) * B->v; -// el->v = B->v; + el->vconst = 1; scf_logw("IN el: %ld, V: %lg\n", el->id, el->v); } diff --git a/ses_step_dc_transistor.c b/ses_step_dc_transistor.c index 3dc6af2..cfed3ef 100644 --- a/ses_step_dc_transistor.c +++ b/ses_step_dc_transistor.c @@ -38,10 +38,10 @@ static int _dc_transistor_handler(ScfEfunction* f, int64_t ns, int64_t count, se if (pb->v > pe->v + 0.7) { pb->v = pe->v + 0.7; el->v = pb->v; - - c->status = SCF_EDA_Status_ON; + el->vconst = 1; + c->status = SCF_EDA_Status_ON; } else - c->status = SCF_EDA_Status_OFF; + c->status = SCF_EDA_Status_OFF; scf_loge("Transistor c%ld, status: %d\n", c->id, c->status); }