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

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

  • 1679 Replies
  • 787854 Views
*

Offline reyalp

  • ******
  • 14082
Advertisements
Added, changesets 1110-1113

It's ok if you don't break them up quite this much, all of these seemed related (zoom issues specific to these two cameras) and reasonable simple.

Probably seems like I'm never satisfied :haha ... actually I'm still figuring out what works best for me. The main thing I like to avoid is <something complicated I have to think about> + <some other unrelated stuff>. Of course, "complicated" and "unrelated" are subjective.

Thanks for all your contributions.
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Patch to cleanup 'inline' file I/O functions from stdlib.h.
Since inline optimisation is turned off this was causing multiple instances of each function to be generated.
Functions moved to platform/generic/wrappers.c since they were all simple wrappers for firmware code (except ftell which is in core/main.c).
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)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline reyalp

  • ******
  • 14082
Patch to cleanup 'inline' file I/O functions from stdlib.h.
Since inline optimisation is turned off this was causing multiple instances of each function to be generated.
Functions moved to platform/generic/wrappers.c since they were all simple wrappers for firmware code (except ftell which is in core/main.c).

Added, changeset 1119
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Some more cleanup of the file I/O functions.
- mkdir, rename & remove now use the _Fut firmware functions (required for lua). FS_USE_FUT define no longer needed.
- All file I/O wrappers moved to platform/generic/wrappers.c. Direct calls to file I/O firmware code removed from raw.c.
- Re-org, and some cleanup of platform/generic/wrappers.c

Phil.
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)
  g7x2 (1.01a, 1.01b, 1.10b)


*

Offline reyalp

  • ******
  • 14082
Some more cleanup of the file I/O functions.
- mkdir, rename & remove now use the _Fut firmware functions (required for lua). FS_USE_FUT define no longer needed.
- All file I/O wrappers moved to platform/generic/wrappers.c. Direct calls to file I/O firmware code removed from raw.c.
- Re-org, and some cleanup of platform/generic/wrappers.c

Phil.
Added, changeset 1122. I removed fdelete completely, since it's the same as remove() remove now.
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Small patch for G12 & SX30 - found the rand & srand functions in the firmware,
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)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline philmoz

  • *****
  • 3450
    • Photos
G12 & SX30 patch for loading CHDK into EXMEM allocated memory.
This includes a new option to enable the feature, plus an option to enable exmem test code (see wrappers.c & gui.c).
I've moved the values for the exmem block size and video buffer skip value from camera.h to the platformsub/makefile.inc file (this seems more consistent with other things like MEMISOSTART). These values are also needed to calculate the new MEMISOSTART for loading CHDK into exmem.

This should still be considered 'experimental'; but so far seems very stable on both G12 and SX30.

Edit
Changes to suba.c were also made in this patch:
- Removed code and variables that were not being used by CHDK (makes it smaller and simpler). This was related to supplying custom functions for the allocator and also to implement 'reclaim' logic if it ran out of memory. This would be used in more complex allocation systems (might be useful in future to merge Canon memory heap with exmem heap so you could use both).
- Added a new function 'suba_largest_block' that returns the size of the largest free memory block in the free list. This is called from 'core_get_free_memory' (main,c) to get the free memory value rather than allocating and freeing decreasing sized blocks.

Phil.
« Last Edit: 02 / April / 2011, 21:46:08 by philmoz »
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)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline reyalp

  • ******
  • 14082
Small patch for G12 & SX30 - found the rand & srand functions in the firmware,
Added changeset 1123. If someone wants to look into adding these to the sig finder, that might help other cameras.

G12 & SX30 patch for loading CHDK into EXMEM allocated memory.
Very nice. Added in changeset 1124

Could you explain the changes in suba.c ?
Don't forget what the H stands for.


*

Offline philmoz

  • *****
  • 3450
    • Photos
Could you explain the changes in suba.c ?

Added details to the patch post.

Phil.
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)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline philmoz

  • *****
  • 3450
    • Photos
Patch to cleanup font handling:
- allocate font memory in a single block instead of a small chunk for each character in the font (uses less memory and avoids fragmentation).
- cleaned up code in rbf_font.c for font loading (merged two similar functions).
- fixed problem with 'Visual Settings -> Reset Files' menu option that would erase the symbol font file instead of resetting it back to the default value, causing symbols to vanish (gui.c, conf.c, conf.h).
« Last Edit: 02 / April / 2011, 22:39:48 by philmoz »
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)
  g7x2 (1.01a, 1.01b, 1.10b)

 

Related Topics