-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Video: Correct use of global variable #439
Comments
I am looking into it ASAP |
A related issus the the use, or rather the lacke of the use of the video driver initialization function: video_initialize(). That function should be called from the board bringup() functions but it is not. In fact, it is not called from anywhere in the OS. Searching a little, we find that it is insanely called from the Sony SDK applications directly. That is very bad design: Calling directly into the OS from application bypassing the portable, POSIX interface is strictly forbidden. From the INVIOLABLES.txt:
My recommendation is:
The current situation is intolerable and must be corrected! |
I am sorry for the long response time and thanks for the suggestion. |
@patacongo can we close the issue? |
…-enable ESP32s3 t3pw-dev SMP test enable
Reported to me via email:
The v4l2-like layer (video.c) uses a global variable inappropriately. A global variable is used instead of creating a struct in /boards/ and passing it. So we have g_video_devops->set_buf(...) for example
g_video_devops being declared in video.h: FAR const struct video_devops_s *g_video_devops;
And being used in the CXD56xx board here: boards/arm/cxd56xx/spresense/src/cxd56_bringup.c: g_video_devops = isx012_initialize();
Wouldn't it be better to create the pointer in boards and pass it as argument ? Using global variables at inter-module interfaces is not good design and anathema to embedded systems. From the INVIOLABLES.txt:
The text was updated successfully, but these errors were encountered: