DIGIC version define (was Re: Adding new cameras...) - General Discussion and Assistance - CHDK Forum supplierdeeply

DIGIC version define (was Re: Adding new cameras...)

  • 10 Replies
  • 6656 Views
*

Offline srsa_4c

  • ******
  • 4451
DIGIC version define (was Re: Adding new cameras...)
« on: 13 / March / 2020, 17:30:44 »
Advertisements
Detection of DIGIC version (for finsig_vxworks, finsig_dryos). It currently only adds a commented define makefile variable to stubs_entry.S. It should probably go in camera_info somewhere, but I'm not sure. A possible use could be this.

edit:
Perhaps adding a DIGIC define to platform_camera.h would make more sense.
edit2:
Alternative v2 version with output suitable for platform_camera.h. I have a script that can transfer the #define from stubs_entry.S to platform_camera.h, so no manual file editing would be necessary.
« Last Edit: 14 / March / 2020, 20:33:15 by reyalp »

*

Offline reyalp

  • ******
  • 14079
Detection of DIGIC version (for finsig_vxworks, finsig_dryos). It currently only adds a commented define makefile variable to stubs_entry.S. It should probably go in camera_info somewhere, but I'm not sure. A possible use could be this.

edit:
Perhaps adding a DIGIC define to platform_camera.h would make more sense.
edit2:
Alternative v2 version with output suitable for platform_camera.h. I have a script that can transfer the #define from stubs_entry.S to platform_camera.h, so no manual file editing would be necessary.
Thanks for doing this.

I'm open to be convinced otherwise, but my initial reaction is that it would make sense to have it as a makefile.inc value.

edit:
Split since there are two options.
« Last Edit: 14 / March / 2020, 20:34:07 by reyalp »
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
I'm open to be convinced otherwise, but my initial reaction is that it would make sense to have it as a makefile.inc value.
v1 would allow using 'DIGIC' in makefiles (to eventually sanitize the current situation with THUMB_FW and DIGIC7, I guess), and also in source with a makefile modification. v2 would be limited to c/asm source.
If you're ok with v1, you can check it in after a stubs rebuild (or tell me to do it). I'll then copy the line from stubs_entry.S to makefile.inc for each affected port, and also make a manual makefile.inc change for D6 and D7 ports.

*

Offline reyalp

  • ******
  • 14079
v1 would allow using 'DIGIC' in makefiles (to eventually sanitize the current situation with THUMB_FW and DIGIC7, I guess), and also in source with a makefile modification.
Yeah, that was my thinking. MEMBASEADDR could be set by default too.
Quote
If you're ok with v1, you can check it in after a stubs rebuild (or tell me to do it).
Checked in.
Quote
I'll then copy the line from stubs_entry.S to makefile.inc for each affected port, and also make a manual makefile.inc change for D6 and D7 ports.
Thanks again.
For consistency, I added a digic line the finsig_thumb2 output as well.
Don't forget what the H stands for.


*

Offline srsa_4c

  • ******
  • 4451
For consistency, I added a digic line the finsig_thumb2 output as well.
Thanks, that reduced the number of hand-edited files to two. I could have committed this, but chose to put the patch here.
You seem to be missing the ixus1000_sd4500 102c dump (the related change is in this patch).
The other note is that the <D6 sigfinders output the makefile.inc values with C-style comments. I checked and found a few cases where such comments made it into makefile.inc (PowerShot N, N FB). I don't know whether that's a problem or not. Probably not.
The script I used (below) "fixed" the comment to use #.
Code: [Select]
#!/bin/bash
curdir=`pwd` # current working directory
directory="platform"

find $directory -mindepth 3 -type d -print0 | while read -d $'\0' file
do
    cd "$file"
    if [ -e stubs_entry.S ] ; then
        s1=`grep -E "DIGIC =" stubs_entry.S`
        s2=`grep -E "^DIGIC =" ../../makefile.inc`
        if [ -n "$s1" ] ; then
            echo "$file"
            if [ -z "$s2" ] ; then
                echo "$file"
                echo -e "$s1\n" | sed -e 's/^\/\/ */\n/' -e 's/\/\/ /# /'  >> ../../makefile.inc
            else
                echo "$file already done"
            fi
        else
            echo "$file nope"
        fi
    fi
    cd "$curdir"
done

exit 0

*

Offline reyalp

  • ******
  • 14079
The other note is that the <D6 sigfinders output the makefile.inc values with C-style comments. I checked and found a few cases where such comments made it into makefile.inc (PowerShot N, N FB). I don't know whether that's a problem or not. Probably not.
It can definitely cause problems, C style comments will become part of the value. We should also use # everywhere.

Technically, there should be no space between the value and the #, otherwise the space becomes part of the value, which works ok for command line parameters but not ifeq.

Thanks for catching the missing dump.

I modified the script to strip the spaces and checked in. sx270 and sx275 added manually
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14079
Re: DIGIC version define (was Re: Adding new cameras...)
« Reply #6 on: 22 / March / 2020, 23:44:18 »
Here's a quick patch to make the digic version available as a define, as well as camera_info and lua get_buildinfo. Posted as a patch since I wasn't sure if you're working on something similar.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
Re: DIGIC version define (was Re: Adding new cameras...)
« Reply #7 on: 23 / March / 2020, 14:10:52 »
I wasn't sure if you're working on something similar.
I'm not working on anything related to to this, feel free to add.


*

Offline reyalp

  • ******
  • 14079
Re: DIGIC version define (was Re: Adding new cameras...)
« Reply #8 on: 24 / March / 2020, 01:15:35 »
I'm not working on anything related to to this, feel free to add.
Added in r5451
Don't forget what the H stands for.

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: DIGIC version define (was Re: Adding new cameras...)
« Reply #9 on: 25 / March / 2020, 12:49:45 »
 :-* Hi, that´s a nice feature, could be pasted to the lib/uBasic files...
Code: [Select]
// tokenizer.c
  {"get_digic",               TOKENIZER_GET_DIGIC},

// tokenizer.h
  TOKENIZER_GET_DIGIC,

// ubasic.c / factor
  case TOKENIZER_GET_DIGIC:
    accept(TOKENIZER_GET_DIGIC);
    r = camera_info.cam_digic;
    break;
All lifetime is a loan from eternity.

 

Related Topics