Adding new cameras, applying patches into trunk (with source code prepared) - page 162 - General Discussion and Assistance - CHDK Forum  

Adding new cameras, applying patches into trunk (with source code prepared)

  • 1611 Replies
  • 432957 Views
*

Online philmoz

  • *****
  • 3123
    • Photos
Advertisements
I wondered if stack size might be a concern, since the header is moderately large (36 bytes per buffer desc, plus 32 for header), but PTPSession seems to get a pretty generous size: 0x1000 on a540, 0x1800 on g7x and the stock PTP handlers are pretty complicated.


I considered that; but after testing it did not seem to be an issue.
It could be a static buffer; but I thought that was just wasting memory needlessly. Another option would be to malloc the buffer only once and not free it (or free it in the ptp code when the session is closed); but that was more complex. If it works on the A540 then it's probably safe to use the stack.


I missed a couple of initialisations when sections are not being sent - updated patch attached.
If you're happy with this I'll check it in.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

*

Offline reyalp

  • ******
  • 12077
I missed a couple of initialisations when sections are not being sent - updated patch attached.
If you're happy with this I'll check it in.
Seems fine to me.
Don't forget what the H stands for.

 

Related Topics