Mark the last memory page on an Oceanic Atom 2 as unreadable.

When trying to read the last memory page from an Oceanic Atom 2, the
device does not respond. Strangely, other compatible devices are not
affected by this problem.
This commit is contained in:
Jef Driesen 2010-06-23 15:01:51 +02:00
parent a37bf20493
commit f4d3747e94

View File

@ -66,7 +66,7 @@ static const device_backend_t oceanic_atom2_device_backend = {
static const unsigned char oceanic_atom2_version[] = "2M ATOM r\0\0 512K";
static const unsigned char oceanic_oc1_version[] = "OCWATCH R\0\0 1024";
static const oceanic_common_layout_t oceanic_atom2_layout = {
static const oceanic_common_layout_t oceanic_default_layout = {
0x10000, /* memsize */
0x0000, /* cf_devinfo */
0x0040, /* cf_pointers */
@ -78,6 +78,18 @@ static const oceanic_common_layout_t oceanic_atom2_layout = {
0 /* pt_mode_logbook */
};
static const oceanic_common_layout_t oceanic_atom2_layout = {
0xFFF0, /* memsize */
0x0000, /* cf_devinfo */
0x0040, /* cf_pointers */
0x0240, /* rb_logbook_begin */
0x0A40, /* rb_logbook_end */
0x0A40, /* rb_profile_begin */
0xFFF0, /* rb_profile_end */
0, /* pt_mode_global */
0 /* pt_mode_logbook */
};
static const oceanic_common_layout_t oceanic_oc1_layout = {
0x20000, /* memsize */
0x0000, /* cf_devinfo */
@ -308,8 +320,10 @@ oceanic_atom2_device_open (device_t **out, const char* name)
// Override the base class values.
if (oceanic_common_match (oceanic_oc1_version, device->version, sizeof (device->version)))
device->base.layout = &oceanic_oc1_layout;
else
else if (oceanic_common_match (oceanic_atom2_version, device->version, sizeof (device->version)))
device->base.layout = &oceanic_atom2_layout;
else
device->base.layout = &oceanic_default_layout;
*out = (device_t*) device;