diff options
author | Vasilii Chernov <vchernov@inr.ru> | 2016-02-26 11:01:39 +0100 |
---|---|---|
committer | Vasilii Chernov <vchernov@inr.ru> | 2016-02-26 11:01:39 +0100 |
commit | 0e584d07a0776454fd5487b7d23407c0624b56c2 (patch) | |
tree | 1e00cacf2077c5004c4e151d2bf3f9dddbb1b9ea /views/transform.c | |
parent | e2550e6df11558ccd6e8b95f489c0988b34347af (diff) | |
parent | 30d740cc6accc3bd477e6bc924d5b74dad71ee6d (diff) | |
download | pcitool-0e584d07a0776454fd5487b7d23407c0624b56c2.tar.gz pcitool-0e584d07a0776454fd5487b7d23407c0624b56c2.tar.bz2 pcitool-0e584d07a0776454fd5487b7d23407c0624b56c2.tar.xz pcitool-0e584d07a0776454fd5487b7d23407c0624b56c2.zip |
Merge with ufo.kit.edu/csa/pcitool 357 revision
Diffstat (limited to 'views/transform.c')
-rw-r--r-- | views/transform.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/views/transform.c b/views/transform.c index 7906743..25f30d1 100644 --- a/views/transform.c +++ b/views/transform.c @@ -19,26 +19,26 @@ static pcilib_view_context_t * pcilib_transform_view_init(pcilib_t *ctx, pcilib_ pcilib_transform_view_description_t *v = (pcilib_transform_view_description_t*)(ctx->views[view]); if(v->script) { - pcilib_access_mode_t mode = 0; - - err = pcilib_py_load_script(ctx, v->script); - if(err) { - pcilib_error("Error (%i), loading script %s", err, v->script); - return NULL; - } - - err = pcilib_py_get_transform_script_properties(ctx, v->script, &mode); - if(err) { - pcilib_error("Error (%i) obtaining properties of transform script %s", err, v->script); - return NULL; - } - - if ((v->base.mode&PCILIB_REGISTER_RW) == 0) - v->base.mode |= PCILIB_REGISTER_RW; - v->base.mode &= (~PCILIB_REGISTER_RW)|mode; - - if (!v->read_from_reg) v->read_from_reg = "read_from_register"; - if (!v->write_to_reg) v->write_to_reg = "write_to_register"; + pcilib_access_mode_t mode = 0; + + err = pcilib_py_load_script(ctx, v->script); + if(err) { + pcilib_error("Error (%i), loading script %s", err, v->script); + return NULL; + } + + err = pcilib_py_get_transform_script_properties(ctx, v->script, &mode); + if(err) { + pcilib_error("Error (%i) obtaining properties of transform script %s", err, v->script); + return NULL; + } + + if ((v->base.mode&PCILIB_REGISTER_RW) == 0) + v->base.mode |= PCILIB_REGISTER_RW; + v->base.mode &= (~PCILIB_REGISTER_RW)|mode; + + if (!v->read_from_reg) v->read_from_reg = "read_from_register"; + if (!v->write_to_reg) v->write_to_reg = "write_to_register"; } view_ctx = (pcilib_view_context_t*)malloc(sizeof(pcilib_view_context_t)); @@ -57,9 +57,9 @@ static int pcilib_transform_view_read(pcilib_t *ctx, pcilib_view_context_t *view if (err) return err; if (v->script) - err = pcilib_py_eval_func(ctx, v->script, v->read_from_reg, val); + err = pcilib_py_eval_func(ctx, v->script, v->read_from_reg, val); else - err = pcilib_py_eval_string(ctx, v->read_from_reg, val); + err = pcilib_py_eval_string(ctx, v->read_from_reg, val); return err; } @@ -75,9 +75,9 @@ static int pcilib_transform_view_write(pcilib_t *ctx, pcilib_view_context_t *vie if (err) return err; if (v->script) - err = pcilib_py_eval_func(ctx, v->script, v->write_to_reg, &val_copy); + err = pcilib_py_eval_func(ctx, v->script, v->write_to_reg, &val_copy); else - err = pcilib_py_eval_string(ctx, v->write_to_reg, &val_copy); + err = pcilib_py_eval_string(ctx, v->write_to_reg, &val_copy); if (err) return err; |