the sx20 porting thread - page 15 - General Discussion and Assistance - CHDK Forum
supplierdeeply

the sx20 porting thread

  • 1286 Replies
  • 444811 Views
*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #140 on: 27 / October / 2009, 16:51:56 »
Advertisements
Sure, here is an updated version, I also modified the propset2.h , you might find it useful (assuming your camera uses the same props as mine).
Ohh, you hooked everything in taskCreateHook at 0x1938? Well, i'll follow this also..

*

Offline RaduP

  • *****
  • 926
Re: the sx20 porting thread
« Reply #141 on: 27 / October / 2009, 16:54:43 »
Yes, for me that's the only way I could get them to work. But make sure that you check with the blinking of LEDs to make sure it works. Also, the video task is not started right away, but when the video recording starts. Took me a while to realize that :/

*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #142 on: 03 / November / 2009, 17:16:35 »
I'am back again from long weekend. :)

Now, i can report some good news.

I implemented whole the capt_seq.c, now i can override expo parameters, tested iso override and shutter speed including long exposures.

However a lot of menu functions works, srcipts, misc/filebroser, calendar, alt-mode button change. Text file reader freezes, when i open a file. Alos freezes when i try to run a game. The game screen appears correctly but after a second it freezes. (Probably missing or wrongly determined function address?)

I tested an intervallometer script, it runs, the first shot was taken correctly, but no more. It just waits. The script is running, coz' i can interrupt it.

Now, i need to work more, but it is very very good, that i'am over the first and hardest section, the booting and hooking procedure.  8)

*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #143 on: 04 / November / 2009, 18:43:03 »
I tested an intervallometer script, it runs, the first shot was taken correctly, but no more. It just waits. The script is running, coz' i can interrupt it.
Debugging this ubasic shot issue, i got no solution. I added the following debug log to ubasic_run() function:

Code: [Select]
sprintf(buf, "LINE BEG %d %d %d %d", tokenizer_line_number(), ended, tokenizer_finished(), ubasic_finished());
script_console_add_line(buf);
line_statement();
sprintf(buf, "LINE END %d %d %d %d", tokenizer_line_number(), ended, tokenizer_finished(), ubasic_finished());
script_console_add_line(buf);

I tried to run this basic program:

Code: [Select]
print "Taking shot 1 SLEEP"
sleep 1000
print "Taking shot 1 SHOT"
shoot
print "Taking shot 1 DONE"

I attached the result picture.

The ubasic_run() called from the following code:

Code: [Select]
    do {
        ubasic_run();
    } while(!ubasic_finished());

That's way, i don't understand, why the script does not continue after the first shoot token. (The first picture taken correctly)


*

Offline RaduP

  • *****
  • 926
Re: the sx20 porting thread
« Reply #144 on: 04 / November / 2009, 18:54:54 »
The basic commands are put in a stack, and to debug it you must see WTF is happening in this stack.
Here is some code I used:

Code: [Select]
void print_script_key_stack()
{
char str[80];

sprintf(str,"Pointer: %i, loc: %i,%i,%i,%i,%i,%i,%i,%i,%i,%i",kbd_int_stack_ptr,kbd_int_stack[0],kbd_int_stack[1],kbd_int_stack[2],kbd_int_stack[3],kbd_int_stack[4],kbd_int_stack[5],kbd_int_stack[6],kbd_int_stack[7],kbd_int_stack[8],kbd_int_stack[9]);
draw_string(64,16,str, conf.osd_color);

}
I have it in core/kbd.c and call it from gui.c

*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #145 on: 05 / November / 2009, 16:58:47 »
The basic commands are put in a stack, and to debug it you must see WTF is happening in this stack.
Here is some code I used:
Here is the result picture of your debug code.

When the basic script is running the Pointer and loc values changes quickly. The picture shows the state when the script seemly to be stoped.

*

Offline RaduP

  • *****
  • 926
Re: the sx20 porting thread
« Reply #146 on: 05 / November / 2009, 17:44:00 »
Those values have some meanings. One is delay/wait, other is keypresses, etc. You must determine if the stack contains the right sequence, based on what the script would do.
One other thign you can try is put too shoots in your script, and see if both are taken or just one.

*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #147 on: 05 / November / 2009, 17:54:11 »
Those values have some meanings. One is delay/wait, other is keypresses, etc. You must determine if the stack contains the right sequence, based on what the script would do.
I need time, to understand this.
Quote
One other thign you can try is put too shoots in your script, and see if both are taken or just one.
Just one. After the first shot command (token) executed, the script seems to be halted, but it is interruptable. As the screenshot shows, the script not finishes yet, just somehow it is not continues. In a normal programing environment, it is inpossible. There is something i don't know regarding CHDK. Probably another task in the background locks this script or somthing similar.


*

Offline neszt

  • ***
  • 174
Re: the sx20 porting thread
« Reply #148 on: 05 / November / 2009, 18:02:47 »
How about the propset2.h? You mentioned, that it should be useful for me also. So days ago, when i downloaded you fresh source, i used your propset. Now i tried to use the original propset, and the basic script does even not take a single picture. (it is beeps, so the picture seems to be nearly taken, but after the autofocus finished, nothing happens..)

So your propset2.h helped me, but still something wrong. How to find the correct values for all PROPCASE_*?

*

Offline RaduP

  • *****
  • 926
Re: the sx20 porting thread
« Reply #149 on: 05 / November / 2009, 18:12:53 »
Oh, yes, it could be. To find the proper props, well, that's very difficult, there are some props I couldn't even find, such as the flash related stuff.
Anyway, in this case, I think it's not a prop problem. You must see where the script stops, it could be that it is waiting for the camera to be ready to take the next shot, something like in stubs_min.S not being right or something.

Try to replace shoot with something else, like pressing the shutter button, see if that works.

 

Related Topics