[booz_cam] fix booz cam module to work without tilt

This commit is contained in:
Gautier Hattenberger
2012-06-21 19:20:26 +02:00
parent 8a6128c58d
commit 6430d84555
2 changed files with 9 additions and 6 deletions
+6 -2
View File
@@ -33,9 +33,9 @@
uint8_t booz_cam_mode; uint8_t booz_cam_mode;
// Tilt definition // Tilt definition
int16_t booz_cam_tilt;
#ifdef BOOZ_CAM_TILT_NEUTRAL #ifdef BOOZ_CAM_TILT_NEUTRAL
int16_t booz_cam_tilt_pwm; int16_t booz_cam_tilt_pwm;
int16_t booz_cam_tilt;
#ifndef BOOZ_CAM_TILT_MIN #ifndef BOOZ_CAM_TILT_MIN
#define BOOZ_CAM_TILT_MIN BOOZ_CAM_TILT_NEUTRAL #define BOOZ_CAM_TILT_MIN BOOZ_CAM_TILT_NEUTRAL
#endif #endif
@@ -46,8 +46,8 @@ int16_t booz_cam_tilt;
#endif #endif
// Pan definition // Pan definition
#ifdef BOOZ_CAM_PAN_NEUTRAL
int16_t booz_cam_pan; int16_t booz_cam_pan;
#ifdef BOOZ_CAM_PAN_NEUTRAL
#ifndef BOOZ_CAM_PAN_MIN #ifndef BOOZ_CAM_PAN_MIN
#define BOOZ_CAM_PAN_MIN BOOZ_CAM_PAN_NEUTRAL #define BOOZ_CAM_PAN_MIN BOOZ_CAM_PAN_NEUTRAL
#endif #endif
@@ -78,9 +78,13 @@ void booz_cam_init(void) {
booz_cam_tilt_pwm = BOOZ_CAM_TILT_NEUTRAL; booz_cam_tilt_pwm = BOOZ_CAM_TILT_NEUTRAL;
BOOZ_CAM_SetPwm(booz_cam_tilt_pwm); BOOZ_CAM_SetPwm(booz_cam_tilt_pwm);
booz_cam_tilt = 0; booz_cam_tilt = 0;
#else
booz_cam_tilt = 0;
#endif #endif
#ifdef BOOZ_CAM_USE_PAN #ifdef BOOZ_CAM_USE_PAN
booz_cam_pan = BOOZ_CAM_PAN_NEUTRAL; booz_cam_pan = BOOZ_CAM_PAN_NEUTRAL;
#else
booz_cam_pan = 0;
#endif #endif
} }
+3 -4
View File
@@ -47,12 +47,11 @@
extern uint8_t booz_cam_mode; extern uint8_t booz_cam_mode;
extern int16_t booz_cam_tilt;
extern int16_t booz_cam_pan;
#ifdef BOOZ_CAM_TILT_NEUTRAL #ifdef BOOZ_CAM_TILT_NEUTRAL
extern int16_t booz_cam_tilt_pwm; extern int16_t booz_cam_tilt_pwm;
extern int16_t booz_cam_tilt;
#endif
#ifdef BOOZ_CAM_PAN_NEUTRAL
extern int16_t booz_cam_pan;
#endif #endif
extern void booz_cam_init(void); extern void booz_cam_init(void);