SD1100/ixus 80 porting .... - page 36 - DryOS Development - CHDK Forum supplierdeeply

SD1100/ixus 80 porting ....

  • 360 Replies
  • 124633 Views
*

Offline ehmu

  • *
  • 14
  • Ixus 90-1.00d
Re: SD1100/ixus 80 porting ....
« Reply #350 on: 10 / January / 2010, 15:14:38 »
Advertisements
any success with the LED control for the sd1100is ?
The specification of UBASIC set_led seems to be a little bit weird.
http://chdk.wikia.com/wiki/UBASIC/TutorialScratchpad
set_led a b c
a:4..10 = green, yellow, unused, orange, blue, AF beam, timer

Did you try something like this in platform\ixus80_sd1100\lib.c
Code: [Select]
void ubasic_set_led(int led, int state, int bright)
{
int leds[] = {0x134,0x138,0x134,0x130,0xd4,0x3030,0x3030};  //  green=4 | yellow | (not used) | orange | blue | af beam | timer
// if(led < 4 || led > 10 || led == 6)  //  map to valid params;  no extra TIMER LED (is same as AF)
volatile long *p=(void*)0xc0220000 + leds[(led-4)%sizeof(leds)];
if (state)
p[0]=0x46;
else
p[0]=0x44;
}

I don't own sd1100 - you have to try yourself ;-)
When it works, it should be added to the repository.

Re: SD1100/ixus 80 porting .... property value for macro mode?
« Reply #351 on: 17 / January / 2010, 02:02:02 »
Can I set SD1100 to Macro using property values?
If so what numbers should I use?

*

Offline reyalp

  • ******
  • 11902
Re: SD1100/ixus 80 porting ....
« Reply #352 on: 17 / January / 2010, 02:49:18 »
Can I set SD1100 to Macro using property values?
If so what numbers should I use?
According to http://chdk.wikia.com/wiki/Propertycase propcase 6 contains that value for digic III/IV, but is read only. You might want to try it anyway, I think I got the SD990 to use focus at infinity by setting this.
Don't forget what the H stands for.

Re: SD1100/ixus 80 porting ....
« Reply #353 on: 17 / January / 2010, 13:09:04 »
>> According to http://chdk.wikia.com/wiki/Propertycase propcase 6 contains that value for digic III/IV, but is read only. You might want to try it anyway, I think I got the SD990 to use focus at infinity by setting this.

I tried it - it worked!
set_prop 6 1
turns SD1100 to Macro mode


*

Offline reyalp

  • ******
  • 11902
Re: SD1100/ixus 80 porting ....
« Reply #354 on: 17 / January / 2010, 15:08:49 »
Have you checked to make sure it's actually in macro mode, not just displaying the icon in the UI ? If it is, then please add a note on the wiki. (I'm 99% sure I tested this and it worked fine on the SD990, but I don't have the camera any more, so I'm hesitant to do this without confirmation)
Don't forget what the H stands for.

Re: SD1100/ixus 80 porting ....
« Reply #355 on: 05 / April / 2010, 11:34:02 »
im still trying to gain control of "any" of the LED's on the SD1100is  from ubasic
no success so far.

how do i call the CHDK functions "LED_GREEN_ON /  OFF"  in leds.h leds.c
from ubasic ??

/Kyndal
SD1100IS 101a,  homebuilt 0.9.9-866

Re: SD1100/ixus 80 porting ....
« Reply #356 on: 05 / April / 2010, 12:10:04 »
I have not followed this thread and do not have time to read it now, but if there is an led at 0xC0220134 the  following should turn it on/off :-

ubasic_set_led(4,0,100)
ubasic_set_led(4,1,100)



David
« Last Edit: 05 / April / 2010, 12:48:05 by Microfunguy »

Re: SD1100/ixus 80 porting ....
« Reply #357 on: 22 / April / 2010, 10:13:11 »
have been playing around with it for a while now.

and have not been able to get any of the ubasic or LUA Commands to work for
control of any of the LED's with the any of the stock firmwares

I have been doing alot of changes around in the code. 
and at last i have success
turns out that all that is needed is some changes to the code in
(trunk885) /platform/ixus80_sd1100/lib.c

i Forget where i found the code bit. and don't remember if i modified any of the LED addresses myself.
but i replaced the whole  "ubasic_set_led" function (which is all commented out) 
with this

Code: [Select]
void ubasic_set_led(int led, int state, int bright)

{
int leds[] = {0x134,0x138,0x134,0x130,0xd4,0x3030,0x3030};  //  green=4 | yellow | (not used) | orange | blue | af beam | timer
// if(led < 4 || led > 10 || led == 6)  //  map to valid params;  no extra TIMER LED (is same as AF)
volatile long *p=(void*)0xc0220000 + leds[(led-4)%sizeof(leds)];
if (state)
p[0]=0x46;
else
p[0]=0x44;
}

and i got the ubasic "set_led'"  command to work.  the following blinks the blue led

Code: [Select]
@title Test LED Script

sleep 500
print "blue on"
set_led 8 1 60
sleep 500
print "blue off"
set_led 8 0
end

finally i can use the motion detection scripts to trigger
"external hardware"

/Kyndal

SD1100IS 101a,  homebuilt 0.9.9-866


Re: SD1100/ixus 80 porting ....
« Reply #358 on: 06 / May / 2012, 09:41:57 »
The above described modification worked for me with a little nudging. Plus, extrapolating from other cameras, I got the power LED to be addressable as well (which was what I really wanted). It appears that function names have changed a little since this was originally posted. In platform/ixus80_sd1100/lib.c I changed the camera_set_led function to look like this:

Code: [Select]
void camera_set_led(int led, int state, int bright)
{
        int leds[] = {0xd0,0x134,0x138,0x134,0x130,0xd4,0x3030,0x3030};  // power=3 | green | yellow | (not used) | orange | blue | af beam | timer
        if(led >= 3 && led <= 10 && led != 6)  //  map to valid params;  no extra TIMER LED (is same as AF)
        {
                volatile long *p=(void*)0xc0220000 + leds[(led-3)%sizeof(leds)];
                if (state)
                        p[0]=0x46;
                else
                        p[0]=0x44;
        }
}


Is there a reason this functionality, which was posted here ~2 years ago, has not made it into seemingly any branch? Or is it just an oversight?  I ask because I see some older references to LED control being limited to "Fingalo's builds" but I also see that many of the features described in those older references are now in the release-1_0 branch.

Anyway, if nothing else, this'll stay posted here and folks can find it in the future.  Hope it helps!

« Last Edit: 06 / May / 2012, 09:43:46 by jourh »

*

Offline reyalp

  • ******
  • 11902
Re: SD1100/ixus 80 porting ....
« Reply #359 on: 06 / May / 2012, 16:31:53 »
Generally stuff that isn't posted in http://chdk.setepontos.com/index.php?topic=650.705 or specifically requested to be added doesn't get added. I'll look into putting this in.

"Fingalo's builds" is a long dead branch which AFAIK was absorbed into the trunk, although that was before my time.
Don't forget what the H stands for.

 

Related Topics