File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -197,12 +197,12 @@ void select_camera(uint8_t camera_id) {
197197 hdzcs_set (0x00 , g_camera_id );
198198 }
199199
200- if (camera_last != camera_list [g_camera_id ]) {
201- if (camera_list [g_camera_id ] < CAMERA_TYPE_NUM ) { // camera has inited
200+ if (camera_last != camera_list [g_camera_id - 1 ]) {
201+ if (camera_list [g_camera_id - 1 ] < CAMERA_TYPE_NUM ) { // camera has inited
202202 camera_reinit ();
203203 } else {
204204 camera_init ();
205- camera_list [g_camera_id ] = camera_type ;
205+ camera_list [g_camera_id - 1 ] = camera_type ;
206206 }
207207 camera_last = camera_type ;
208208 }
@@ -244,5 +244,28 @@ void manual_select_camera(void) {
244244 uint8_t camera_id = ((command & 0x80 ) >> 7 ) + 1 ;
245245 select_camera (camera_id );
246246 }
247+ } else if (g_camera_switch == SWITCH_TYPE_HDZCS ) {
248+ uint8_t command = hdzcs_get (0x01 );
249+ switch (command ) {
250+ case 0 :
251+ g_manual_camera_sel = 3 ; // manual analog camera
252+ break ;
253+ case 1 :
254+ g_manual_camera_sel = 2 ; // manual mipi camera 2
255+ break ;
256+ case 2 :
257+ g_manual_camera_sel = 1 ; // manual mipi camera 1
258+ break ;
259+ case 3 :
260+ g_manual_camera_sel = 0 ;
261+ break ; // assign by FC
262+ default :
263+ g_manual_camera_sel = 0 ;
264+ break ;
265+ }
266+
267+ if (g_manual_camera_sel ) {
268+ select_camera (g_manual_camera_sel );
269+ }
247270 }
248271}
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ void Init_TC3587(uint8_t fmt);
3636
3737uint8_t pi4io_get (uint8_t reg );
3838void pi4io_set (uint8_t reg , uint8_t val );
39+ uint8_t hdzcs_get (uint8_t reg );
3940void camera_switch_init (void );
4041void select_camera (uint8_t camera_id );
4142void manual_select_camera (void );
You can’t perform that action at this time.
0 commit comments