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

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

  • 1679 Replies
  • 783204 Views
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #1280 on: 01 / January / 2014, 23:22:54 »
Advertisements
Patch to add USB remote precision sync code to the 1.3.0 trunk.  Only enabled for A1200 at this point.  Details posted here in forum thread  :  http://chdk.setepontos.com/index.php?topic=8312.msg108644#msg108644

Note : unused #define SYNCHABLE_REMOTE_NOT_ENABLED  in camera.hixus200_sd980/platform_carmera.h removed.
« Last Edit: 01 / January / 2014, 23:28:17 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #1281 on: 01 / January / 2014, 23:54:53 »
Patch to add USB remote precision sync code to the 1.3.0 trunk.  Only enabled for A1200 at this point.  Details posted here in forum thread  :  http://chdk.setepontos.com/index.php?topic=8312.msg108644#msg108644

Note : unused #define SYNCHABLE_REMOTE_NOT_ENABLED  in camera.hixus200_sd980/platform_carmera.h removed.

Currently usb_remote.c is built as platform independent code.
It should not include platform_camera.h or have any platform dependent #ifdef code.

Either make the decisions at run time from camera_info state variables, or move usb_remote.c to be part of the platform dependent code (platform/makefile_sub.inc).

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 #1282 on: 02 / January / 2014, 00:01:42 »
Currently usb_remote.c is built as platform independent code. It should not include platform_camera.h or have any platform dependent #ifdef code. Either make the decisions at run time from camera_info state variables, or move usb_remote.c to be part of the platform dependent code (platform/makefile_sub.inc).
I think I know the answer to this,  but why?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #1283 on: 02 / January / 2014, 00:07:34 »
Currently usb_remote.c is built as platform independent code. It should not include platform_camera.h or have any platform dependent #ifdef code. Either make the decisions at run time from camera_info state variables, or move usb_remote.c to be part of the platform dependent code (platform/makefile_sub.inc).
I think I know the answer to this,  but why?

Platform independent code is only compiled once for all cameras in the batch build. If it contains platform dependent stuff, then every camera will get the settings from the first one compiled.

It can also be converted to a module more easily.

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 #1284 on: 02 / January / 2014, 00:13:50 »
Platform independent code is only compiled once for all cameras in the batch build. If it contains platform dependent stuff, then every camera will get the settings from the first one compiled. It can also be converted to a module more easily.
The second reason was my guess.  The first reason is (I think) a relatively new change but makes sense to me.

The patch will wait.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #1285 on: 02 / January / 2014, 11:29:07 »
Either make the decisions at run time from camera_info state variables, or move usb_remote.c to be part of the platform dependent code (platform/makefile_sub.inc).
Phil :

Not sure we'd want to go with the run time selection until it's tested on a lot more cameras.

Is moving it into platform dependent code as simple as moving the USB remote file names from lib/core/Makefile to platform/makefile_sub.inc ?   The comments say it will be compiled as Thumb that way - do I need to make any other changes because of that? 

This patch file compiles but I don't know if it causes problems :

Code: [Select]
Index: lib/core/Makefile
===================================================================
--- lib/core/Makefile (revision 3301)
+++ lib/core/Makefile (working copy)
@@ -11,7 +11,7 @@
 
 OBJS = gui_batt.o gui_space.o gui_usb.o gui_mbox.o gps.o gui_script.o gui_menu.o gui_user_menu.o
 OBJS+= suba.o levent.o console.o gps_math.o live_view.o ptp.o action_stack.o script.o
-OBJS+= usb_input.o usb_module.o usb_remote.o autoiso.o
+OBJS+= autoiso.o
 OBJS+= $(topdir)modules/exportlist.inc module_load.o modules.o
 
 all: libcore.a
Index: platform/makefile_sub.inc
===================================================================
--- platform/makefile_sub.inc (revision 3301)
+++ platform/makefile_sub.inc (working copy)
@@ -16,7 +16,7 @@
 #add platform dependent 'core' files (build as THUMB)
 OBJS+=main.thm.o gui_draw.thm.o memmgmt.thm.o \
      gui.thm.o kbd_process.thm.o conf.thm.o gui_osd.thm.o raw.thm.o \
-     shot_histogram.thm.o shooting.thm.o camera_info.thm.o remotecap.thm.o
+     shot_histogram.thm.o shooting.thm.o usb_input.thm.o usb_module.thm.o usb_remote.thm.o camera_info.thm.o remotecap.thm.o
 
 libplatformsub.a: $(OBJS) bin_compat.h
 

Thanks.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14080
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #1286 on: 02 / January / 2014, 15:34:47 »
I would suggest moving just that code to a function in a platform dependent file (core/usb_sync.c?). The function can be NOP if CAM_REMOTE_USES_PRECISION_SYNC is not defined.

I think your makefile is correct, but you should only have to move the one file, not the other usb remote related files. Being compiled as thumb is not a change, since the lib/core files are also thumb.
Don't forget what the H stands for.

Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #1287 on: 02 / January / 2014, 21:59:22 »
I would suggest moving just that code to a function in a platform dependent file (core/usb_sync.c?). The function can be NOP if CAM_REMOTE_USES_PRECISION_SYNC is not defined. I think your makefile is correct, but you should only have to move the one file, not the other usb remote related files. Being compiled as thumb is not a change, since the lib/core files are also thumb.
Moved wait_until_remote_button_is_released() into its own platform dependent file and added to platform/makefile_sub.inc .
« Last Edit: 02 / January / 2014, 22:22:07 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline reyalp

  • ******
  • 14080
Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #1288 on: 04 / January / 2014, 01:22:38 »
I would suggest moving just that code to a function in a platform dependent file (core/usb_sync.c?). The function can be NOP if CAM_REMOTE_USES_PRECISION_SYNC is not defined. I think your makefile is correct, but you should only have to move the one file, not the other usb remote related files. Being compiled as thumb is not a change, since the lib/core files are also thumb.
Moved wait_until_remote_button_is_released() into its own platform dependent file and added to platform/makefile_sub.inc .
Added in trunk changeset 3302

I changed the platform_camera.h include in usb_syn.c to camera.h.
Don't forget what the H stands for.

Re: Adding new cameras, applying patches into trunk (with source code prepared)
« Reply #1289 on: 14 / January / 2014, 19:48:47 »
A proposal patch to fix the eyefi functionalities I added. Relative to revision 3311.
- fixes a bug when user choses not to test a network being added
- more wait time network testing (it was often not enough)

I made extensive testing while traveling during 4 weeks, so it should be pretty stable right now.

 

Related Topics