Development stupid questions

Started by scrax, June 27, 2012, 12:30:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

scrax

I'm total noob in developing for arm, or better developing in general, so I have a lot of confusion and stupid question to do. I hope that this will be the right place.
I'll use this topic to post what I don't understand looking the sources.

First question is what language is written on? I suppose C but I'm not sure.

another (little) more technical question is, in debug.c :

    CopyMLDirectoryToRAM_BeforeFormat(CARD_DRIVE "ML/", 0);
    CopyMLDirectoryToRAM_BeforeFormat(CARD_DRIVE "ML/DATA/", 0);
    CopyMLDirectoryToRAM_BeforeFormat(CARD_DRIVE "ML/SETTINGS/", 0);
    CopyMLDirectoryToRAM_BeforeFormat(CARD_DRIVE "ML/CROPMKS/", 1);
    CopyMLDirectoryToRAM_BeforeFormat(CARD_DRIVE "ML/SCRIPTS/", 0);
    CopyMLDirectoryToRAM_BeforeFormat(CARD_DRIVE "ML/PLUGINS/", 0);
    CopyMLDirectoryToRAM_BeforeFormat(CARD_DRIVE "ML/DOC/", 0);
    CopyMLDirectoryToRAM_BeforeFormat(CARD_DRIVE "ML/LOGS/", 0);
    CopyMLDirectoryToRAM_BeforeFormat(CARD_DRIVE, 0);

what is the 0 for? and why cropmks have 1? I've put 0 for all the new folders but don't know is it correct. Maybe also data needs 1 or settings?
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

a1ex

That 0 is cropmarks_flag: it tells ML to copy only bitmaps from that folder, not other files.

Language is C.

scrax

Quote from: a1ex on June 27, 2012, 12:42:48 AM
That 0 is cropmarks_flag: it tells ML to copy only bitmaps from that folder, not other files.

thank's, now I see that with a little more search maybe it was easy to understand:
void CopyMLDirectoryToRAM_BeforeFormat(char* dir, int cropmarks_flag)
.....
        if (cropmarks_flag && !is_valid_cropmark_filename(file.name)) continue;
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

Harsher

I will up this topic for my own stupid questions;)
I became a bit proficient in Java, but am still not versed enough in C yet.
Is it possible to develop something for ML or the firmware in Java or not?

nanomad

EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

Harsher

Thanks. Guess I'll have to learn some more so.

nanomad

Actually, you can probably code tools to make ML usage easier
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

scrax

I'm reading on the wiki a all what i can found about developing and extending ML, and so I'm back with some new stupid question for going on on what I'm trying to do.

First, I have not yet understood how to use hg well, I don't know how to be sure that I have exactly the exact copy without my modification, so usually I end up with making another clone in another folder, that way I have 5 folder with ML on 2 HD one with the fork I made that i can't sync it anymore, two with the test for 600D audio, one with tragiclantern, and one that was almost untouched from nightly (but today it became the one with my last test, so probably tomorow or in future i'll have another clone for last clean code....)  :-\
My idea is to make a new fork for my test only, add to that what i'll keep from the old fork and then delete it. then make a clone of MLsource and use that just to check it agains my builds (so on that will use hg pull - hg update only, right?).

Another problem I found is if I want to use something like this for example:
ifdef CONFIG_SCRAX
to be able to compile my fork with or without my code, or that:
ifdef CONFIG_NOVIDEO
to remove code used only for video (so to have more memory) or things I don't use.
but I've no clue how to put CONFIG_SCRAX for it to be true, in makefile I suppose but where exactly (under FLAGS probably, but also in the page), and how? I think that some clean-up did by A1ex had this, but when i tried it didn't worked.

about the menu item creations on the wiki I suppose that it's about old backend, since with submenu items I found some differences on the actual code.
I found that page very helpful and I'll go on in trying to understand it, just to give me a little hint, where can i find a sort of list of, for example, how all the icons used are called (also in the code, maybe)?
so far to find out those thing i do a search in the src folder   for ".icon_type" and then I manually check each result to understand which is which. If nothing found i usually extend the search to all repo.

I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

ubbut

Quote
but I've no clue how to put CONFIG_SCRAX for it to be true, in makefile I suppose but where exactly (under FLAGS probably, but also in the page), and how?

In the makefile add:  CFLAGS += -D YOURDEFINE=YOURVALUE

scrax

Quote from: ubbut on November 21, 2012, 11:28:26 PM
In the makefile add:  CFLAGS += -D YOURDEFINE=YOURVALUE

Thank's
that means that i can have also just SCRAX without _ in it. for YOURDEFINE and 1 for making it true?
Like this:
CFLAGS += -D SCRAX=1
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

scrax

Quote from: coutts on November 27, 2012, 02:49:08 AM
0x4D810 --> value=0x11100 when screen isn't being touched, value=0x11101 when 1 finger is held touching the screen
            --> value=0x11102 with 2 fingers touching the screen
            --> value=0x11103 with 3 fingers
            --> value=0x1104 with 4 fingers! Note: only the LSB seems to be used here, other bits seem to change sometimes. but the rightmost bit always changes to match how many fingers are touching the screen.

That part of ML is the most obscure to me, with my little knowledge.
1) 0x4D810 is a memory address in the camera ram where are saved some value used and changed by the firmware, right?
2) In ML for each camera supported we have a consts.h file where a name is given to each one of those understood/discovered ram address (touch_num_fingers_ptr in that case).
3) value=0x11100 each number saved here can have some meaning like how many fingers with the last one
4) It's possible to give a name to the value too saved in consts.h , like:
#define FINGER_TOUCH_NONE 0x11100
#define FINGER_TOUCH_ONE 0x11101
#define FINGER_TOUCH_TWO 0x11102...
memspy in ML is used to find those numbers when pressing buttons, changing options and so on on the camera...
5) stubs.S instead is a file with a list of discovered/understood functions of the firmware, that can be used by ML to perform his tasks
Am I correct?
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

scrax

how to compile with debug on? so to so mem spy and props?
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

jplxpto

Quote from: scrax on November 30, 2012, 02:27:59 AM
how to compile with debug on? so to so mem spy and props?

You can create Makefile.user from Makefile.user.default and define this:

CONFIG_DEBUGMSG     = 1

scrax

Quote from: jplxpto on November 30, 2012, 02:56:43 AM
You can create Makefile.user from Makefile.user.default and define this:

CONFIG_DEBUGMSG     = 1

Thanks, I was using -DCONFIG_DEBUGMSG (maybe was just too late or too tired) and so it didn't worked
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

jplxpto

Quote from: scrax on November 30, 2012, 07:18:35 AM
Thanks, I was using -DCONFIG_DEBUGMSG (maybe was just too late or too tired) and so it didn't worked


you have to do:

make clean
make

scrax

Quote from: jplxpto on November 30, 2012, 12:02:38 PM

you have to do:

make clean
make
thanks, i did that with CONFIG_DEBUGMSG     = 1
make clean; make 600D
it's a bit more quick  :D
now that work time is over I have the time to use it
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

Greg

Quote from: jplxpto on November 30, 2012, 02:56:43 AM
You can create Makefile.user from Makefile.user.default and define this:

CONFIG_DEBUGMSG     = 1

I did this for the 500D. I received an error.  :o

http://www.youtube.com/watch?v=OZy7N5Yw-3M&feature=youtu.be

scrax

I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

Greg

ASSERT00ML ASSERT:
PROP_LEN(80050007) = 0
at ../../src/property.c:227 (prop_request_change), task shoot_task
lv:0 mode:0


Magic Lantern version : v2.3.NEXT.2012Nov30.500D111
Mercurial changeset   : 394373540680 (unified) tip
Built on 2012-11-30 18:44:49 by greg@ubuntu.
Free Memory  : 351K + 2869K

CRASH00ASSERT: IS_ERROR( Err ) == FALSE
at Multicast\PropertyMgr.c:49, task PropMgr
lv:0 mode:0


Magic Lantern version : v2.3.NEXT.2012Nov30.500D111
Mercurial changeset   : 394373540680 (unified) tip
Built on 2012-11-30 18:44:49 by greg@ubuntu.
Free Memory  : 351K + 2854K

jplxpto

Quote from: scrax on November 30, 2012, 07:17:41 PM
thanks, i did that with CONFIG_DEBUGMSG     = 1
make clean; make 600D
it's a bit more quick  :D
now that work time is over I have the time to use it

Yes, I know, but I did not know you had a 600D. :)

scrax

Quote from: Greg on November 30, 2012, 08:35:29 PM
ASSERT00ML ASSERT:
PROP_LEN(80050007) = 0
at ../../src/property.c:227 (prop_request_change), task shoot_task
lv:0 mode:0


Magic Lantern version : v2.3.NEXT.2012Nov30.500D111
Mercurial changeset   : 394373540680 (unified) tip
Built on 2012-11-30 18:44:49 by greg@ubuntu.
Free Memory  : 351K + 2869K

CRASH00ASSERT: IS_ERROR( Err ) == FALSE
at Multicast\PropertyMgr.c:49, task PropMgr
lv:0 mode:0


Magic Lantern version : v2.3.NEXT.2012Nov30.500D111
Mercurial changeset   : 394373540680 (unified) tip
Built on 2012-11-30 18:44:49 by greg@ubuntu.
Free Memory  : 351K + 2854K

I have no clue, but have you tryied to comment that definition? trials and errors is the way i learn  :D
from source looks related to ptp, have you it enabled?
#define PROP_LV_AFFRAME         0x80050007 // called by ptp handler 915a
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

scrax

Also i'm here with another easy/stupid question:
- Is possible to reload ML without restarting the camera from ML?
Maybe facking standby mode for a little?

by the way i can't find anymore the code for loading different autoexec posted here months ago, someone has it?
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-

Pelican

I've tried to print the auto iso range with this line:
bmp_printf(fnt, 455, 92, "%d-%d", raw2iso(auto_iso_range >> 8 ) , raw2iso(auto_iso_range % 0xff));
and I've got strange value for the max.
After I check the raw values I found this
if auto_iso_range is 0x4860
then  auto_iso_range >>8 is 0x48 (good) but auto_iso_range % 0xff is 0xa8 ! (wrong) which is exactly 0x48 + 0x60
I'm not really a hardcore C programmer so I couldn't figure out what circumstances causes this result.
It happens with other values too (between 0x4858 and 0x4878)

Any idea?
EOS 7D Mark II, EOS 7D, EOS 5, EOS 100 + lenses (10mm to 300mm), 600EX, 550EX, YN600EX x 3
EOScard, EOS DSLR firmwares, ARMu, NiControl, etc.: http://pel.hu/down

Floont

Quote from: Pelican on December 29, 2012, 09:43:49 PM
I've tried to print the auto iso range with this line:
bmp_printf(fnt, 455, 92, "%d-%d", raw2iso(auto_iso_range >> 8 ) , raw2iso(auto_iso_range % 0xff));
and I've got strange value for the max.
After I check the raw values I found this
if auto_iso_range is 0x4860
then  auto_iso_range >>8 is 0x48 (good) but auto_iso_range % 0xff is 0xa8 ! (wrong) which is exactly 0x48 + 0x60
I'm not really a hardcore C programmer so I couldn't figure out what circumstances causes this result.
It happens with other values too (between 0x4858 and 0x4878)

Any idea?
The % sign in C is the modulus operator.  Your code is calculating 0x4860 (18528 decimal) mod 0xff (255 decimal), which is 0xa8 (168 decimal).  What you actually want is the low byte of auto_iso_range, which can be retrieved either by changing 0xff to 0x100 in your existing code or simply using the & operator instead of the "%" operator (my preference), i.e. raw2iso(auto_iso_range & 0xff).

scrax

on 600D:

bg = bmp_getpixel(590, 28);
uint32_t fnt = FONT(FONT_MED, COLOR_FG_NONLV, bg);

if (lens_info.raw_iso == 0) // ISO: AUTO
{
            int maxiso=(auto_iso_range %  0xFF) - (auto_iso_range >> 8);
            bmp_printf(fnt, 590, 28, "MAX:%d",raw2iso(maxiso) );
}
   

this:
I'm using ML2.3 for photography with:
EOS 600DML | EOS 400Dplus | EOS 5D MLbeta5- EF 100mm f/2.8 USM Macro  - EF-S 17-85mm f4-5.6 IS USM - EF 70-200mm f/4 L USM - 580EXII - OsX, PS, LR, RawTherapee, LightZone -no video experience-