Esempio n. 1
0
/* applicationTick
 : Handles change of encoder by polling and sending to either 
 : UI (for display) or strobe (for parameter settings)
*/
static void applicationTick(void)
{
	int encoderChange = ENC_GetMovement();

	if (encoderChange)
	{
		if (!UI_EncoderButtonIsPressed())
		{
			// Encoder is controlling rpm/frequency or duty
			handleEncoderChange(encoderChange);
		}
		else
		{
			// Encoder is moving cursor on display
			UI_HandleEncoderChange(encoderChange);
		}
	}

	if (s_bSettingsChanged)
	{
		s_bSettingsChanged = false;
		UI_UpdateDisplay((s_settings->frequency + 5U) / 10U, s_settings->rpm, s_settings->duty);
		SetStrobe();
	}
}
Esempio n. 2
0
void Flea3Camera::Configure(Config& config) {
  // Video Mode
  SetVideoMode(config.video_mode, config.format7_mode, config.pixel_format,
               config.width, config.height);

  // Update CameraInfo here after video mode is changed
  camera_info_ = GetCameraInfo(camera_);

  // Frame Rate
  SetFrameRate(config.fps);

  // Raw Bayer
  SetRawBayerOutput(config.raw_bayer_output);

  // White Balance
  SetWhiteBalanceRedBlue(config.white_balance, config.auto_white_balance,
                         config.wb_red, config.wb_blue);

  // Exposure
  SetExposure(config.exposure, config.auto_exposure, config.exposure_value);
  SetShutter(config.auto_shutter, config.shutter_ms);
  SetGain(config.auto_gain, config.gain_db);

  SetBrightness(config.brightness);
  SetGamma(config.gamma);

  // Strobe
  SetStrobe(config.strobe_control, config.strobe_polarity);
  // Trigger
  SetTrigger(config.trigger_source, config.trigger_polarity);

  // Save this config
  config_ = config;
}
Esempio n. 3
0
static void setupTimer(void)
{
	CLK_Init(0);
	TMR8_Tick_Init(3, 0);
	
	appTick.reload = APP_TICK_MS;
	appTick.active = true;
	TMR8_Tick_AddTimerConfig(&appTick);

	heartbeatTick.reload = BLINK_TICK_MS;
	heartbeatTick.active = true;
	TMR8_Tick_AddTimerConfig(&heartbeatTick);
	
	s_settings = GetSettings();
	SetStrobe();
}