Catching out of range preset monitor in EL737
This commit is contained in:
@ -354,6 +354,10 @@ static int EL737Start(struct __COUNTER *self)
|
||||
fixMode(pPriv);
|
||||
pPriv->readErrorCount = 0;
|
||||
if (self->eMode == ePreset) {
|
||||
if (self->fPreset < 1. || self->fPreset >= 2147483647.) {
|
||||
self->iErrorCode = BADTRANGE;
|
||||
return HWFault;
|
||||
}
|
||||
snprintf(pCommand, 49, "MP %d\r", (int) self->fPreset);
|
||||
} else {
|
||||
if (self->fPreset < .1 || self->fPreset > 200000) {
|
||||
|
Reference in New Issue
Block a user