Skip to content

Commit 43060a2

Browse files
author
Dalmir
committed
bug fix on VC6070
1 parent 88537c2 commit 43060a2

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

CameraVC0706/CameraVC0706.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
#include "CameraVC0706.h"
22

3-
CameraVC0706::CameraVC0706(SuftwareSerial *serial) : serial(serial) {
3+
CameraVC0706::CameraVC0706(SoftwareSerial *serial) : serial(serial) {
44
rxBufferPointer = 0;
55
serialNumber = 0x00;
66
framePointer = 0;
77
}
88

9-
int CameraVC0706::begin(unsigned int baud) {
9+
bool CameraVC0706::begin(unsigned int baud) {
1010
serial->begin(baud);
11-
return 1;
11+
return true;
1212
}
1313

14-
int CameraVC0706::close() {
14+
bool CameraVC0706::close() {
1515
serial->end();
16-
return 1;
16+
return true;
1717
}
1818

19-
int CameraVC0706::capture() {
19+
bool CameraVC0706::capture() {
2020
return executeBufferControl(STOP_CURRENT_FRAME);
2121
}
2222

23-
int CameraVC0706::resume() {
23+
bool CameraVC0706::resume() {
2424
return executeBufferControl(RESUME_FRAME);
2525
}
2626

27-
int CameraVC0706::executeBufferControl(unsigned char control) {
27+
bool CameraVC0706::executeBufferControl(unsigned char control) {
2828
unsigned char args[] = {(unsigned char) (control & 0x03)};
2929
return executeCommand(FBUF_CTRL, args, sizeof(args), 5);
3030
}
@@ -49,7 +49,7 @@ unsigned int CameraVC0706::readFrame(unsigned char *buf, unsigned int frameOffse
4949
}
5050

5151
unsigned int CameraVC0706::getFrameLength() {
52-
unsigned int frameLength;
52+
unsigned int frameLength = 0;
5353
unsigned char args[] = {0x00};
5454
if (!executeCommand(GET_FBUF_LEN, args, sizeof(args), 9)
5555
&& rxBuffer[4] == 0x04) {
@@ -112,7 +112,7 @@ bool CameraVC0706::getMotionMonitoringStatus() {
112112
}
113113

114114
bool CameraVC0706::pollMotionMonitoring(unsigned int timeout, void (*callback)(void *)) {
115-
long start, now;
115+
long start = 0, now = 0;
116116
bool detected = 0;
117117
start = millis();
118118
do {

CameraVC0706/CameraVC0706.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,27 +190,27 @@ class CameraVC0706 {
190190
* Public constructor.
191191
*
192192
*/
193-
CameraVC0706(SuftwareSerial *serial);
193+
CameraVC0706(SoftwareSerial *serial);
194194

195195
/**
196196
* Initializes the camera.
197197
*/
198-
int begin(unsigned int baud);
198+
bool begin(unsigned int baud);
199199

200200
/**
201201
* Closes the camera.
202202
*/
203-
int close();
203+
bool close();
204204

205205
/**
206206
* Captures a frame.
207207
*/
208-
int capture();
208+
bool capture();
209209

210210
/**
211211
* Resumes the camera.
212212
*/
213-
int resume();
213+
bool resume();
214214

215215
/**
216216
* Gets the frame length.
@@ -497,7 +497,7 @@ class CameraVC0706 {
497497
*
498498
* @param control The buffer control.
499499
*/
500-
int executeBufferControl(unsigned char control);
500+
bool executeBufferControl(unsigned char control);
501501

502502
/**
503503
* Set TV output.

0 commit comments

Comments
 (0)