*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
AM7XXX_POWER_OFF, AM7XXX_POWER_TURBO);
printf("\t\t\t\tWARNING: Level 2 and greater require the master AND\n");
printf("\t\t\t\t the slave connector to be plugged in.\n");
AM7XXX_POWER_OFF, AM7XXX_POWER_TURBO);
printf("\t\t\t\tWARNING: Level 2 and greater require the master AND\n");
printf("\t\t\t\t the slave connector to be plugged in.\n");
- printf("\t-z <zoom mode>\t\tthe display zoom mode, between %d (original) and %d (test)\n",
- AM7XXX_ZOOM_ORIGINAL, AM7XXX_ZOOM_TEST);
+ printf("\t-z <zoom mode>\t\tthe display zoom mode, between %d (original) and %d (tele)\n",
+ AM7XXX_ZOOM_ORIGINAL, AM7XXX_ZOOM_TELE);
printf("\t-W <image width>\tthe width of the image to upload\n");
printf("\t-H <image height>\tthe height of the image to upload\n");
printf("\t-h \t\t\tthis help message\n");
printf("\t-W <image width>\tthe width of the image to upload\n");
printf("\t-H <image height>\tthe height of the image to upload\n");
printf("\t-h \t\t\tthis help message\n");
am7xxx_device_info device_info;
while ((opt = getopt(argc, argv, "d:f:F:l:p:z:W:H:h")) != -1) {
am7xxx_device_info device_info;
while ((opt = getopt(argc, argv, "d:f:F:l:p:z:W:H:h")) != -1) {
device_index = atoi(optarg);
if (device_index < 0) {
fprintf(stderr, "Unsupported device index\n");
device_index = atoi(optarg);
if (device_index < 0) {
fprintf(stderr, "Unsupported device index\n");
default:
fprintf(stderr, "Invalid power mode value, must be between %d and %d\n",
AM7XXX_POWER_OFF, AM7XXX_POWER_TURBO);
default:
fprintf(stderr, "Invalid power mode value, must be between %d and %d\n",
AM7XXX_POWER_OFF, AM7XXX_POWER_TURBO);
fprintf(stdout, "Zoom: %d\n", zoom);
break;
default:
fprintf(stderr, "Invalid zoom mode value, must be between %d and %d\n",
fprintf(stdout, "Zoom: %d\n", zoom);
break;
default:
fprintf(stderr, "Invalid zoom mode value, must be between %d and %d\n",
- ret = fread(image, size, 1, image_fp);
+ ret = (int)fread(image, size, 1, image_fp);
ret = am7xxx_open_device(ctx, &dev, 0);
if (ret < 0) {
perror("am7xxx_open_device");
ret = am7xxx_open_device(ctx, &dev, 0);
if (ret < 0) {
perror("am7xxx_open_device");
goto cleanup;
}
ret = am7xxx_open_device(ctx, &dev, device_index);
if (ret < 0) {
perror("am7xxx_open_device");
goto cleanup;
}
ret = am7xxx_open_device(ctx, &dev, device_index);
if (ret < 0) {
perror("am7xxx_open_device");
goto cleanup;
}
ret = am7xxx_get_device_info(dev, &device_info);
if (ret < 0) {
perror("am7xxx_get_device_info");
goto cleanup;
}
ret = am7xxx_get_device_info(dev, &device_info);
if (ret < 0) {
perror("am7xxx_get_device_info");
ret = am7xxx_set_zoom_mode(dev, zoom);
if (ret < 0) {
perror("am7xxx_set_zoom_mode");
ret = am7xxx_set_zoom_mode(dev, zoom);
if (ret < 0) {
perror("am7xxx_set_zoom_mode");
goto cleanup;
}
ret = am7xxx_set_power_mode(dev, power_mode);
if (ret < 0) {
perror("am7xxx_set_power_mode");
goto cleanup;
}
ret = am7xxx_set_power_mode(dev, power_mode);
if (ret < 0) {
perror("am7xxx_set_power_mode");
if ((unsigned int)width > device_info.native_width ||
(unsigned int)height > device_info.native_height)
fprintf(stderr,
"WARNING: image is %dx%d, not fitting the native resolution, it may be displayed wrongly!\n",
width, height);
if ((unsigned int)width > device_info.native_width ||
(unsigned int)height > device_info.native_height)
fprintf(stderr,
"WARNING: image is %dx%d, not fitting the native resolution, it may be displayed wrongly!\n",
width, height);
- ret = am7xxx_send_image(dev, format, width, height, image, size);
+ ret = am7xxx_send_image(dev, format, width, height, image, (unsigned int)size);