Limit the memory capacity to 256K.

The Mares Matrix, Puck Pro and Nemo Wide 2 have only 256K of memory,
which is 4 times less compared to the Icon HD. However for some unknown
reason, trying to download 1024K succeeds, and these devices just
repeat the same data 4 times. That's why we never noticed the
difference in memory capacity before.
This commit is contained in:
Jef Driesen 2013-05-09 22:32:04 +02:00
parent ad0e187c0c
commit 50fc64ac59

View File

@ -89,6 +89,12 @@ static const mares_iconhd_layout_t mares_iconhd_layout = {
0x100000, /* rb_profile_end */
};
static const mares_iconhd_layout_t mares_matrix_layout = {
0x40000, /* memsize */
0x0A000, /* rb_profile_begin */
0x40000, /* rb_profile_end */
};
static unsigned int
mares_iconhd_get_model (mares_iconhd_device_t *device, unsigned int model)
{
@ -253,12 +259,13 @@ mares_iconhd_device_open (dc_device_t **out, dc_context_t *context, const char *
// Set the default values.
device->port = NULL;
device->layout = &mares_iconhd_layout;
memset (device->fingerprint, 0, sizeof (device->fingerprint));
memset (device->version, 0, sizeof (device->version));
if (model == NEMOWIDE2 || model == MATRIX || model == PUCKPRO) {
device->layout = &mares_matrix_layout;
device->packetsize = 64;
} else {
device->layout = &mares_iconhd_layout;
device->packetsize = 0;
}