key press question - page 2 - General Help and Assistance on using CHDK stable releases - CHDK Forum

key press question

  • 17 Replies
  • 2388 Views
*

Offline Caefix

  • *****
  • 946
  • Sorry, busy deleting test shots...
Re: key press question
« Reply #10 on: 11 / June / 2022, 12:40:16 »
Advertisements
Same lines repeated in romlog until out of memory?  :-X
Quote
ASSERT!! CtrlSrv.c Line 731
Task name: PhySw
...
00017740: UI:Button:0x00001135:
00017740: UI:LogicalEvent:0x00001134:adr:0x1,Para:1
00017740: UI:Button:0x00001134:
00017740: UI:LogicalEvent:0x000008af:adr:0x1,Para:1
00017740: UI:Button:0x000008AF:RotateEDialRight
00017740: UI:LogicalEvent:0x00001135:adr:0x1,Para:1
00017740: UI:Button:0x00001135:
...
Code: [Select]

    local start = max-hlw -- hlw= 1..10

    if total > 0 then -- overexposed
        i = 0
        repeat
            wheel_right() -- move 1 stop, but note camera must be set to 1/3 stops
            wheel_right()
            wheel_right()
            histo,total=get_live_histo()
            total = 0
            for i = start,(max-1),1 do total = total + histo[i] end
        until total <= 0
;) Correction is -3 EV..+3EV, so might still be some counts in the high bins, so total always > 0.
All lifetime is a loan from eternity.

Re: key press question
« Reply #11 on: 11 / June / 2022, 12:48:09 »
Same lines repeated in romlog until out of memory?  :-X
Quote
ASSERT!! CtrlSrv.c Line 731
Task name: PhySw
...
00017740: UI:Button:0x00001135:
00017740: UI:LogicalEvent:0x00001134:adr:0x1,Para:1
00017740: UI:Button:0x00001134:
00017740: UI:LogicalEvent:0x000008af:adr:0x1,Para:1
00017740: UI:Button:0x000008AF:RotateEDialRight
00017740: UI:LogicalEvent:0x00001135:adr:0x1,Para:1
00017740: UI:Button:0x00001135:
...
Code: [Select]

    local start = max-hlw -- hlw= 1..10

    if total > 0 then -- overexposed
        i = 0
        repeat
            wheel_right() -- move 1 stop, but note camera must be set to 1/3 stops
            wheel_right()
            wheel_right()
            histo,total=get_live_histo()
            total = 0
            for i = start,(max-1),1 do total = total + histo[i] end
        until total <= 0
;) Correction is -3 EV..+3EV, so might still be some counts in the high bins, so total always > 0.

@Caefix

As @srsa_4c  pointed out to me, I needed to add in a few sleep calls.

I also refactored the ETTR function, including adding in a menu/user variable (limit) to carry out the test, ie not necessarily zero.

Here’s the latest version. I’ve tested it on my M3 and M10 and it works OK, ie doesn’t produce a ‘perfect’ ETTR exposure,  but it’s close enough and relatively fast.

Code: [Select]

function set_ETTR()
    do
        local histo={}
        local total = 0
        histo,total=get_live_histo()
        total = 0
        local max = #histo
        local start = max-hlw
        for i = start,(max-1),1 do total = total + histo[i] end -- get the total count in the requested quartiles
        local sl = 50
        if total <= 0 then -- underexposed
            repeat
                wheel_left()
                sleep(sl)
                histo,total=get_live_histo()
                total = 0
                for i = start,(max-1),1 do total = total + histo[i] end
            until total > limit
        end
        if total > limit then
            repeat
                wheel_right()
                sleep(sl)
                histo,total=get_live_histo()
                total = 0
                for i = start,(max-1),1 do total = total + histo[i] end
            until total <= limit
        end
        press("shoot_half")
        repeat sleep(10) until get_shooting()
        s = get_tv96()
        set_user_tv96(s)
        release("shoot_half")
        repeat sleep(10) until (not get_shooting())
        return
    end
end

*

Offline Caefix

  • *****
  • 946
  • Sorry, busy deleting test shots...
Re: key press question
« Reply #12 on: 11 / June / 2022, 13:08:35 »
Same lines repeated in romlog until out of memory?  :-X
Something like ...
Code: [Select]
        until total <= 0 or counter == 9 would prevent worst case setting -> endless loop.  :)
All lifetime is a loan from eternity.

Re: key press question
« Reply #13 on: 11 / June / 2022, 13:13:24 »
Same lines repeated in romlog until out of memory?  :-X
Something like ...
Code: [Select]
        until total <= 0 or counter == 9 would prevent worst case setting -> endless loop.  :)

I think a better way, which I did have before, is to check the adjusted exposure hasn’t ‘bottomed out’, eg at the fastest shutter speed or, say, 30 seconds.


Re: key press question
« Reply #14 on: 11 / June / 2022, 13:39:45 »
@Caefix

Like this  ;)

Code: [Select]
function set_ETTR()
    do
        local histo={}
        local total = 0
        histo,total=get_live_histo()
        total = 0
        local max = #histo
        local start = max-hlw
        for i = start,(max-1),1 do total = total + histo[i] end -- get the total count in the requested quartiles
        local sl = 50
        if total <= 0 then -- underexposed
            repeat
                wheel_left()
                sleep(sl)
                histo,total=get_live_histo()
                total = 0
                for i = start,(max-1),1 do total = total + histo[i] end
            until total > limit or get_prop(props.USER_TV) <= -480
        end
        if total > limit then
            repeat
                wheel_right()
                sleep(sl)
                histo,total=get_live_histo()
                total = 0
                for i = start,(max-1),1 do total = total + histo[i] end
            until total <= limit or get_prop(props.USER_TV) >= 1056
        end
        press("shoot_half")
        repeat sleep(10) until get_shooting()
        s = get_tv96()
        set_user_tv96(s)
        release("shoot_half")
        repeat sleep(10) until (not get_shooting())
        return
    end
end

*

Offline Caefix

  • *****
  • 946
  • Sorry, busy deleting test shots...
Re: key press question
« Reply #15 on: 11 / June / 2022, 14:01:56 »
I will download it.  :xmas
All lifetime is a loan from eternity.

Re: key press question
« Reply #16 on: 11 / June / 2022, 14:34:02 »
I will download it.  :xmas

I would welcome you testing it out, but, remember, I wrote for my use  ;)

*

Offline Caefix

  • *****
  • 946
  • Sorry, busy deleting test shots...
Re: key press question
« Reply #17 on: 11 / June / 2022, 14:40:01 »
I will download it.  :xmas

... but, remember, I wrote for my use  ;)
British Island´s weather ...  :(
All lifetime is a loan from eternity.


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal