-
-
Notifications
You must be signed in to change notification settings - Fork 40
camera: try to defer init of video objects #195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
47651c1 to
6cb0382
Compare
6cb0382 to
1af120d
Compare
|
Just incorporated this change inorder to test with the changes I am making to the ov7670.75 zephyr driver (see the pr) and it seems to working no issues so far. I think I personally prefer doing it this way for a couple of reasons. Primary of which is that if there are any errors in the init function you have a better chance of seeing them when using the core vs having to keep compiling and testing directly in zephyr and then retest with the IDE. the other reason as you said is that you are only starting the camera if you are actually using the camera. Fingers crossed that this change gets incorporated. |
1af120d to
560cd81
Compare
848982b to
bcaca7f
Compare
69633de to
74f9721
Compare
74f9721 to
3efb1a1
Compare
|
@mjs513 Wondering if this will ever be reviewed, or maybe I should go ahead and close it out? Personally I like the idea that the camera object is only initialized if/when a sketch uses the camera library. So for example Let alone it also enables you to use the Portenta H7 with cameras. But just in case I just rebased it to the latest sources |
@KurtE |
This change, removes the automatic starting of the PWM clock on the GIGA, at startup. Instead it starts the clock if/when the sketch calls the Camera::begin method. But to make this work, we also need to not start up the video objects, until after the MCLK has been started. We can do that with marking them as zephyr,deferred-init
3efb1a1 to
ec585ae
Compare
This change, removes the automatic starting of the PWM clock on the GIGA, at startup. Instead it starts the clock if/when the sketch calls the Camera::begin method.
But to make this work, we also need to not start up the video objects, until after the MCLK has been started. We can do that with marking them as zephyr,deferred-init
This is to me a better solution to adding Portenta H7 than #184 as again this
only starts up (uses) the video resources IF you actually use them in your sketch.
Some of this is discussed in the Arduino discussion: zephyrproject-rtos/zephyr#93058 (reply in thread)