diff options
-rw-r--r-- | apps/compare_to_value.c | 2 | ||||
-rw-r--r-- | apps/pio_test.c | 2 | ||||
-rw-r--r-- | ipecamera/ipecamera.c | 12 | ||||
-rw-r--r-- | ipecamera/private.h | 1 |
4 files changed, 12 insertions, 5 deletions
diff --git a/apps/compare_to_value.c b/apps/compare_to_value.c index e1082ce..75ad353 100644 --- a/apps/compare_to_value.c +++ b/apps/compare_to_value.c @@ -62,5 +62,5 @@ int main(int argc, char *argv[]) { free(buf); printf("%lu of %lu is wrong\n", count, total); - + return 0; } diff --git a/apps/pio_test.c b/apps/pio_test.c index 7eca362..84439ee 100644 --- a/apps/pio_test.c +++ b/apps/pio_test.c @@ -16,7 +16,7 @@ //#define REALTIME #define BAR PCILIB_BAR0 -#define BITS 16 +#define BITS 32 #define MASK ((1ll << BITS) - 1) diff --git a/ipecamera/ipecamera.c b/ipecamera/ipecamera.c index 1b8752e..54df33f 100644 --- a/ipecamera/ipecamera.c +++ b/ipecamera/ipecamera.c @@ -284,11 +284,17 @@ int ipecamera_start(pcilib_context_t *vctx, pcilib_event_t event_mask, pcilib_ev return PCILIB_ERROR_INVALID_REQUEST; } + // Allow readout and clean the FRAME_REQUEST mode if set for some reason - SET_REG(control_reg, IPECAMERA_IDLE|IPECAMERA_READOUT_FLAG); + GET_REG(control_reg, value); + SET_REG(control_reg, value|IPECAMERA_READOUT_FLAG); usleep(IPECAMERA_SLEEP_TIME); - CHECK_STATUS_REG(); - if (err) return err; + if (value&0x1000) ctx->fr_mode = 1; + else { + ctx->fr_mode = 0; + CHECK_STATUS_REG(); + if (err) return err; + } ctx->event_id = 0; ctx->preproc_id = 0; diff --git a/ipecamera/private.h b/ipecamera/private.h index 739aa97..47c80a9 100644 --- a/ipecamera/private.h +++ b/ipecamera/private.h @@ -123,6 +123,7 @@ struct ipecamera_s { size_t max_frames; /**< Maximal number of frames what may be buffered in camera DDR memory */ int firmware; /**< Firmware version */ + int fr_mode; /**< Fast Reject mode */ int cmosis_outputs; /**< Number of active cmosis outputs: 4 or 16 */ int width, height; |