CFILES += ses_loop.c
CFILES += ses_steps.c
+CFILES += ses_step_battery.c
CFILES += ses_step_dc_input.c
CFILES += ses_step_dc_diode.c
CFILES += ses_step_dc_transistor.c
static int _battery_handler(ScfEfunction* f, int64_t ns, int64_t count)
{
ScfEcomponent* c;
- ScfEfunction* f;
ScfEline* el;
ScfEpin* p;
size_t k;
c = f->components[0];
- c->V = 5;
+ c->v = 5;
p = c->pins[SCF_EDA_Battery_POS];
el = f->elines[p->lid];
- el->V = 5;
+ el->v = 5;
p = c->pins[SCF_EDA_Battery_NEG];
el = f->elines[p->lid];
- el->V = 0;
+ el->v = 0;
return 0;
}
static int _dc_input_handler(ScfEfunction* f, int64_t ns, int64_t count)
{
ScfEcomponent* c;
- ScfEfunction* f;
+ ScfEcomponent* B;
ScfEline* el;
ScfEpin* p;
size_t j;
size_t k;
+ B = f->components[0];
+ k = 0;
+
for (i = 0; i < f->n_elines; i++) {
el = f->elines[i];
p = c->pins [el->pins[j + 1]];
if (SCF_EDA_PIN_IN & p->flags) {
+
+ el->v = (rand() & 0x1) * B->v;
+
+ scf_logw("IN el: %ld, V: %lg\n", el->id, el->v);
+
+ k++;
+ break;
}
}
}
+ return 0;
}
ses_step_t ses_step_dc_input =