From: yu.dongliang <18588496441@163.com> Date: Wed, 13 Sep 2023 11:26:54 +0000 (+0800) Subject: ses_step_va_balance X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=80c068e1de3ee2e5d48654edc916212d5d944389;p=ses.git ses_step_va_balance --- diff --git a/ses_step_va.c b/ses_step_va.c index d57d842..86e302e 100644 --- a/ses_step_va.c +++ b/ses_step_va.c @@ -255,20 +255,18 @@ static int _va_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx_t* ct ScfEpin* Bp; ScfEpin* Bn; - size_t i; - size_t j; - size_t k; - B = f->components[0]; Bp = B->pins[SCF_EDA_Battery_POS]; Bn = B->pins[SCF_EDA_Battery_NEG]; printf("\n*******************\n"); + int i; + for (i = 0; i < ctx->paths->size; i++) { path = ctx->paths->data[i]; - scf_logi("i: %ld, path->type: %d\n", i, path->type); + scf_logi("i: %d, path->type: %d\n", i, path->type); if (path->pins->size < 2) { scf_loge("\n"); diff --git a/ses_step_va_balance.c b/ses_step_va_balance.c index 17b736e..e9be2fb 100644 --- a/ses_step_va_balance.c +++ b/ses_step_va_balance.c @@ -2,6 +2,46 @@ static int _va_balance_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx_t* ctx) { + ses_path_t* path; + ScfEcomponent* B; + ScfEpin* p0; + ScfEpin* p1; + ScfEpin* Bp; + ScfEpin* Bn; + + B = f->components[0]; + Bp = B->pins[SCF_EDA_Battery_POS]; + Bn = B->pins[SCF_EDA_Battery_NEG]; + + printf("\n*******************\n"); + + int i; + + for (i = 0; i < ctx->paths->size; i++) { + path = ctx->paths->data[i]; + + if (path->pins->size < 2) { + scf_loge("\n"); + return -EINVAL; + } + + p0 = path->pins->data[0]; + p1 = path->pins->data[path->pins->size - 1]; + + if (p0->lid == Bp->lid || p1->lid == Bn->lid) + continue; + + scf_logi("i: %d, path->type: %d\n", i, path->type); + + ses_path_print(path); +#if 0 + int ret = __ses_path_va(f, path); + if (ret < 0) + return ret; +#endif + printf("\n"); + } + return 0; } diff --git a/ses_steps.c b/ses_steps.c index fea076e..8306c20 100644 --- a/ses_steps.c +++ b/ses_steps.c @@ -40,7 +40,7 @@ static ses_step_t* ses_steps[] = &ses_step_jr, &ses_step_va, -// &ses_step_va_balance, + &ses_step_va_balance, &ses_step_output, };