Magic Lantern Forum

Developing Magic Lantern => General Development => Topic started by: garry23 on May 09, 2015, 03:48:31 PM

Title: ML code development
Post by: garry23 on May 09, 2015, 03:48:31 PM
Like many I love the compile in the cloud tool, as it allows me to test tweaks on ML code, for instance I added diffraction to the DoF feedback. But here's my problem.

My coding skill is at a novice level, for example Alex improved on my coding :-)

I keep reading the ML code, but as many I'm sure have found, it is not easy to reverse engineer code, especially when the functions are spread out over the various .c and .h files. It takes a lot of time.

I have tried asking questions on the forum, but I'm afraid not got anywhere with this approach, ie people are busy and I get that.

This area of the forum is meant to be where we ask for help. So my question is simple, do new coders like me continue to ask questions here, or should we create a new area of the forum where new code developers like me can ask coding questions and seek help from a group of mentors who are prepared to give their time.

Cheers

Garry
Title: Re: ML code development
Post by: Audionut on May 10, 2015, 01:55:20 AM
Anything related to development should go here imo.
Title: Re: ML code development
Post by: garry23 on May 10, 2015, 02:48:00 AM
@Audionut

I'm happy with that, I was just trying to be sensitive to developers and other coders being 'diverted' on education.

There is nothing more frustrating than asking a question and not getting an answer, because others are too busy.

Cheers

Garry
Title: Re: ML code development
Post by: Audionut on May 10, 2015, 05:39:11 AM
Agreed.

Maybe try making your questions more stimulating.

http://www.catb.org/esr/faqs/smart-questions.html#intro
That's more helpful for newbies, but there may be some info you find useful.
Title: Math Functions
Post by: garry23 on May 10, 2015, 04:07:41 PM
Before I waste a lot of time generating errors, could some guru or coder confirm the limits of the ML C code.

So far I know I can use sqrtf.

But I now need to access some other functions, eg arctan.

So my question is should I use atan or atan2

Also is there an ML page or a bitbucket page where I can browse info on what the core ML is capable of, eg a list of math functions; so I don't have to keep asking dumb questions.

Thanks for your help.
Title: Lens Info Access in zebra.c
Post by: garry23 on May 10, 2015, 07:55:41 PM
I'm looking to change a few things in zebra.c and need access to the focal length, eg:

Code: [Select]
const uint64_t  fl = info->focal_len;
Clearly 'just' calling the above generates an undeclared error.

Could some kind person put me out of my misery, ie what addition coding do I need to access lens info in zebra.c.

Cheers

Garry
Title: Re: ML code development
Post by: dmilligan on May 12, 2015, 03:58:32 AM
lens_info.focal_len
Title: Re: ML code development
Post by: garry23 on May 12, 2015, 06:24:31 AM
@dmilligan

First, thanks for coming back to me.

I'm pleased to say I independently worked it out as well :-) I'm gradually reverse engineering the ML code.

May I ask one more question to allow me to complete my project.

I'm in zebra.c and using this piece of code.

Code: [Select]
#ifdef CONFIG_FULLFRAME
    unsigned       sen = 43270; // sensor diagonal in mm*1000 for full frame
    #else
    unsigned       sen = 27043; // sensor diagonal in mm*1000 for crop frame
    #endif

But it seems sen must return rubbish.

Can you see anything wrong with my fullframe test?

Cheers

Garry