supplierdeeply

How to call "shoot_full" in CHDK code?

  • 7 Replies
  • 2716 Views
How to call "shoot_full" in CHDK code?
« on: 02 / February / 2008, 20:02:06 »
Advertisements
I'm trying to change mx3's motion detection code so that it does a "shoot_full" command with it's inbuilt immediate shot functionality. Currently it calls kbd_sched_shoot() which waits for flash etc and slows it down.

What is required to do a "shoot_full"? I tried changing it to
Code: [Select]
kbd_sched_press( KEY_SHOOT_FULL ) but it doesn't take a shot at all. What am I doing wrong?

*

Offline jetzt

  • ****
  • 316
  • [A710IS,(SD200)]
Re: How to call "shoot_full" in CHDK code?
« Reply #1 on: 03 / February / 2008, 03:16:22 »
I don't know too, but maybe you can get it form the ubasic source?

Just an idea, but as there is such a ubasic command, it has to be somewhere in the source.

Re: How to call "shoot_full" in CHDK code?
« Reply #2 on: 03 / February / 2008, 04:18:48 »
Maybe you can try:

kbd_key_press(KEY_SHOOT_FULL)
kbd_key_release(KEY_SHOOT_FULL)

You should place some delay between both commands...

Re: How to call "shoot_full" in CHDK code?
« Reply #3 on: 03 / February / 2008, 05:23:58 »
I tried that crunchy_3d. in fact there is also a kbd_sched_click which does both a press and a release.
I ended up copying the code from the kbd_sched_shoot function into one of my own but it still doesn't take a shot. Haven't had much time to work it out today but will give it a go tomorrow.


*

Offline mx3

  • ****
  • 372
Re: How to call "shoot_full" in CHDK code?
« Reply #4 on: 03 / February / 2008, 06:34:01 »
Maybe you can try:

kbd_key_press(KEY_SHOOT_FULL)
kbd_key_release(KEY_SHOOT_FULL)

You should place some delay between both commands...


you have to execute commands in reversed order because they place commands in stack
skype: max_dtc. ICQ: 125985663, email: win.drivers(at)gmail, eVB decompiler

Re: How to call "shoot_full" in CHDK code?
« Reply #5 on: 03 / February / 2008, 14:52:48 »
Hmmm. I'll give it a go.

Another problem I'm having though, is if I want to use the key constants such as KEY_SHOOT_FULL etc from within a different source file, what includes do I need to use? Since different cameras have different constants I can't just include keyboard.h can I? But I can't work out how the different platform declarations are used for different builds.

Sorry my c programming is a little rusty.

*

Offline mx3

  • ****
  • 372
Re: How to call "shoot_full" in CHDK code?
« Reply #6 on: 03 / February / 2008, 15:02:40 »
I made following changes but it did not work properly.
I don't remember what was wrong and don't have camera right now to check it
so you can start from these code changes

motion_detector.c

void md_kbd_sched_immediate_shoot();

if( ( motion_detector.parameters&MD_DO_IMMEDIATE_SHOOT ) !=0){
   //make shoot
   md_kbd_sched_immediate_shoot();

____________________________________________
kbd.c

void md_kbd_sched_immediate_shoot(){
   kbd_int_stack_ptr-=1;// REMOVE MD ITEM
// its all right. not a stack operation
//   kbd_key_press(KEY_SHOOT_HALF);
   kbd_key_press(KEY_SHOOT_FULL);
// its all right.
/////////////////////
KBD_STACK_PUSH(SCRIPT_WAIT_SAVE);
KBD_STACK_PUSH(KEY_SHOOT_FULL);
KBD_STACK_PUSH(SCRIPT_PRESS);
//   kbd_sched_delay(10);
// it will removed right after exit from this function
 KBD_STACK_PUSH(SCRIPT_MOTION_DETECTOR);
}
skype: max_dtc. ICQ: 125985663, email: win.drivers(at)gmail, eVB decompiler

Re: How to call "shoot_full" in CHDK code?
« Reply #7 on: 04 / February / 2008, 16:28:29 »
I don't know what's going on with this firmware and my A610. When I compile it myself from Allbest's sources and without any changes, the "immediate shoot" option in the motion detector does not work at all. The binaries from his site work fine. Do some of these need patching or something?


 

Related Topics