static void focus_stack_ensure_preconditions() { while (lens_info.job_state) msleep(100); if (!lv) { while (!lv) { focus_stack_check_stop(); get_out_of_play_mode(500); focus_stack_check_stop(); if (!lv) force_liveview(); if (lv) break; NotifyBoxHide(); NotifyBox(2000, "Please switch to LiveView"); msleep(200); } msleep(200); } if (is_movie_mode()) { #ifdef CONFIG_5D2 set_expsim(1); #else while (is_movie_mode()) { NotifyBox(2000, "Please switch to photo mode"); msleep(2000); } #endif } while (is_manual_focus()) { NotifyBoxHide(); NotifyBox(2000, "Please enable autofocus"); msleep(2000); } msleep(300); if (fstack_zoom > 1) set_lv_zoom(fstack_zoom); }
static void find_response_curve(const char* fname) { char fname_real[255]; snprintf(fname_real, sizeof(fname_real), "ML/LOGS/%s", fname); FILE* f = FIO_CreateFile(fname_real); ensure_movie_mode(); clrscr(); set_lv_zoom(5); msleep(1000); for (int i = 0; i < 64*2; i+=8) bmp_draw_rect(COLOR_BLACK, i*5+40, 0, 8*5, 380); draw_line( 40, 190, 720-40, 190, COLOR_BLACK); extern int bv_auto; //int bva0 = bv_auto; bv_auto = 0; // make sure it won't interfere bv_enable(); // for enabling fine 1/8 EV increments int ma = (lens_info.raw_aperture_min + 7) & ~7; for (int i = 0; i < 64*2; i++) { int a = (i/2) & ~7; // change aperture in full-stop increments lens_set_rawaperture(ma + a); lens_set_rawshutter(96 + i - a); // shutter can be changed in finer increments msleep(400); int Y,U,V; get_spot_yuv(180, &Y, &U, &V); dot( i*5 + 40 - 16, 380 - Y*380/255 - 16, COLOR_BLUE, 3); // dot has an offset of 16px my_fprintf(f, "%d %d %d %d\n", i, Y, U, V); } FIO_CloseFile(f); beep(); //~ call("dispcheck"); lens_set_rawaperture(ma); lens_set_rawshutter(96); }