By default, comedi_to_phys() and comedi_sample_to_phys() return NAN (not
a number) if the raw sample value is 0 or maxdata. Change it to convert
any raw sample values above maxdata to NAN. Such raw samples shouldn't
occur, but this seems like a sensible thing to do. (Note that the
conversion of out-of-range values to NAN behavior can be changed via the
comedi_set_global_oor_behavior() function.)
Don't call fill_inverse_linear_polynomials(priv.parsed_file) if
priv.parsed_file is NULL as that would dereference the NULL pointer
leading to a segmentation fault.
Builds on some systems need the line:
comedi_la_LIBADD = -lm
in lib/Makefile.am
Reported by Jan Banda, using a Linux Mint Petra system with gcc version
4.8.1.
Parse parameters are now passed as the correct type instead of `void *`,
so the static inline priv() function is no longer needed to cast the
pointer to the correct type.
In the Bison source calib_yacc.y, replace the use of YYPARSE_PARAM and
YYLEX_PARAM C macros with the %parse-param and %lex-param declarations.
I still need a C macro in combination with %lex-param for it to work, so
I'm not sure I'm doing it right!
Also correct the %pure_parser declaration which should be %pure-parser
(i.e. the underscore should be a dash). This has a knock-on effect for
the yyerror() function, which now needs an extra parameter.
Remove the cmd_timed and cmd_timed_errno members from the internal
struct subdevice_struct.
cmd_timed_errno is checked but never set, so it will always be 0 and the
code that uses it is buggy as it returns the value of s->cmd_mask_errno
if s->cmd_timed_errno is non-zero and sets s->cmd_mask_errno on failure.
It shouldn't be setting s->cmd_mask_errno at all.
Since the generic timed command could depend on the length of the
channel list, don't bother caching the result, and don't set
s->cmd_mask_errno on failure.
Some calls to malloc(), realloc() or calloc() do not check the result.
Do so. Also call internal function libc_error() if they fail to set the
result for comedi_errno().
Move the comedi_parse_calibration_file() function definition to the
bottom of the file. It calls calib_yyparse() and the declaration might
not be in scope since we removed the declaration from
"lib/libinternal.h", but we know it will be declared somewhere above the
bottom of the generated "lib/calib_yacc.c" above the new location of
comedi_parse_calibration_file().
For newer versions of Bison, the declaration of our calib_yyparse()
function in "lib/libinternal.h" clashes with that in the generated
"lib/calib_yacc.h".
Remove the declarations of calib_yyerror() and calib_yyparse() from
"lib/libinternal.h" and declare them in "lib/calib_yacc.c".
If something fails after a succesful open, cleanup fails to close the file.
The code
cleanup:
if(it)
free(it);
needs to be replaced with something like:
cleanup:
if (it) {
if (it->fd >= 0) {
close(it->fd);
}
free(it);
Regards
Anders Blomdell
between COMEDI_INPUT/COMEDI_OUTPUT and corresponding config insn ids
(even though they still have the same value). Made comedi_dio_config
return 0 on success for better consistency in API.
experimental comedi_dio_bitfield2() function which works with
> 32 channels. Only works properly with ni_65xx currently.
Will post a request for review by any interested
parties to list before I bother making the rest of the drivers
work with it.