Changeset 1068 for trunk


Ignore:
Timestamp:
02/26/11 23:29:27 (2 years ago)
Author:
reyalP
Message:

sx30 and g12 updates from philmoz in http://chdk.setepontos.com/index.php?topic=650.msg62260#msg62260

  • updates for exmem memory allocation to allow these cameras to exclude video buffer memory
  • fixed set_zoom function to correctly wait until zoom is finished before returning
  • fixed startup code for SX30 so that init_file_modules_task gets called correctly in all cases

SX30 startup button change NOT added at this time.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/gui_draw.h

    r1060 r1068  
    203203#define COLOR_BLUE          0x14 
    204204#define COLOR_YELLOW        0x16 
    205 #define COLOR_BLACK         0x1d 
     205#define COLOR_BLACK         0xFF 
    206206#define COLOR_BG            0x62 
    207207#define COLOR_FG            COLOR_WHITE 
  • trunk/include/camera.h

    r1064 r1068  
    32233223        #define CAM_DATE_FOLDER_NAMING  1 
    32243224 
     3225        // EXMEM memory allocation values 
     3226        #define EXMEM_HEAP_SKIP (0x08000000-0x07D08A00)                 // G12 & SX30 uses movie memory buffers at the top of the memory allocated by exmem_alloc 
     3227        #define EXMEM_BUFFER_SIZE (1024*1024*2)                                 // desired amount of exmem memory to allocate 
     3228 
    32253229//---------------------------------------------------------- 
    32263230#elif defined (CAMERA_g12) 
     
    33253329 
    33263330        #define CAM_CHDK_PTP 1 
     3331 
     3332        // EXMEM memory allocation values 
     3333        #define EXMEM_HEAP_SKIP (0x08000000-0x07D08A00)                 // G12 & SX30 uses movie memory buffers at the top of the memory allocated by exmem_alloc 
     3334        #define EXMEM_BUFFER_SIZE (1024*1024*2)                                 // desired amount of exmem memory to allocate 
    33273335 
    33283336//---------------------------------------------------------- 
  • trunk/platform/generic/wrappers.c

    r1060 r1068  
    133133#if defined(CAMERA_sx30) 
    134134// SX30 - Can't find zoom_status, _MoveZoomLensWithPoint crashes camera 
     135// _PT_MoveOpticalZoomAt works, and updates PROPCASE_OPTICAL_ZOOM_POSITION; but doesn't wait for zoom to finish 
    135136        extern void _PT_MoveOpticalZoomAt(long*); 
    136137        if (lens_get_zoom_point() != newpt) 
     138        { 
    137139                _PT_MoveOpticalZoomAt(&newpt); 
     140                while (zoom_busy) msleep(10); 
     141        } 
    138142#elif defined(CAMERA_g12) 
    139 // G12 - Can't find zoom_status, _MoveZoomLensWithPoint works anyway, and updates PROPCASE_OPTICAL_ZOOM_POSITION; but doesn't wait for zoom to finish 
     143// G12 - Can't find zoom_status, _MoveZoomLensWithPoint works anyway; but doesn't wait for zoom to finish 
    140144        if (lens_get_zoom_point() != newpt) 
     145        { 
    141146            _MoveZoomLensWithPoint((short*)&newpt); 
    142 #else 
     147                while (zoom_busy) msleep(10); 
     148            _SetPropertyCase(PROPCASE_OPTICAL_ZOOM_POSITION, &newpt, sizeof(newpt)); 
     149        } 
     150#else   // !CAMERA_g12 
    143151    _MoveZoomLensWithPoint((short*)&newpt); 
    144152 
     
    151159                        break; 
    152160        } 
    153 #else 
     161#else   // !CAMERA_s95 
    154162        while (zoom_busy) ; 
    155 #endif 
     163#endif  // CAMERA_s95 
    156164 
    157165    if (newpt==0) zoom_status=ZOOM_OPTICAL_MIN; 
     
    159167    else zoom_status=ZOOM_OPTICAL_MEDIUM; 
    160168    _SetPropertyCase(PROPCASE_OPTICAL_ZOOM_POSITION, &newpt, sizeof(newpt)); 
    161 #endif 
     169#endif  // CAMERA_g12 
    162170} 
    163171 
     
    517525#ifdef OPT_EXMEM_MALLOC 
    518526// I set this up to 16 mb and it still booted... 
    519 #define EXMEM_HEAP_SIZE (1024*1024*2) 
     527#ifndef EXMEM_HEAP_SKIP 
     528#define EXMEM_HEAP_SKIP 0 
     529#endif 
     530#ifndef EXMEM_BUFFER_SIZE 
     531#define EXMEM_BUFFER_SIZE (1024*1024*2) // default size if not specified by camera 
     532#endif 
     533#define EXMEM_HEAP_SIZE (EXMEM_BUFFER_SIZE+EXMEM_HEAP_SKIP)     // desired space + amount to skip for the movie buffers (if needed) 
    520534// these aren't currently needed elsewhere 
    521535/* 
     
    541555        void *mem = _exmem_alloc(0,EXMEM_HEAP_SIZE,0); 
    542556        if(mem) { 
    543                 exmem_heap = suba_init(mem,EXMEM_HEAP_SIZE,1,1024); 
     557                exmem_heap = suba_init(mem,EXMEM_HEAP_SIZE-EXMEM_HEAP_SKIP,1,1024); 
    544558        } 
    545559} 
  • trunk/platform/sx30/sub/100e/boot.c

    r1038 r1068  
    3333//} 
    3434 
    35 int done_delay = 0; 
    36  
    3735void taskHook(context_t **context) 
    3836{  
    3937        task_t *tcb=(task_t*)((char*)context-offsetof(task_t, context)); 
    40  
    41         if ((tcb->entry == (void*)mykbd_task) && (done_delay == 0)) 
    42         { 
    43                 done_delay = 1; 
    44                 int i; 
    45                 // Wait a while, otherwise init_file_modules_task doesn't get hooked when starting in play mode 
    46                 for (i=0; i<0x100000; i++) 
    47                 { 
    48                         asm volatile ( "nop\n" ); 
    49                 } 
    50         } 
    5138 
    5239        extern void task_CaptSeq(); 
     
    186173        //http://chdk.setepontos.com/index.php/topic,4194.0.html 
    187174        *(int*)0x1938=(int)taskHook; 
     175        *(int*)0x193C=(int)taskHook;    // need this for startup in Playback mode (otherwise init_file_modules_task doesn't hook properly) 
    188176     
    189177        // replacement of sub_FF834740 for correct power-on. 
  • trunk/platform/sx30/sub/100h/boot.c

    r1038 r1068  
    3333//} 
    3434 
    35 int done_delay = 0; 
    36  
    3735void taskHook(context_t **context) 
    3836{  
    3937        task_t *tcb=(task_t*)((char*)context-offsetof(task_t, context)); 
    40  
    41         if ((tcb->entry == (void*)mykbd_task) && (done_delay == 0)) 
    42         { 
    43                 done_delay = 1; 
    44                 int i; 
    45                 // Wait a while, otherwise init_file_modules_task doesn't get hooked when starting in play mode 
    46                 for (i=0; i<0x100000; i++) 
    47                 { 
    48                         asm volatile ( "nop\n" ); 
    49                 } 
    50         } 
    5138 
    5239        extern void task_CaptSeq(); 
     
    187174        //http://chdk.setepontos.com/index.php/topic,4194.0.html 
    188175        *(int*)0x1938=(int)taskHook; 
     176        *(int*)0x193C=(int)taskHook;    // need this for startup in Playback mode (otherwise init_file_modules_task doesn't hook properly) 
    189177     
    190178        // replacement of sub_FF834740 for correct power-on. 
  • trunk/platform/sx30/sub/100l/boot.c

    r1038 r1068  
    3333//} 
    3434 
    35 int done_delay = 0; 
    36  
    3735void taskHook(context_t **context) 
    3836{  
    3937        task_t *tcb=(task_t*)((char*)context-offsetof(task_t, context)); 
    40  
    41         if ((tcb->entry == (void*)mykbd_task) && (done_delay == 0)) 
    42         { 
    43                 done_delay = 1; 
    44                 int i; 
    45                 // Wait a while, otherwise init_file_modules_task doesn't get hooked when starting in play mode 
    46                 for (i=0; i<0x100000; i++) 
    47                 { 
    48                         asm volatile ( "nop\n" ); 
    49                 } 
    50         } 
    5138 
    5239        extern void task_CaptSeq(); 
     
    186173        //http://chdk.setepontos.com/index.php/topic,4194.0.html 
    187174        *(int*)0x1938=(int)taskHook; 
     175        *(int*)0x193C=(int)taskHook;    // need this for startup in Playback mode (otherwise init_file_modules_task doesn't hook properly) 
    188176     
    189177        // replacement of sub_FF834740 for correct power-on. 
Note: See TracChangeset for help on using the changeset viewer.