|
|
@@ -282,7 +282,11 @@ CCamera::CCamera(void)
|
|
|
CCstatus.ImageQuality = camera_config.jpeg_quality;
|
|
|
CCstatus.ImageFrameSize = camera_config.frame_size;
|
|
|
CCstatus.CamXclkFreqMhz = xclk;
|
|
|
- CCstatus.ImageLedIntensity = SetLEDIntensity(LedIntensity);
|
|
|
+ // The global camera object can be constructed before task scheduling is
|
|
|
+ // fully available. Initialize the PWM value without taking its runtime mutexes.
|
|
|
+ LedIntensity = static_cast<int>(
|
|
|
+ static_cast<float>(std::min(std::max(0, LedIntensity), 100)) / 100.0f * 8191.0f);
|
|
|
+ CCstatus.ImageLedIntensity = LedIntensity;
|
|
|
CCstatus.WaitBeforePicture = 2;
|
|
|
SetImageWidthHeightFromResolution(CCstatus);
|
|
|
|