How does CHDK start running - page 2 - General Discussion and Assistance - CHDK Forum

How does CHDK start running

  • 20 Replies
  • 43969 Views
*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: How does CHDK start running
« Reply #10 on: 04 / June / 2008, 16:42:15 »
Advertisements
jeff666, interesting details. thanks.

Re: How does CHDK start running
« Reply #11 on: 06 / June / 2008, 13:41:25 »
This is very interesting.  It caused me to look for a guide to how CHDK works after it starts.  I.e. just what can you do (and not) do with CHDK.  Can't find one.  Does anyone know of a link that gives this information.  For instance information about core_spytask in Main.c.  A description in words of what the key routines do would be very helpful.

Jon

*

Offline jeff666

  • ****
  • 181
  • A720IS
Re: How does CHDK start running
« Reply #12 on: 06 / June / 2008, 15:01:16 »
It caused me to look for a guide to how CHDK works after it starts.  I.e. just what can you do (and not) do with CHDK.  Can't find one. 

Sure you can't. There is no such manual, but you'll be familiar with CHDK after an hour of reading the source.

Right now we have three tasks under control.
  • PhySw - the keyboard handler.
    • Exists in the original firmware. We duplicate parts of it to modify them and call the original firmware-code for original key-processing.
    • Runs in infinite loop, is called every 10ms and polls the keyboard. If a key is pressed, chdk checks for ALT-mode and uses the key for chdk-control, otherwise the key is sent to the cam.
    • Is the core of script-control. If a script runs, the ubasic interpreter is called to process the next command. Thus every command in ubasic takes exactly 10ms.
    • PhySw is the core for user-initiated (i.e. by keypress) action, see core/kbd.c:kbd_process()
  • CaptSeqTask - takes images.
    • Like PhySw is a modified version of an existing task. We modify this for raw-support and to control darkframe-subtraction.
  • spytask - chdk control.
    • Initializes chdk-device-indepentent stuff, draws the (chdk-)GUI and saves raw-images.
    • Is the core for things that don't involve user-interaction and are executed on a timely basis (not much, right now)

You can add new code to any of these tasks to modify device behaviour.
Note that SpyTask and kbd_process() are in core/, thus device-independent.
PhySw and CaptSeqTask are in platform/, thus device-dependent. Changes there need to be added to every camera manually.

Cheers.

Re: How does CHDK start running
« Reply #13 on: 06 / June / 2008, 16:53:20 »
Hi,
Thanks very much for the information.

It seems that the software can monitor the sequence of key presses that you have made, even when not in alt mode.  Can it also simulate key presses?

Suppose, for instance, you wanted to use the camera as a map reader.  You would have an index map and a bunch of detailed maps following after it.  The sofeware would know the relative order of the maps. You could navigate to the index map and tell CHDK that you are there.  From then on the camera monitors your key clicks and zooming in and out to keep track of where you are in the index.  When you want to view the more detailed map you just tell CHDK to go to it.  Chdk could also monitor your browsing of the detailed maps and load a new map when you get to the edge of the current map.

Possible?

Even if it couldn't simulate a key press it could at least tell you what to do, i.e. hit menu then 5 left, then zoom in twice, etc. to help you to navigate to the right detailed image.


*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: How does CHDK start running
« Reply #14 on: 07 / June / 2008, 01:52:03 »
Im not sure i understood your maprequest to the full extent. One thing is sure though: of course can chdk simulate keypresses,it happens all the time for example when you check the option 'dont turn display off' in altmode,a key is pressed lotsa times to trick the cam into not entering energy saving mode.in this case,the key is a dummy key,it is not existing in hardware.but you can do it with every key.

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: How does CHDK start running
« Reply #15 on: 07 / June / 2008, 02:07:00 »
for example when you check the option 'dont turn display off' in altmode,a key is pressed lotsa times to trick the cam into not entering energy saving mode.in this case,the key is a dummy key,it is not existing in hardware.but you can do it with every key.

It's former way... Now, this way is not used anymore, because there is a function which switches off energy saving feature...
CHDK Developer.

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: How does CHDK start running
« Reply #16 on: 07 / June / 2008, 02:16:09 »
Uhm,since which revision? Didnt notice.anyhow,just wanted to demonstrate ;)
By the way this new method seems to be flawed,for example on a610 (yes,610) it is not working as expected (display shuts off even though you are reading a text and you set the energy option to altmode).this already reported somewhere else here though.

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: How does CHDK start running
« Reply #17 on: 07 / June / 2008, 02:32:10 »
Uhm,since which revision?

Since #160. :) It's even in my builds.


By the way this new method seems to be flawed,for example on a610 (yes,610) it is not working as expected (display shuts off even though you are reading a text and you set the energy option to altmode).this already reported somewhere else here though.

With my A610 it works perfectly. I've set autooff to 1min and opened a text reader. After ~5 minutes the camera still does not switch the screen off. What do I do incorrect?  ::)
CHDK Developer.

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: How does CHDK start running
« Reply #18 on: 07 / June / 2008, 03:24:02 »
did you set chdk option to "script" or to "alt"?

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: How does CHDK start running
« Reply #19 on: 07 / June / 2008, 04:49:45 »
did you set chdk option to "script" or to "alt"?

"Alt"
CHDK Developer.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal