Re: [sane-devel] Fixing sequencing issues (was Re: Proposed Upgrade (pu) branches on GitLab)
Hello, an addendum only for the fun of it that is not meant as starting point for a discussion about coding style: On Sep 28 21:07 m. allan noah wrote (excerpt): On Mon, Sep 28, 2015 at 7:04 AM, Johannes Meixnerwrote: In sane-backends-git20150928 in backend/microtek2.c there is line 7456: ms->buf.current_src = ++ms->buf.current_src % 2; My "decent educated guess" is that ++ms->buf.current_src; ms->buf.current_src = ms->buf.current_src % 2; is meant. I'd guess it is just trying to swap 0 and 1, since all it is used for is an index into ms->buf.src_buffer, which is defined as: uint8_t *src_buffer[2]; /* two buffers because of CCD gap */ So all the code should do is: ms->buf.current_src = ! ms->buf.current_src; A perfect example for a "source code extremist" (TM Olaf Meeuwissen) point of view ;-) I think when the actual meaning is to toggle between using src_buffer[0] and src_buffer[1] then the toggling should be made obvious by explicit coding. For the fun of it here an example what I mean: -- // array[size > 2] cyclic access versus array[2] access via toggling: #include #include #define array_size 3 int main (int argc, char *argv[]) { int i; int array[array_size]; int array_index; for (array_index = 0; array_index < array_size; ++array_index) { array[array_index] = array_index * 2; } array_index = 0; for (i = 0; i < 6; ++i) { fprintf (stdout, "array[%i]=%i\n", array_index, array[array_index]); // next array element and wrap around: array_index = (array_index + 1) % array_size; } char toggle[] = { 'a', 'b' }; int toggle_state = 0; for (i = 1; i <= 6; ++i) { fprintf (stdout, "toggle[%i]=%c\n", toggle_state, toggle[toggle_state]); // Bad because fragile dependency on i (fails for i=0..5) // and obscure constant 2: // toggle_state = i % 2; // Better but obscure not operation insted of explicit value setting: // toggle_state = ! toggle_state; // Explicit toggling "if it is 0 make it 1 otherwise make it 0": toggle_state = (toggle_state == 0) ? 1 : 0; } return EXIT_SUCCESS; } -- So from my "source code extremist" point of view explicite coding should be: ms->buf.current_src = (ms->buf.current_src == 0) ? 1 : 0; Again: This is only for the fun of it and not intended to have microtek2.c changed again. Kind Regards Johannes Meixner -- SUSE LINUX GmbH - GF: Felix Imendoerffer, Jane Smithard, Graham Norton - HRB 21284 (AG Nuernberg) -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject "unsubscribe your_password" to sane-devel-requ...@lists.alioth.debian.org
[sane-devel] canoscan 5200F chip info
board - 12-00760-00H 2004-02-06 - no web info presumably canon proprietary chip 26-00254-01A 0406MHK68-05 - no web info presumably canon proprietary chip EliteMT100MHz M11B416256A-25J F2C1N30FX0351 - memory Elite Memory Technology www.esmt.com.tw/db/manager/upload/m11b416256a.pdf chip L6219DS 6990T0346 Malaysia motor driver Allegro MicroSystems SGS Thomson Microelectronics ST Microelectronics http://www.datasheetcatalog.com/datasheets_pdf/L/6/2/1/L6219DS.shtml chip WM8196CDS 43AFHSH image digitiser Wolfson Microelectronics http://www.digchip.com/datasheets/parts/datasheet/526/WM8196CDS-pdf.php -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject "unsubscribe your_password" to sane-devel-requ...@lists.alioth.debian.org
Re: [sane-devel] canoscan 5200F chip info
On Fri, Oct 2, 2015 at 2:21 PM, Gernot Hassenpflugwrote: > On Fri, Oct 2, 2015 at 10:57 AM, Humphrey van Polanen Petel > wrote: >> to sane-devel-requ...@lists.alioth.debian.org > /../ > > Hello Humphrey, > Thanks for the chip info (no idea about any of them unfortunately). > It would help if you could make a very small scan, the smallest you > can obtain (probably about 4mm by 4mm using the Canon-supplied Windows > TWAIN driver interface), at the lowest resolution (probably 75dpi) in > black and white, or greyscale or color in case other types not > available. Important information inadvertently left you! I meant taking a USB log of the traffic of a Windows-based scan. For WinXP, UsbSnoop is good, because I have a parser for that. For later versions of Windows, I guess you could you use Wiresharp with UsbPcap, looking at the output in Wireshark would work for me too. > Then zip it and send to my email (aikishugyo at gmail), if there is > anything useful that I can recognize I'll let you know. In particular, > if the scanner supports the PIXMA protocol, there is hope (support > pretty much guaranteed). Otherwise not much. > Regards, > Gernot Hassenpflug -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject "unsubscribe your_password" to sane-devel-requ...@lists.alioth.debian.org
Re: [sane-devel] Yet More Proposed Upgrades
m. allan noah writes: > These two have been merged. Thanks. PU branches have been removed. -- Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27 Support Free Software Support the Free Software Foundation https://my.fsf.org/donatehttps://my.fsf.org/join -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject "unsubscribe your_password" to sane-devel-requ...@lists.alioth.debian.org