void updateConditions() { if(timerNotRunning != !timer.running) menu.refresh(); timerNotRunning = !timer.running; modeTimelapse = (timer.current.Mode & TIMELAPSE); modeHDR = (timer.current.Mode & HDR); modeStandard = (!modeHDR && !modeRamp); modeRamp = (timer.current.Mode & RAMP); modeRampKeyAdd = (modeRamp && (timer.current.Keyframes < MAX_KEYFRAMES)); modeRampKeyDel = (modeRamp && (timer.current.Keyframes > 1)); bulb1 = timer.current.Keyframes > 1 && modeRamp; bulb2 = timer.current.Keyframes > 2 && modeRamp; bulb3 = timer.current.Keyframes > 3 && modeRamp; bulb4 = timer.current.Keyframes > 4 && modeRamp; showGap = timer.current.Photos != 1 && modeTimelapse; showRemoteStart = (remote.connected && !remote.running); clock.sleepOk = timerNotRunning && !timer.cableIsConnected() && bt.state != BT_ST_CONNECTED && sleepOk; }
volatile char shutterTest(char key, char first) { static char status, cable; if(first) { status = 0; cable = 0; lcd.cls(); menu.setTitle(TEXT("Shutter Test")); menu.setBar(TEXT("Half"), TEXT("Full")); lcd.update(); } if(key == FL_KEY && status != 1) { status = 1; lcd.eraseBox(20, 18, 20 + 6 * 6, 26); lcd.writeString(20, 18, TEXT("(HALF)")); timer.half(); lcd.update(); } else if(key == FR_KEY && status != 2) { status = 2; lcd.eraseBox(20, 18, 20 + 6 * 6, 26); lcd.writeString(20, 18, TEXT("(FULL)")); timer.full(); lcd.update(); } else if(key != 0) { status = 0; lcd.eraseBox(20, 18, 20 + 6 * 6, 26); timer.off(); lcd.update(); } if(timer.cableIsConnected()) { if(cable == 0) { cable = 1; lcd.writeStringTiny(6, 28, TEXT("Cable Connected")); lcd.update(); } } else { if(cable == 1) { cable = 0; lcd.eraseBox(6, 28, 6 + 15 * 5, 36); lcd.update(); } } if(key == LEFT_KEY) return FN_CANCEL; return FN_CONTINUE; }