Read about our upcoming Code of Conduct on this issue

Commit 9fa690ba authored by alex@thinkpad's avatar alex@thinkpad
Browse files

Merged 1200D into 1300D

--HG--
branch : 1300D
diff --git a/block/blkdebug.c b/block/blkdebug.c
index dee3a0e..b00d0f0 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -756,7 +756,7 @@ static void blkdebug_refresh_filename(BlockDriverState *bs)
if (!force_json && bs->file->bs->exact_filename[0]) {
snprintf(bs->exact_filename, sizeof(bs->exact_filename),
- "blkdebug:%s:%s",
+ "blkdebug:%s:%.4085s",
qdict_get_try_str(bs->options, "config") ?: "",
bs->file->bs->exact_filename);
}
diff --git a/block/blkverify.c b/block/blkverify.c
index c5f8e8d..b242680 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -333,7 +333,7 @@ static void blkverify_refresh_filename(BlockDriverState *bs)
&& s->test_file->bs->exact_filename[0])
{
snprintf(bs->exact_filename, sizeof(bs->exact_filename),
- "blkverify:%s:%s",
+ "blkverify:%.2000s:%.2000s",
bs->file->bs->exact_filename,
s->test_file->bs->exact_filename);
}
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index ee6b43a..c8a5f83 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -396,7 +396,7 @@ void usb_register_companion(const char *masterbus, USBPort *ports[],
void usb_port_location(USBPort *downstream, USBPort *upstream, int portnr)
{
if (upstream) {
- snprintf(downstream->path, sizeof(downstream->path), "%s.%d",
+ snprintf(downstream->path, sizeof(downstream->path), "%.12s.%d",
upstream->path, portnr);
downstream->hubcount = upstream->hubcount + 1;
} else {
diff --git a/net/slirp.c b/net/slirp.c
index f505570..1e36231 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -463,7 +463,7 @@ int net_slirp_redir(const char *redir_str)
/* automatic user mode samba server configuration */
static void slirp_smb_cleanup(SlirpState *s)
{
- char cmd[128];
+ char cmd[256];
int ret;
if (s->smb_dir[0] != '\0') {
@@ -482,8 +482,8 @@ static void slirp_smb_cleanup(SlirpState *s)
static int slirp_smb(SlirpState* s, const char *exported_dir,
struct in_addr vserver_addr)
{
- char smb_conf[128];
- char smb_cmdline[128];
+ char smb_conf[128+10];
+ char smb_cmdline[128+128];
struct passwd *passwd;
FILE *f;
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index c2ff970..ae64df0 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -13,6 +13,7 @@
#include <glib.h>
#include <sys/types.h>
+#include <sys/sysmacros.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
#include <unistd.h>
......@@ -23,7 +23,7 @@
%if MN_COUNT.get(mn,0) != 0:
<thead>
<tr><th align="left" colspan="${len(cams)+3}">&nbsp;</th></tr>
<tr><th align="left" colspan="${len(cams)+3}">${mn}</th></tr>
<tr><th id="${mn}" align="left" colspan="${len(cams)+3}">${mn}</th></tr>
<tr>
<th></th>
<th></th>
......
MODEL=100D
FW_VERSION=101
include ../Makefile.installer
RESTARTSTART=0xC53A0
SUPPORTED_INSTALLERS := 1100D.105 1200D.100 1300.110 500D.111 50D.109 550D.109 5D2.212 5D3.113 60D.111 600D.102 650D.104 6D.116 700D.115 EOSM.202 7D.203
SUPPORTED_INSTALLERS := \
1100D.105 \
1200D.102 \
1300.110 \
500D.111 \
50D.109 \
550D.109 \
5D2.212 \
5D3.113 \
60D.111 \
600D.102 \
650D.104 \
6D.116 \
700D.115 \
EOSM.202 \
7D.203 \
100D.101 \
# this need some more work: 5DC.111
TOP_DIR=..
......
MODEL=1200D
include ../Makefile.minimal
......@@ -218,7 +218,7 @@ void clrscr()
/* dummy stubs to include raw.c */
int get_ms_clock_value()
int get_ms_clock()
{
static int ms = 0;
ms += 10;
......
......@@ -24,7 +24,7 @@ all_silent: $(MODULES_ALL_TARGETS_DELETE_IF_FAILED)
# run module-specific clean rules
# also run a generic clean, just in case there are any modules left over
clean: $(MODULES_CLEAN_ALL_TARGETS)
$(call rm_files, $(addprefix $(MODULES_DIR)/, *.o *.d *.dep *.sym hgstamp))
$(call rm_files, $(addprefix $(MODULES_DIR)/, */*.mo */*.o */*.d */*.dep */*.sym */module_strings.h */hgstamp */hginfo.tmp))
install: | prepare_install_dir
install: all
......
......@@ -17,3 +17,4 @@ ML_MODULES ?= \
bench \
selftest \
adv_int \
edmac \
......@@ -349,7 +349,7 @@ static MENU_SELECT_FUNC(reg_clear_override)
.select = reg_toggle, \
.select_Q = reg_clear_override, \
.update = reg_update, \
.edit_mode = EM_MANY_VALUES_LV, \
.edit_mode = EM_SHOW_LIVEVIEW, \
.shidden = 1, \
}
......@@ -1065,7 +1065,14 @@ static unsigned int adtg_gui_init()
ADTG_WRITE_FUNC = 0x178FC; //"[REG] @@@@@@@@@@@@ Start ADTG[CS:%lx]"
CMOS_WRITE_FUNC = 0x17A1C; //"[REG] ############ Start CMOS"
}
else if (is_camera("1200D", "1.0.1"))
else if (is_camera("100D", "1.0.1"))
{
ADTG_WRITE_FUNC = 0x47144; //"[REG] @@@@@@@@@@@@ Start ADTG[CS:%lx]"
CMOS_WRITE_FUNC = 0x475B8; //"[REG] ############ Start CMOS"
ENGIO_WRITE_FUNC = 0xFF2B2460; // from stubs
ENG_DRV_OUT_FUNC = 0xFF2B2148;
}
else if (is_camera("1200D", "1.0.2"))
{
ADTG_WRITE_FUNC = 0xFF3A246C; //"[REG] @@@@@@@@@@@@ Start ADTG[CS:%lx]"
CMOS_WRITE_FUNC = 0xFF3A265C; //"[REG] ############ Start CMOS"
......
......@@ -281,56 +281,56 @@ static struct menu_entry adtg_log_menu[] =
{
.name = "cmos[0]",
.priv = cmos_delta,
.edit_mode = EM_MANY_VALUES_LV,
.edit_mode = EM_SHOW_LIVEVIEW,
.min = -1000,
.max = 1000,
},
{
.name = "cmos[1]",
.priv = cmos_delta+1,
.edit_mode = EM_MANY_VALUES_LV,
.edit_mode = EM_SHOW_LIVEVIEW,
.min = -1000,
.max = 1000,
},
{
.name = "cmos[2]",
.priv = cmos_delta+2,
.edit_mode = EM_MANY_VALUES_LV,
.edit_mode = EM_SHOW_LIVEVIEW,
.min = -1000,
.max = 1000,
},
{
.name = "cmos[3]",
.priv = cmos_delta+3,
.edit_mode = EM_MANY_VALUES_LV,
.edit_mode = EM_SHOW_LIVEVIEW,
.min = -1000,
.max = 1000,
},
{
.name = "cmos[4]",
.priv = cmos_delta+4,
.edit_mode = EM_MANY_VALUES_LV,
.edit_mode = EM_SHOW_LIVEVIEW,
.min = -1000,
.max = 1000,
},
{
.name = "cmos[5]",
.priv = cmos_delta+5,
.edit_mode = EM_MANY_VALUES_LV,
.edit_mode = EM_SHOW_LIVEVIEW,
.min = -1000,
.max = 1000,
},
{
.name = "cmos[6]",
.priv = cmos_delta+6,
.edit_mode = EM_MANY_VALUES_LV,
.edit_mode = EM_SHOW_LIVEVIEW,
.min = -1000,
.max = 1000,
},
{
.name = "cmos[7]",
.priv = cmos_delta+7,
.edit_mode = EM_MANY_VALUES_LV,
.edit_mode = EM_SHOW_LIVEVIEW,
.min = -1000,
.max = 1000,
},
......
......@@ -279,40 +279,17 @@ static int parse_next_int(char* source, size_t max_len)
}
}
//for some reason I can't link to strstr
static char* my_strstr(char* source, const char* search)
{
if(source && search && strlen(source) > 0 && strlen(search) > 0)
{
for (size_t pos = 0; pos < strlen(source) - strlen(search); pos++)
{
int found = TRUE;
for(size_t i = 0; i < strlen(search); i++)
{
if(source[pos + i] != search[i])
{
found = FALSE;
break;
}
}
if(found)
return source + pos;
}
}
return NULL;
}
static int parse_property(const char * property, char * source, size_t max_len)
{
if(source)
{
char * loc = my_strstr(source, property);
char * loc = strstr(source, property);
return loc ? parse_next_int(loc + strlen(property), max_len) : 0;
}
return 0;
}
static MENU_SELECT_FUNC(adv_int_load)
static void adv_int_load(void)
{
char filename[MAX_PATH];
char line_temp[LINE_BUF_SIZE];
......@@ -332,35 +309,45 @@ static MENU_SELECT_FUNC(adv_int_load)
while(read_line(buffer, &buf_pos, FILE_BUF_SIZE, line_temp, LINE_BUF_SIZE) > 0)
{
int kfr_time = parse_next_int(line_temp, LINE_BUF_SIZE);
struct keyframe * new_kfr = new_keyframe(keyframes, kfr_time);
if(new_kfr)
if (kfr_time)
{
new_kfr->shutter = parse_property("tv=", line_temp, LINE_BUF_SIZE);
new_kfr->aperture = parse_property("av=", line_temp, LINE_BUF_SIZE);
new_kfr->iso = parse_property("iso=", line_temp, LINE_BUF_SIZE);
new_kfr->focus = parse_property("fcs=", line_temp, LINE_BUF_SIZE);
new_kfr->interval_time = parse_property("int=", line_temp, LINE_BUF_SIZE);
new_kfr->kelvin = parse_property("wb=", line_temp, LINE_BUF_SIZE);
new_kfr->bulb_duration = parse_property("bulb=", line_temp, LINE_BUF_SIZE);
struct keyframe * new_kfr = new_keyframe(keyframes, kfr_time);
if(new_kfr)
{
new_kfr->shutter = parse_property("tv=", line_temp, LINE_BUF_SIZE);
new_kfr->aperture = parse_property("av=", line_temp, LINE_BUF_SIZE);
new_kfr->iso = parse_property("iso=", line_temp, LINE_BUF_SIZE);
new_kfr->focus = parse_property("fcs=", line_temp, LINE_BUF_SIZE);
new_kfr->interval_time = parse_property("int=", line_temp, LINE_BUF_SIZE);
new_kfr->kelvin = parse_property("wb=", line_temp, LINE_BUF_SIZE);
new_kfr->bulb_duration = parse_property("bulb=", line_temp, LINE_BUF_SIZE);
}
}
}
success = TRUE;
}
else
{
NotifyBox(2000, "Error: Could not read file");
}
fio_free(buffer);
}
else
{
NotifyBox(2000, "Error: Could not create buffer");
}
FIO_CloseFile(f);
}
else
NotifyBox(2000, "Error: Could not open file");
{
printf("adv_int: sequence file not found.\n%s", filename);
}
if(success)
NotifyBox(2000, "Sequence File Loaded");
{
printf("adv_int: sequence file loaded.\n");
}
}
static MENU_SELECT_FUNC(adv_int_save)
......@@ -422,28 +409,7 @@ static MENU_UPDATE_FUNC(time_menu_update)
{
entry->unit = UNIT_DEC;
int seconds = get_config_var("interval.time") * keyframe_time;
static char msg[50];
msg[0] = '\0';
if (seconds >= 3600)
{
STR_APPEND(msg, "%dh", seconds / 3600);
seconds = seconds % 3600;
}
if (seconds >= 60)
{
STR_APPEND(msg, "%dm", seconds / 60);
seconds = seconds % 60;
}
if (seconds || !msg[0])
{
STR_APPEND(msg, "%ds", seconds);
}
MENU_SET_RINFO("%s", msg);
MENU_SET_RINFO("%s", format_time_hours_minutes_seconds(seconds));
}
if(keyframe_exists(keyframe_time))
MENU_SET_WARNING(MENU_WARN_NOT_WORKING,"This keyframe already exists, will be overwritten");
......@@ -470,13 +436,13 @@ static MENU_UPDATE_FUNC(aperture_menu_update)
//copied/modified from shoot.c
int a = lens_info.aperture;
if (!a || !lens_info.name[0]) // for unchipped lenses, always display zero
if (!a || !lens_info.lens_exists) // for unchipped lenses, always display zero
a = 0;
MENU_SET_RINFO(SYM_F_SLASH"%d.%d", a / 10, a % 10);
if (!lens_info.aperture)
{
MENU_SET_WARNING(MENU_WARN_NOT_WORKING, lens_info.name[0] ? "Aperture is automatic - cannot adjust manually." : "Manual lens - cannot adjust aperture.");
MENU_SET_WARNING(MENU_WARN_NOT_WORKING, lens_info.lens_exists ? "Aperture is automatic - cannot adjust manually." : "Manual lens - cannot adjust aperture.");
}
}
......@@ -512,7 +478,7 @@ static MENU_UPDATE_FUNC(aperture_display)
{
int a = lens_info.aperture;
int av = APEX_AV(lens_info.raw_aperture) * 10/8;
if (!a || !lens_info.name[0]) // for unchipped lenses, always display zero
if (!a || !lens_info.lens_exists) // for unchipped lenses, always display zero
a = av = 0;
MENU_SET_VALUE(SYM_F_SLASH"%d.%d",a / 10,a % 10,av / 8,(av % 8) * 10/8);
......@@ -522,7 +488,7 @@ static MENU_UPDATE_FUNC(aperture_display)
}
if (!lens_info.aperture)
{
MENU_SET_WARNING(MENU_WARN_NOT_WORKING, lens_info.name[0] ? "Aperture is automatic - cannot adjust manually." : "Manual lens - cannot adjust aperture.");
MENU_SET_WARNING(MENU_WARN_NOT_WORKING, lens_info.lens_exists ? "Aperture is automatic - cannot adjust manually." : "Manual lens - cannot adjust aperture.");
MENU_SET_ICON(MNI_PERCENT_OFF, 0);
}
else
......@@ -783,12 +749,12 @@ PROP_HANDLER(PROP_GUI_STATE)
static struct menu_entry adv_int_menu[] =
{
{
.name = "Advanced Intervalometer",
.name = "Ramping options",
.priv = &adv_int,
.select = menu_open_submenu,
.max = 1,
.works_best_in = DEP_M_MODE,
.help = "Advanced intervalometer ramping",
.help = "Advanced intervalometer ramping options.",
.children = (struct menu_entry[])
{
{
......@@ -829,19 +795,16 @@ static struct menu_entry adv_int_menu[] =
}
},
{
.name = "Load...",
.select = adv_int_load,
.help = "Load keyframes from file"
},
{
.name = "Save...",
.name = "Save Keyframes",
.select = adv_int_save,
.help = "Save current keyframes to file"
.help = "Save current keyframes to file.",
.help2 = "This sequence will be auto-loaded at startup."
},
{
.name = "Clear",
.name = "Clear Keyframes",
.select = adv_int_clear,
.help = "Clears all keyframes"
.help = "Clears all keyframes.",
.help2 = "Note: this will not remove the saved sequence."
},
{
.name = "New Keyframe...",
......@@ -890,7 +853,7 @@ static struct menu_entry adv_int_menu[] =
.select = shutter_toggle,
.icon_type = IT_PERCENT,
.help = "Fine-tune shutter value. Displays APEX Tv or degrees equiv.",
.edit_mode = EM_MANY_VALUES_LV,
.edit_mode = EM_SHOW_LIVEVIEW,
},
MENU_EOL
}
......@@ -920,7 +883,7 @@ static struct menu_entry adv_int_menu[] =
.icon_type = IT_PERCENT,
.help = "Adjust aperture. Also displays APEX aperture (Av) in stops.",
.depends_on = DEP_CHIPPED_LENS,
.edit_mode = EM_MANY_VALUES_LV,
.edit_mode = EM_SHOW_LIVEVIEW,
},
MENU_EOL
}
......@@ -947,7 +910,7 @@ static struct menu_entry adv_int_menu[] =
.update = iso_display,
.select = iso_toggle,
.help = "Adjust and fine-tune ISO. Also displays APEX Sv value.",
.edit_mode = EM_MANY_VALUES_LV,
.edit_mode = EM_SHOW_LIVEVIEW,
},
MENU_EOL
}
......@@ -982,8 +945,8 @@ static struct menu_entry adv_int_menu[] =
},
{
.name = "White Balance",
.update = &kelvin_menu_update,
.select = &kelvin_menu_select,
.update = kelvin_menu_update,
.select = kelvin_menu_select,
.priv = &keyframe_kelvin,
.help = "Changes the Kelvin white balance",
},
......@@ -997,6 +960,7 @@ static struct menu_entry adv_int_menu[] =
static unsigned int adv_int_init()
{
adv_int_load();
menu_add("Intervalometer", adv_int_menu, COUNT(adv_int_menu));
return 0;
}
......
......@@ -19,7 +19,7 @@ static void card_benchmark_wr(int bufsize, int K, int N)
FILE* f = FIO_CreateFile(CARD_BENCHMARK_FILE);
if (f)
{
int t0 = get_ms_clock_value();
int t0 = get_ms_clock();
int i;
for (i = 0; i < n; i++)
{
......@@ -28,7 +28,7 @@ static void card_benchmark_wr(int bufsize, int K, int N)
FIO_WriteFile( f, (const void *) start, bufsize );
}
FIO_CloseFile(f);
int t1 = get_ms_clock_value();
int t1 = get_ms_clock();
int speed = filesize * 1000 * 10 / (t1 - t0);
bmp_printf(FONT_MONO_20, x, y += 20, "Write speed (buffer=%dk):\t %d.%d MB/s\n", bufsize/1024, speed/10, speed % 10);
}
......@@ -40,7 +40,7 @@ static void card_benchmark_wr(int bufsize, int K, int N)
if (buf)
{
FILE* f = FIO_OpenFile(CARD_BENCHMARK_FILE, O_RDONLY | O_SYNC);
int t0 = get_ms_clock_value();
int t0 = get_ms_clock();
int i;
for (i = 0; i < n; i++)
{
......@@ -49,7 +49,7 @@ static void card_benchmark_wr(int bufsize, int K, int N)
}
FIO_CloseFile(f);
fio_free(buf);
int t1 = get_ms_clock_value();
int t1 = get_ms_clock();
int speed = filesize * 1000 * 10 / (t1 - t0);
bmp_printf(FONT_MONO_20, x, y += 20, "Read speed (buffer=%dk):\t %d.%d MB/s\n", bufsize/1024, speed/10, speed % 10);
}
......@@ -138,7 +138,7 @@ static volatile int twocard_done = 0;
static void twocard_write_task(char* filename)
{
int bufsize = twocard_bufsize;
int t0 = get_ms_clock_value();
int t0 = get_ms_clock();
int cf = filename[0] == 'A';
int msg;
int filesize = 0;
......@@ -155,7 +155,7 @@ static void twocard_write_task(char* filename)
}
FIO_CloseFile(f);
FIO_RemoveFile(filename);
int t1 = get_ms_clock_value() - 1000;
int t1 = get_ms_clock() - 1000;
int speed = filesize * 1000 * 10 / (t1 - t0);
bmp_printf(FONT_MONO_20, 0, 120+cf*20, "[%s] Write speed (buffer=%dk):\t %d.%d MB/s\n", cf ? "CF" : "SD", bufsize/1024, speed/10, speed % 10);
}
......@@ -243,7 +243,7 @@ static void card_bufsize_benchmark_task()
FILE* f = FIO_CreateFile(CARD_BENCHMARK_FILE);
if (!f) goto cleanup;
int t0 = get_ms_clock_value();
int t0 = get_ms_clock();
int total = 0;
for (uint32_t i = 0; i < n; i++)
{
......@@ -255,7 +255,7 @@ static void card_bufsize_benchmark_task()
}
FIO_CloseFile(f);
int t1 = get_ms_clock_value();
int t1 = get_ms_clock();
int speed = total / 1024 * 1000 / 1024 * 10 / (t1 - t0);
bmp_printf(FONT_MONO_20, x, y += 20, "Write speed (buffer=%dk):\t %d.%d MB/s\n", bufsize/1024, speed/10, speed % 10);
if (y > 450) y = 100;
......
......@@ -77,8 +77,8 @@ static void mem_benchmark_run(char* msg, int* y, int bufsize, mem_bench_fun benc
msleep(200);
int times = 0;
int t0m = get_ms_clock_value();
int64_t t0 = get_us_clock_value();
int t0m = get_ms_clock();
int64_t t0 = get_us_clock();
for (int i = 0; i < INT_MAX; i++)
{
if (i%2) info_led_off(); else info_led_on();
......@@ -86,13 +86,13 @@ static void mem_benchmark_run(char* msg, int* y, int bufsize, mem_bench_fun benc
bench_fun(arg0, arg1, arg2, arg3);
/* run the benchmark for roughly 1 second */
if (get_ms_clock_value_fast() - t0m > 1000)
if (get_ms_clock() - t0m > 1000)
{
times = i + 1;
break;
}
}
int64_t t1 = get_us_clock_value();
int64_t t1 = get_us_clock();
int64_t dt = t1 - t0;
info_led_off();
......
......@@ -46,7 +46,7 @@ static float mem_perf_run(uint32_t block_size, uint32_t address)
{
uint64_t runtime = 0;
uint32_t wall_time = 0;
uint32_t wall_start = get_ms_clock_value();
uint32_t wall_start = get_ms_clock();
uint32_t loops = 1024;
uint32_t outer_loops = 0;
......@@ -61,15 +61,15 @@ static float mem_perf_run(uint32_t block_size, uint32_t address)
mem_perf_asm_128(address, block_size, 16);
/* run measurement */
uint64_t runtime_start = get_us_clock_value();
uint64_t runtime_start = get_us_clock();
mem_perf_asm_128(address, block_size, loops);
uint64_t runtime_stop = get_us_clock_value();
uint64_t runtime_stop = get_us_clock();
sei(old_int);
outer_loops++;
runtime += (runtime_stop - runtime_start);
wall_time = get_ms_clock_value() - wall_start;
wall_time = get_ms_clock() - wall_start;
}
float megabytes = (float)outer_loops * (float)block_size / 1000000.0f;
......
......@@ -141,7 +141,7 @@ static unsigned int bulb_nd_shoot_cbr()
bmp_printf(FONT_LARGE, 50, 50, "Attach ND filter and hold SET/Joystick");
}
if (set_pressed && job_state_ready_to_take_pic() && get_ms_clock_value() - set_pressed > 1000)
if (set_pressed && job_state_ready_to_take_pic() && get_ms_clock() - set_pressed > 1000)