On Jul 6, 2011, at 10:05 PM, Mike Frysinger wrote:
> On Wednesday, July 06, 2011 22:30:18 Jonathan Stroud wrote:
>> +typedef enum URJ_BUS_TYPE
>> +{
>> + urj_bus_type_parallel,
>> + urj_bus_type_spi,
>> + urj_bus_type_i2c,
>> +}
>> +urj_bus_class_t;
>
> the convention is for enums to be all caps. so this should be
> URJ_BUS_TYPE_{PARALLEL,SPI,I2C}.
Made these changes. Duh, I should have copied the format you pointed me to in
the first place.
>> --- src/flash/cfi.c (revision 1965)
>> +++ src/flash/cfi.c (working copy)
>> @@ -100,6 +100,8 @@
>> if (URJ_BUS_AREA (bus, adr, &area) != URJ_STATUS_OK)
>> // retain error state
>> return URJ_STATUS_FAIL;
>> + if (URJ_BUS_TYPE (bus) != urj_bus_type_parallel)
>> + return URJ_STATUS_FAIL;
>
> i cant think of a case where the flash driver would work on multiple buses.
> in my experience, the protocol has been tied pretty close to the bus (which
> kind of makes sense since the bus interface dictates heavily the
> communication
> spec so as to optimize transfers). so what if we also add a "urj_bus_class_t
> bus_type" to the urj_flash_driver_t structure, and then the common code can
> take care of only calling the detect funcs when the bus's type and the
> flash's
> bus type match.
> -mike
I started making these changes, but I don't think they will work quite the way
you describe. The problem
is that the flash detect functions should bail out before probing the device if
it is the wrong bus type, however
the detect functions don't know about the urj_flash_driver_t structures. I
think the way I have it is going to
be the best method unless you can suggest a better way.
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development