volatile char IRremote(char key, char first)
{
	if(first)
	{
		lcd.cls();
		menu.setTitle(TEXT("IR Remote"));
		menu.setBar(TEXT("Delayed"), TEXT("Trigger"));
		lcd.update();
	}

	switch(key)
	{
	   case FL_KEY:
		   ir.shutterDelayed();
		   break;

	   case FR_KEY:
		   ir.shutterNow();
		   break;

	   case LEFT_KEY:
		   return FN_CANCEL;
	}

	return FN_CONTINUE;
}
예제 #2
0
void shutter::off(void)
{
  if(conf.devMode) hardware_flashlight(0);
  if(cable_connected == 0)
  {
    if(bulb && shutter_state)
    {
      ir.shutterNow();
    }
    shutter_state = 0;
  }
  else if(conf.bulbMode == 0)
  {
    SHUTTER_CLOSE;
    MIRROR_DOWN; _delay_ms(50); CHECK_CABLE;
  }
  else if(conf.bulbMode == 1 && shutter_state == 1)
  {
    SHUTTER_CLOSE;
    MIRROR_DOWN; _delay_ms(50); CHECK_CABLE;
    shutter_state = 0;
    full();
    shutter_state = 0;
  }
}
예제 #3
0
void shutter::capture(void)
{
    if(cable_connected == 0)
    {
        ir.shutterNow();
//        ir.shutterDelayed();
    } 
    full();
    _delay_ms(75);
    off();
    ir_shutter_state = 0;
    shutter_state = 0;
}
예제 #4
0
void shutter::half(void)
{
  if(conf.devMode) hardware_flashlight(0);
  if(cable_connected == 0)
  {
    if(bulb && shutter_state)
    {
      shutter_state = 0;
      ir.shutterNow();
    }
    shutter_state = 0;
  }
  else
  {
    SHUTTER_CLOSE;
    MIRROR_UP;
  }
}
예제 #5
0
void shutter::bulbEnd(void)
{
    if(cable_connected == 0 && ir_shutter_state == 1)
    {
        ir_shutter_state = 0;
        ir.shutterNow();
//        ir.shutterDelayed();
    } 
    if(conf.bulbMode == 0)
    {
        off();
    }
    else if(conf.bulbMode == 1 && shutter_state == 1)
    {
        full();
        shutter_state = 0;
        _delay_ms(75);
        off();
    }
}
예제 #6
0
void shutter::bulbStart(void)
{
    if(cable_connected == 0 && ir_shutter_state != 1)
    {
        ir_shutter_state = 1;
        ir.shutterNow();
//        ir.shutterDelayed();
    } 
    if(conf.bulbMode == 0)
    {
        full();
    } 
    else if(conf.bulbMode == 1 && shutter_state != 1)
    {
        full();
        shutter_state = 1;
        _delay_ms(75);
        half();
    }
}
예제 #7
0
void shutter::full(void)
{
  if(conf.devMode) hardware_flashlight(1);
  if(cable_connected == 0)
  {
    if(bulb) shutter_state = 1; else shutter_state = 0;
    ir.shutterNow();
  }
  else if(conf.bulbMode == 0)
  {
    MIRROR_UP;
    SHUTTER_OPEN;
  }
  else if(conf.bulbMode == 1 && shutter_state == 0)
  {
    MIRROR_UP;
    SHUTTER_OPEN;
    shutter_state = 1;
    _delay_ms(50);
    half();
  }
}