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

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

  • 1679 Replies
  • 767928 Views
*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #570 on: 03 / December / 2011, 16:21:56 »
Advertisements
I cleaned up stubs_entry2.S files and of course this results in new generated versions of stubs_entry.S files.
...

Oh, additional changes I did for 100c I missed to do for 101a and 101c before providing patch. :(

Therefore please find attached another patch with missing change for 101a and 101c firmware. :)

Thanks to CHDKLover from german CHDK Forum for the hint!

Removed unnecessary functions/variable for JogDial from lib.c and kbd.c.

Please find attached the patch.


Both added in changeset 1447.

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)

Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #571 on: 03 / December / 2011, 17:15:54 »
Here's a patch which makes drawing function available from Lua. More described here:
http://chdk.setepontos.com/index.php?topic=7097.0

The zip contains also drawings.lua module which is going to be placed in LUALIB directory (I don't know how to add new file to the code through .patch file). This module enhances drawing from lua so it is intended to be added if patch will be applied.
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #572 on: 03 / December / 2011, 17:35:56 »
Here's a patch which makes drawing function available from Lua. More described here:
http://chdk.setepontos.com/index.php?topic=7097.0

The zip contains also drawings.lua module which is going to be placed in LUALIB directory (I don't know how to add new file to the code through .patch file). This module enhances drawing from lua so it is intended to be added if patch will be applied.

Can I suggest a small(ish) change.
Instead of using palette values for colors (which will make the scripts less portable), define a color map table in CHDK and use 'script' color values in your module.

In gui_draw.h there are defines for a limited set of colors for each camera - while the colors may not always be correct they are at least all there.

Define a table like
    unsigned char script_colors[] = { COLOR_TRANSPARENT, COLOR_BLACK, COLOR_WHITE, ... };
then your scripts can use the indexes into this array as portable color values.

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)

Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #573 on: 03 / December / 2011, 18:00:41 »
@philmoz - CHDK colors for drawing are good idea, I will follow it and prepate this. Nevertheless I believe that it would be good to give a user also possibility to use hex values. Maybe as: draw.colors_mode("chdk") which would be default and draw.colors_mode("hex") which would give the user possibility to use hex values directly (not portable).

The second way would be usefull for example for grid editor since grids are displayed by using hexs.
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick


*

Offline vnd

  • *
  • 36
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #574 on: 04 / December / 2011, 05:28:29 »
Remote trigger Ricoh CA-1 currently does not work with CHDK - the emulated half-press is released after 1s.
This is a fix ported from SDM.

Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #575 on: 04 / December / 2011, 10:05:30 »
@Philmoz
I tried, but this is not a simple task. Defines are different in play and rec mode, I found that my sx130 defines are not really correct (as COLOR_SOMETHING, only COLO_HISTO... are ok). The whole thing about colors is so scary! Maybe it's time to start a project for new implementation of colors? All colors should have defines of play and rec values to be used. I guess that there's no other way.

At the moment I could use histogram values, which are defined for all cameras.
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #576 on: 04 / December / 2011, 10:07:48 »
Patch to enable manual focus (in AF lock mode) on IXUS220/ELPH 300 HS.  Can be enabled in other models via #define CAM_CAN_SD_OVER_IN_AF_LOCK 1 in platform_camera.h (assuming PROPCASE_AF_LOCK is defined for the model).

Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #577 on: 04 / December / 2011, 12:02:22 »
Remote trigger Ricoh CA-1 currently does not work with CHDK - the emulated half-press is released after 1s.
This is a fix ported from SDM.
Tested on my G10 and SD940.  The CA-1 works much better now - although it still refocuses between the half-press and full-press.
Ported :   A1200    SD940   G10    Powershot N    G16


Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #578 on: 04 / December / 2011, 20:38:01 »
From the ELPH 300 HS porting thread:


I changed the while loop to look like the SX30 etc. one:

Code: [Select]
while (zoom_busy) msleep(10);
... which fixed the problem for the IXUS 220 (allowing me to zoom all the way out in the lua script with no hang), and I suspect might fix the S95 too, although I can't test that.


This fix has been confirmed to work for the S95 as well; but I haven't got around to fixing the code.

Adding the msleep(10) to the default case loop should also be done in my opinion (infinite loops are not a good practice in my opinion).

Phil.

I've attached a diff that does this, which you can merge if you'd like.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #579 on: 05 / December / 2011, 05:09:51 »
Remote trigger Ricoh CA-1 currently does not work with CHDK - the emulated half-press is released after 1s.
This is a fix ported from SDM.

Patch to enable manual focus (in AF lock mode) on IXUS220/ELPH 300 HS.  Can be enabled in other models via #define CAM_CAN_SD_OVER_IN_AF_LOCK 1 in platform_camera.h (assuming PROPCASE_AF_LOCK is defined for the model).

From the ELPH 300 HS porting thread:


I changed the while loop to look like the SX30 etc. one:

Code: [Select]
while (zoom_busy) msleep(10);
... which fixed the problem for the IXUS 220 (allowing me to zoom all the way out in the lua script with no hang), and I suspect might fix the S95 too, although I can't test that.


This fix has been confirmed to work for the S95 as well; but I haven't got around to fixing the code.

Adding the msleep(10) to the default case loop should also be done in my opinion (infinite loops are not a good practice in my opinion).

Phil.

I've attached a diff that does this, which you can merge if you'd like.

Added in changeset 1457.

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)

 

Related Topics