examples: the examples were always meant to be all under GPL-3+
Update email address and copyright years
picoproj: allow setting the AM7XXX_ZOOM_TELE zoom mode
picoproj: get rid of exit(), return more meaningful values to userspace Maybe the values returned by picoproj will never be used, but it is better to use a clean style in example code.
picoporj: fix another -Wshorten-64-to-32 warning from clang ../examples/picoproj.c:196:8: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32] ret = fread(image, size, 1, image_fp); ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
picoproj: silence a -Wshorten-64-to-32 warning from clang ../examples/picoproj.c:187:12: error: implicit conversion loses integer precision: '__off_t' (aka 'long') to 'unsigned int' [-Werror,-Wshorten-64-to-32] size = st.st_size; ~ ~~~^~~~~~~
examples: silence a couple of clang warnings Silence a couple of warnings given when compiling with clang: ../examples/am7xxx-play.c:764:28: warning: will never be executed [-Wunreachable-code] AM7XXX_ZOOM_ORIGINAL, AM7XXX_ZOOM_TEST); ^~~~~~~~~~~~~~~~ ../examples/am7xxx-play.c:748:24: warning: will never be executed [-Wunreachable-code] AM7XXX_POWER_OFF, AM7XXX_POWER_TURBO); 2 warnings generated. ../examples/picoproj.c:142:28: warning: will never be executed [-Wunreachable-code] AM7XXX_ZOOM_ORIGINAL, AM7XXX_ZOOM_TEST); ^~~~~~~~~~~~~~~~ ../examples/picoproj.c:127:24: warning: will never be executed [-Wunreachable-code] AM7XXX_POWER_OFF, AM7XXX_POWER_TURBO); 2 warnings generated. The warnings refer to the default case of a switch statement over an enum variable, clang fails to understand that the default case can still be reached because any integer value can be assigned to the enum variables via the atoi() function. Work around the warning. The behavior is also documented here: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-September/024174.html In general assigning arbitrary values to enum variables will just be weird; using enums in read mode is always safe tho.
picoproj: remove an unreachable break statement
picoproj: remove an unneeded blank line
examples: print the usage message when a required option is missing While at it specify which option is missing when picoproj fails..
picoproj: show the image resolution when image does not fit the native one This may help spotting a missing or wrong dimension parameter on the command line.
picoproj: remove one of two consecutive blank lines
picoproj: clarify that when AM7XXX_ZOOM_TEST is set no image gets sent
examples: support multiple devices Expose a '-d <index>' option to set the device index, this way multiple devices can be used. Tested-by: Konstantin Lohmann <konstl@konstl.com>
picoproj: make the help about power mode more consistent Use the same terminology used in the Doxygen documentation, "power mode" instead of "power level". Print values using "%d" instead of "%x".
picoproj: support setting the zoom mode
picoproj: replace mmap() with more portable file stream operations This makes picoproj compile for Windows, for instance.
picoproj: fix a typo We have no am7xxx_get_info(), maybe this is a leftover of some older unreleased API version.
picoproj: issue a warning when passing "-f" more than once
picoproj: use MAP_PRIVATE in the mmap call There is no need to allow sharing the mapped region with other processes.