summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorVasilii Chernov <vchernov@inr.ru>2016-02-16 16:30:40 +0100
committerVasilii Chernov <vchernov@inr.ru>2016-02-16 16:30:40 +0100
commited9d8f285f4d81e1ce8bb5e7a5b9e471a73c1590 (patch)
tree8b05ef6a4585b0d585f82c468cf92048a05f79ee /views
parentfc80d8b64672785b4d9c7127e852ca9bf19c9194 (diff)
downloadpcitool-ed9d8f285f4d81e1ce8bb5e7a5b9e471a73c1590.tar.gz
pcitool-ed9d8f285f4d81e1ce8bb5e7a5b9e471a73c1590.tar.bz2
pcitool-ed9d8f285f4d81e1ce8bb5e7a5b9e471a73c1590.tar.xz
pcitool-ed9d8f285f4d81e1ce8bb5e7a5b9e471a73c1590.zip
1. Add python thread initialization to pcilib_init_py()
-Fix pcilib_script_run_func() work in multithread mode 2. pcilib_close() - Move free_py() code after free views to make view destructors work properly 3. Move script hash to pcilib_py_s 4. Move pcilib_get_logger() pcilib_get_logger_min_prio() and pcilib_get_logger_argument() declarations to error.h 5. Refactor pcilib_get_value_as_pyobject pcilib_set_value_from_pyobject to more unified form 6. Add more memory checks. Fix some string memory allocations. 7. Refactor pcilib_py_s member names. 8. Merge pcilib_script_read() and pcilib_script_write() to pcilib_script_run_func() 9. Update test_pywrap views scripts
Diffstat (limited to 'views')
-rw-r--r--views/transform.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/views/transform.c b/views/transform.c
index 75b95b2..24434e3 100644
--- a/views/transform.c
+++ b/views/transform.c
@@ -22,7 +22,8 @@ static int pcilib_transform_view_read(pcilib_t *ctx, pcilib_view_context_t *view
if (err) return err;
if(v->module)
- return pcilib_script_read(ctx, v->module, val);
+ return err = pcilib_script_run_func(ctx, v->module,
+ "read_from_register", val);
else
return pcilib_py_eval_string(ctx, v->read_from_reg, val);
}
@@ -40,7 +41,8 @@ static int pcilib_transform_view_write(pcilib_t *ctx, pcilib_view_context_t *vie
if(v->module)
- err = pcilib_script_write(ctx, v->module, &val_copy);
+ err = pcilib_script_run_func(ctx, v->module,
+ "write_to_register", &val_copy);
else
err = pcilib_py_eval_string(ctx, v->write_to_reg, &val_copy);
@@ -55,7 +57,7 @@ void pcilib_transform_view_free_description (pcilib_t *ctx, pcilib_view_descript
pcilib_transform_view_description_t *v = (pcilib_transform_view_description_t*)(view);
if(v->module)
- pcilib_py_free_script(v->module);
+ pcilib_py_free_script(ctx, v->module);
}
pcilib_view_context_t * pcilib_transform_view_init(pcilib_t *ctx, const pcilib_view_description_t *desc)