CHDK_DE Vorschauversion  Trunk Rev. 6014
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
wrappers.c-Dateireferenz
#include "camera.h"
#include "lolevel.h"
#include "platform.h"
#include "raw_buffer.h"
#include "conf.h"
#include "math.h"
#include "levent.h"
#include "ptp_chdk.h"
#include "live_view.h"
#include "usb_remote.h"
#include "exmem.h"
#include "stdio.h"
+ Include-Abhängigkeitsdiagramm für wrappers.c:
+ Dieser Graph zeigt, welche Datei direkt oder indirekt diese Datei enthält:

gehe zum Quellcode dieser Datei

Datenstrukturen

struct  flashParam
 
struct  __stat
 

Makrodefinitionen

#define CANON_HEAP_SEM_TIMEOUT   1000
 

Funktionen

int isdigit (int c)
 
int isspace (int c)
 
int isalpha (int c)
 
int isupper (int c)
 
int islower (int c)
 
int ispunct (int c)
 
int isxdigit (int c)
 
int tolower (int c)
 
int toupper (int c)
 
int submenu_sort_arm (const void *v1, const void *v2)
 
void msleep (long msec)
 
long task_lock ()
 
long task_unlock ()
 
const char * task_name (int id)
 
int task_id_list_get (int *idlist, int size)
 
long get_property_case (long id, void *buf, long bufsize)
 
long set_property_case (long id, void *buf, long bufsize)
 
short get_parameter_size (long id)
 
long get_parameter_data (long id, void *buf, long bufsize)
 
long set_parameter_data (long id, void *buf, long bufsize)
 
short __attribute__ ((weak))
 
void mark_filesystem_bootable ()
 
long lens_get_zoom_pos ()
 
long lens_get_zoom_point ()
 
void lens_set_zoom_point (long newpt)
 
void lens_set_zoom_speed (long newspd)
 
void lens_set_focus_pos (long newpos)
 
void play_sound (unsigned sound)
 
long stat_get_vbatt ()
 
int get_battery_temp ()
 
int get_ccd_temp ()
 
int get_optical_temp ()
 
long get_tick_count ()
 
short shooting_get_nd_value_ev96 (void)
 
short shooting_get_nd_current_ev96 (void)
 
long shooting_get_current_tv96 ()
 
long shooting_get_current_av96 ()
 
long shooting_get_current_delta_sv96 ()
 
long shooting_get_current_base_sv96 ()
 
long IsStrobeChargeCompleted ()
 
void SetCurrentCaptureModeType ()
 
int takeFileIOSemaphore ()
 
int open (const char *name, int flags, int mode)
 
int close (int fd)
 
int write (int fd, const void *buffer, long nbytes)
 
int read (int fd, void *buffer, long nbytes)
 
int lseek (int fd, long offset, int whence)
 
long mkdir (const char *dirname)
 
long mkdir_if_not_exist (const char *dirname)
 
int remove (const char *name)
 
int fw_closedir (void *d)
 
void * fw_opendir (const char *name)
 
void * fw_readdir (void *d)
 
int stat (const char *name, struct stat *pStat)
 
FILEfopen (const char *filename, const char *mode)
 
long fclose (FILE *f)
 
long fread (void *buf, long elsize, long count, FILE *f)
 
long fwrite (const void *buf, long elsize, long count, FILE *f)
 
long fseek (FILE *file, long offset, long whence)
 
long feof (FILE *file)
 
long fflush (FILE *file)
 
char * fgets (char *buf, int n, FILE *f)
 
int rename (const char *oldname, const char *newname)
 
unsigned int GetFreeCardSpaceKb (void)
 
unsigned int GetTotalCardSpaceKb (void)
 
int errnoOfTaskGet (int tid)
 
long strlen (const char *s)
 
int strcmp (const char *s1, const char *s2)
 
int strncmp (const char *s1, const char *s2, long n)
 
char * strchr (const char *s, int c)
 
char * strcpy (char *dest, const char *src)
 
char * strncpy (char *dest, const char *src, long n)
 
char * strcat (char *dest, const char *app)
 
char * strrchr (const char *s, int c)
 
long strtol (const char *nptr, char **endptr, int base)
 
unsigned long strtoul (const char *nptr, char **endptr, int base)
 
char * strpbrk (const char *s, const char *accept)
 
long sprintf (char *s, const char *st,...)
 
const char * strerror (int en)
 
unsigned long time (unsigned long *timer)
 
int utime (const char *file, struct utimbuf *newTimes)
 
struct tmlocaltime (const time_t *_tod)
 
long strftime (char *s, unsigned long maxsize, const char *format, const struct tm *timp)
 
time_t mktime (struct tm *timp)
 
void set_clock (int year, int month, int day, int hour, int minute, int second)
 
double log (double x)
 
double log10 (double x)
 
double pow (double x, double y)
 
double sqrt (double x)
 
double log2 (double x)
 
void * exmem_alloc_uncached (unsigned int type, unsigned int size, exmem_alloc_info *allocinf)
 
void exmem_free_uncached (unsigned int type)
 
void * canon_malloc (long size)
 
void canon_free (void *p)
 
void * umalloc (long size)
 
void ufree (void *p)
 
void * memcpy (void *dest, const void *src, long n)
 
void * memset (void *s, int c, int n)
 
int memcmp (const void *s1, const void *s2, long n)
 
void * memchr (const void *s, int c, int n)
 
void GetMemInfo (cam_meminfo *camera_meminfo)
 
int rand (void)
 
void * srand (unsigned int seed)
 
void qsort (void *__base, int __nelem, int __size, int(*__cmp)(const void *__e1, const void *__e2))
 
void disable_shutdown ()
 
void enable_shutdown ()
 
void camera_shutdown_in_a_second (void)
 
void EnterToCompensationEVF (void)
 
void ExitFromCompensationEVF ()
 
void TurnOnBackLight (void)
 
void TurnOffBackLight (void)
 
void gui_set_need_restore ()
 
void TurnOnDisplay (void)
 
void TurnOffDisplay (void)
 
void DoAELock (void)
 
void UnlockAE (void)
 
void DoAFLock (void)
 
void UnlockAF (void)
 
int EngDrvRead (int gpio_reg)
 
int swap_partitions (__attribute__((unused)) int new_partition)
 
int get_part_count (void)
 
int get_part_type ()
 
unsigned char get_active_partition (void)
 
int is_partition_changed ()
 
int mute_on_zoom (int x)
 
long dh_err ()
 
void drv_self_hide ()
 
void drv_self_unhide ()
 
int apex2us (int apex_tv)
 
void PostLogicalEventForNotPowerType (unsigned id, unsigned x)
 
void PostLogicalEventToUI (unsigned id, unsigned x)
 
void SetLogicalEventActive (unsigned id, unsigned state)
 
void SetScriptMode (unsigned mode)
 
int vid_get_viewport_type ()
 
int add_ptp_handler (int opcode, ptp_handler handler, int unknown)
 
int CreateTask (const char *name, int prio, int stack_size, void *entry)
 
void ExitTask ()
 
unsigned char SetFileAttributes (const char *fn, unsigned char attr)
 
void * vid_get_viewport_active_buffer ()
 
int _SetHPTimerAfterNow (int delay, int(*good_cb)(int, int), int(*bad_cb)(int, int), int)
 
int _CancelHPTimer (int)
 
int usb_HPtimer_bad (int, int)
 
int usb_HPtimer_good (int, int)
 
static int ARM_usb_HPtimer_good (int time, int interval)
 
static int ARM_usb_HPtimer_bad (int time, int interval)
 
int start_usb_HPtimer (int interval)
 
int stop_usb_HPtimer ()
 
int SetHPTimerAfterNow (int delay, int(*good_cb)(int, int), int(*bad_cb)(int, int), int param)
 
int CancelHPTimer (int handle)
 
void DebugAssert (char *err, int line)
 
int CreateBinarySemaphore (char *name, int init)
 
int TakeSemaphore (int sem, int timeout)
 
void GiveSemaphore (int sem)
 
void DeleteSemaphore (int sem)
 

Variablen

int canon_heap_sem
 
int fileio_semaphore
 
static int shutdown_disabled = 0
 
static long drv_struct [16]
 
int usb_HPtimer_handle =0
 

Makro-Dokumentation

#define CANON_HEAP_SEM_TIMEOUT   1000

Definiert in Zeile 16 der Datei wrappers.c.

Dokumentation der Funktionen

short __attribute__ ( (weak)  )

Definiert in Zeile 157 der Datei wrappers.c.

158 {
159  // avoid asserts: return 0 if id is above limit
160  if (id >= (unsigned long)uiprop_count)
161  return 0;
162  return _PTM_GetCurrentItem(id|0x8000);
163 }
int _CancelHPTimer ( int  )
int _SetHPTimerAfterNow ( int  delay,
int(*)(int, int)  good_cb,
int(*)(int, int)  bad_cb,
int   
)
int add_ptp_handler ( int  opcode,
ptp_handler  handler,
int  unknown 
)

Definiert in Zeile 1694 der Datei wrappers.c.

1695 {
1696 #ifdef CAM_CHDK_PTP
1697  return _add_ptp_handler(opcode,handler,unknown);
1698 #else
1699  return 0;
1700 #endif
1701 }
int apex2us ( int  apex_tv)

Definiert in Zeile 1589 der Datei wrappers.c.

1589  {
1590 #if CAM_EXT_TV_RANGE
1591 /*
1592  Extended Tv, by barberofcivil, http://chdk.setepontos.com/index.php/topic,4392.0.html
1593  Explanation by reyalP:
1594  In every port, the original shutter overrides (as opposed to super long exposure) worked by
1595  setting the propcase values at some point after auto-exposure has happened (except in manual
1596  modes, where the manual control propcases may be used instead). The Canon code previously took
1597  these values unchanged for short exposures. In newer cameras, like on the SX10 / SD980, the value
1598  is changed, apparently some time after it has been retrieved from the propcase. We know this is
1599  the case, because the propcase value itself doesn't get clamped to the allowed range (if it did,
1600  barberofcivil's code wouldn't work).
1601 */
1602  short tv;
1603  tv = shooting_get_tv96();
1604  if (tv<-576 || tv!=apex_tv) return 1000000.0*pow(2.0, -tv/96.0);
1605  else return _apex2us(apex_tv);
1606 #else
1607  return 0;
1608 #endif
1609 }
static int ARM_usb_HPtimer_bad ( int  time,
int  interval 
)
static

Definiert in Zeile 1936 der Datei wrappers.c.

1936 { return usb_HPtimer_bad(time, interval); }
static int ARM_usb_HPtimer_good ( int  time,
int  interval 
)
static

Definiert in Zeile 1935 der Datei wrappers.c.

1935 { return usb_HPtimer_good(time, interval); }
void camera_shutdown_in_a_second ( void  )

Definiert in Zeile 1196 der Datei wrappers.c.

1196  {
1197  int i;
1198  _SetAutoShutdownTime(1); // 1 sec
1199  for (i=0;i<200;i++)
1200  _UnlockMainPower(); // set power unlock counter to 200 or more, because every keyboard function call try to lock power again ( if "Disable LCD off" menu is "alt" or "script").
1201 }
int CancelHPTimer ( int  handle)

Definiert in Zeile 1972 der Datei wrappers.c.

1973 {
1974  return _CancelHPTimer(handle);
1975 }
void canon_free ( void *  p)

Definiert in Zeile 1054 der Datei wrappers.c.

1055 {
1056 #if CAM_DRYOS
1057  _free(p);
1058 #else
1060  _free(p);
1062  }
1063 #endif
1064 }
void* canon_malloc ( long  size)

Definiert in Zeile 1039 der Datei wrappers.c.

1040 {
1041 #if CAM_DRYOS
1042  return _malloc(size);
1043 #else
1045  return 0;
1046  } else {
1047  void *r=_malloc(size);
1049  return r;
1050  }
1051 #endif
1052 }
int close ( int  fd)

Definiert in Zeile 475 der Datei wrappers.c.

476 {
477 #if defined(OPT_FILEIO_STATS)
478  camera_info.fileio_stats.close_count++;
479 #endif
480  if (fd == -1)
481  {
482 #if defined(OPT_FILEIO_STATS)
483  camera_info.fileio_stats.close_badfile_count++;
484 #endif
485  return -1;
486  }
487  int haveSemaphore = takeFileIOSemaphore();
488  if (!haveSemaphore)
489 #if defined(CAM_IS_VID_REC_WORKS)
490  if (!conf.allow_unsafe_io)
491 #endif
492  return -1;
493  int r = _Close(fd);
494  if (haveSemaphore)
495  _GiveSemaphore(fileio_semaphore);
496 #if defined(OPT_FILEIO_STATS)
497  if (r == -1)
498  camera_info.fileio_stats.close_fail_count++;
499 #endif
500  return r;
501 }
int CreateBinarySemaphore ( char *  name,
int  init 
)

Definiert in Zeile 2026 der Datei wrappers.c.

2027 {
2028  extern int _CreateBinarySemaphore(char*, int);
2029  return _CreateBinarySemaphore(name, init);
2030 }
int CreateTask ( const char *  name,
int  prio,
int  stack_size,
void *  entry 
)

Definiert in Zeile 1715 der Datei wrappers.c.

1716 {
1717  return _CreateTask(name, prio, stack_size, entry, 0);
1718 }
void DebugAssert ( char *  err,
int  line 
)

Definiert in Zeile 2015 der Datei wrappers.c.

2016 {
2017 #if CAM_3ARG_DebugAssert
2018  extern void _DebugAssert(int, char*, int);
2019  _DebugAssert(0, err, line);
2020 #else
2021  extern void _DebugAssert(char*, int);
2022  _DebugAssert(err, line);
2023 #endif
2024 }
void DeleteSemaphore ( int  sem)

Definiert in Zeile 2042 der Datei wrappers.c.

2043 {
2044  _DeleteSemaphore(sem);
2045 }
long dh_err ( )

Definiert in Zeile 1568 der Datei wrappers.c.

1569 {
1570  return -1;
1571 }
void disable_shutdown ( )

Definiert in Zeile 1182 der Datei wrappers.c.

1182  {
1183  if (!shutdown_disabled) {
1184  _LockMainPower();
1185  shutdown_disabled = 1;
1186  }
1187 }
void DoAELock ( void  )

Definiert in Zeile 1237 der Datei wrappers.c.

1238 {
1240  {
1241  _DoAELock();
1242  }
1243 }
void DoAFLock ( void  )

Definiert in Zeile 1253 der Datei wrappers.c.

1254 {
1256  {
1257  int af_lock=1;
1258  _DoAFLock();
1259  set_property_case(PROPCASE_AF_LOCK,&af_lock,sizeof(af_lock));
1260  }
1261 }
void drv_self_hide ( void  )

Definiert in Zeile 1574 der Datei wrappers.c.

1575 {
1576  long drvnum;
1577 
1579  if (drvnum >= 0)
1580  _iosDevAdd(drv_struct, "A/DISKBOOT.BIN", drvnum);
1581 }
void drv_self_unhide ( void  )

Definiert in Zeile 1583 der Datei wrappers.c.

1584 {
1586 }
void enable_shutdown ( )

Definiert in Zeile 1189 der Datei wrappers.c.

1189  {
1190  if (shutdown_disabled) {
1191  _UnlockMainPower();
1192  shutdown_disabled = 0;
1193  }
1194 }
int EngDrvRead ( int  gpio_reg)

Definiert in Zeile 1273 der Datei wrappers.c.

1274 {
1275  return _EngDrvRead(gpio_reg);
1276 }
void EnterToCompensationEVF ( void  )

Definiert in Zeile 1203 der Datei wrappers.c.

1204 {
1206 }
int errnoOfTaskGet ( int  tid)

Definiert in Zeile 839 der Datei wrappers.c.

839  {
840 #if !CAM_DRYOS
841  return _errnoOfTaskGet(tid);
842 #else
843  (void)tid;
844  return 0;
845 #endif
846 }
void ExitFromCompensationEVF ( void  )

Definiert in Zeile 1208 der Datei wrappers.c.

1209 {
1211 }
void ExitTask ( void  )

Definiert in Zeile 1720 der Datei wrappers.c.

1721 {
1722  _ExitTask();
1723 }
void* exmem_alloc_uncached ( unsigned int  type,
unsigned int  size,
exmem_alloc_info allocinf 
)

Definiert in Zeile 1030 der Datei wrappers.c.

1031 {
1032  return _exmem_ualloc(type, size, allocinf);
1033 }
void exmem_free_uncached ( unsigned int  type)

Definiert in Zeile 1034 der Datei wrappers.c.

1035 {
1036  _exmem_ufree(type);
1037 }
long fclose ( FILE f)

Definiert in Zeile 790 der Datei wrappers.c.

790  {
791  return _Fclose_Fut((long)f);
792 }
long feof ( FILE file)

Definiert in Zeile 806 der Datei wrappers.c.

806  {
807  return _Feof_Fut((long)file);
808 }
long fflush ( FILE file)

Definiert in Zeile 810 der Datei wrappers.c.

810  {
811  return _Fflush_Fut((long)file);
812 }
char* fgets ( char *  buf,
int  n,
FILE f 
)

Definiert in Zeile 814 der Datei wrappers.c.

814  {
815  return _Fgets_Fut(buf,n,(int)f);
816 }
FILE* fopen ( const char *  filename,
const char *  mode 
)

Definiert in Zeile 775 der Datei wrappers.c.

775  {
776 #ifdef CAM_DRYOS
777  if(!filename || filename[0]!='A') {
778  return NULL;
779  }
780 #endif
781 
782  // Check fileio semaphore, if not available we are probably recording video
783  if (!takeFileIOSemaphore())
784  return NULL;
785  _GiveSemaphore(fileio_semaphore);
786 
787  return (FILE *)_Fopen_Fut(filename,mode);
788 }
long fread ( void *  buf,
long  elsize,
long  count,
FILE f 
)

Definiert in Zeile 794 der Datei wrappers.c.

794  {
795  return _Fread_Fut(buf,elsize,count,(long)f);
796 }
long fseek ( FILE file,
long  offset,
long  whence 
)

Definiert in Zeile 802 der Datei wrappers.c.

802  {
803  return _Fseek_Fut((long)file,offset,whence);
804 }
int fw_closedir ( void *  d)

Definiert in Zeile 574 der Datei wrappers.c.

575 {
576  int have_semaphore = takeFileIOSemaphore();
577  if (!have_semaphore)
578 #if defined(CAM_IS_VID_REC_WORKS)
579  if (!conf.allow_unsafe_io)
580 #endif
581  return -1;
582 
583  extern int _closedir(void *d);
584  int ret = _closedir(d);
585 
586  if (have_semaphore)
587  _GiveSemaphore(fileio_semaphore);
588 
589  return ret;
590 }
void* fw_opendir ( const char *  name)

Definiert in Zeile 632 der Datei wrappers.c.

633  {
634  void *ret;
635  int have_semaphore = takeFileIOSemaphore();
636  if (!have_semaphore)
637 #if defined(CAM_IS_VID_REC_WORKS)
638  if (!conf.allow_unsafe_io)
639 #endif
640  return NULL;
641 
642  extern void *_opendir(const char* name);
643  ret = _opendir(name);
644 
645  if (have_semaphore)
646  _GiveSemaphore(fileio_semaphore);
647 
648  return ret;
649  }
void* fw_readdir ( void *  d)

Definiert in Zeile 651 der Datei wrappers.c.

652  {
653  extern void *_readdir(void *d);
654  return _readdir(d);
655  }
long fwrite ( const void *  buf,
long  elsize,
long  count,
FILE f 
)

Definiert in Zeile 798 der Datei wrappers.c.

798  {
799  return _Fwrite_Fut(buf,elsize,count,(long)f);
800 }
unsigned char get_active_partition ( void  )

Definiert in Zeile 1472 der Datei wrappers.c.

1472 { return 1; }
int get_battery_temp ( )

Definiert in Zeile 328 der Datei wrappers.c.

329 {
330  return _GetBatteryTemperature();
331 }
int get_ccd_temp ( )

Definiert in Zeile 333 der Datei wrappers.c.

334 {
335  return _GetCCDTemperature();
336 }
int get_optical_temp ( )

Definiert in Zeile 338 der Datei wrappers.c.

339 {
340  return _GetOpticalTemperature();
341 }
long get_parameter_data ( long  id,
void *  buf,
long  bufsize 
)

Definiert in Zeile 147 der Datei wrappers.c.

148 {
149  return _GetParameterData(id|PARAMETER_DATA_FLAG, buf, bufsize);
150 }
short get_parameter_size ( long  id)

Definiert in Zeile 137 der Datei wrappers.c.

138 {
139  extern flashParam* FlashParamsTable[];
140 
141  if ((id >= 0) && (id < get_flash_params_count()))
142  return FlashParamsTable[id]->size;
143 
144  return 0;
145 }
int get_part_count ( void  )

Definiert in Zeile 1470 der Datei wrappers.c.

1470 { return 1; }
int get_part_type ( void  )

Definiert in Zeile 1471 der Datei wrappers.c.

1471 { return 0; }
long get_property_case ( long  id,
void *  buf,
long  bufsize 
)

Definiert in Zeile 75 der Datei wrappers.c.

76 {
77 // workaround for missing PROPCASE_SHOOTING
78 #if CAM_PROPSET == 7 || CAM_PROPSET == 9 || CAM_PROPSET == 10 || CAM_PROPSET == 11 || CAM_PROPSET == 12 || CAM_PROPSET == 13
79  if(id==PROPCASE_SHOOTING) {
81  // 1 50ms after half press, 2 after exp hook, 3 while shooting
82  // propset 6 has similar procase id 351, goes 3->0 when get_shooting goes false
83  // propset 4 and 5 id 352 is similar but only goes to 2
84  // (4 per https://chdk.setepontos.com/index.php?topic=11604.msg113712#msg113712)
85  if(*(char *)buf > 1) {
86  *(char *)buf = 1;
87  } else {
88  *(char *)buf = 0;
89  }
90  return r;
91  }
92 #endif
93  return _GetPropertyCase(id, buf, bufsize);
94 }
long get_tick_count ( void  )

Definiert in Zeile 343 der Datei wrappers.c.

344 {
345 long t;
346 #if !CAM_DRYOS
347  _GetSystemTime(&t);
348  return t;
349 #else
350  return (int)_GetSystemTime(&t);
351 #endif
352 }
unsigned int GetFreeCardSpaceKb ( void  )

Definiert in Zeile 822 der Datei wrappers.c.

822  {
823 // get free clusters directly for digic >= 6, updates during video recording
824 #ifdef THUMB_FW
825  extern unsigned long live_free_cluster_count;
826  unsigned long free_clusters = live_free_cluster_count;
827 #else
828  unsigned long free_clusters = _GetDrive_FreeClusters(0);
829 #endif
830  return (free_clusters*(_GetDrive_ClusterSize(0)>>9))>>1;
831 }
void GetMemInfo ( cam_meminfo camera_meminfo)

Definiert in Zeile 1111 der Datei wrappers.c.

1112 {
1113 // Use firmware GetMemInfo function to retrieve info about Canon heap memory allocation
1114 
1115 #if defined(CAM_DRYOS)
1116  // Prior to dryos R39 GetMemInfo returns 9 values, after R39 it returns 10 (all but 1 are used in each case)
1117  int fw_info[10];
1118  extern void _GetMemInfo(int*);
1119  _GetMemInfo(fw_info);
1120 
1121 #if defined(CAM_DRYOS_2_3_R39)
1122  // For newer dryos version copy all 9 used values to CHDK structure
1123  camera_meminfo->start_address = fw_info[0];
1124  camera_meminfo->end_address = fw_info[1];
1125  camera_meminfo->total_size = fw_info[2];
1126  camera_meminfo->allocated_size = fw_info[3];
1127  camera_meminfo->allocated_peak = fw_info[4];
1128  camera_meminfo->allocated_count = fw_info[5];
1129  camera_meminfo->free_size = fw_info[6];
1130  camera_meminfo->free_block_max_size = fw_info[7];
1131  camera_meminfo->free_block_count = fw_info[8];
1132 #else
1133  // For older dryos version copy 8 used values to CHDK structure and calculate missing value
1134  camera_meminfo->start_address = fw_info[0];
1135  camera_meminfo->end_address = fw_info[0] + fw_info[1];
1136  camera_meminfo->total_size = fw_info[1];
1137  camera_meminfo->allocated_size = fw_info[2];
1138  camera_meminfo->allocated_peak = fw_info[3];
1139  camera_meminfo->allocated_count = fw_info[4];
1140  camera_meminfo->free_size = fw_info[5];
1141  camera_meminfo->free_block_max_size = fw_info[6];
1142  camera_meminfo->free_block_count = fw_info[7];
1143 #endif
1144 #else // vxworks
1145  extern int sys_mempart_id;
1146  // -1 for invalid
1147  memset(camera_meminfo,0xFF,sizeof(cam_meminfo));
1149 #ifdef CAM_NO_MEMPARTINFO
1150  camera_meminfo->free_block_max_size = _memPartFindMax(sys_mempart_id);
1151 #else
1152  int fw_info[5];
1153  _memPartInfoGet(sys_mempart_id,fw_info);
1154  // TODO we could fill in start address from _start + MEMISOSIZE, if chdk not in exmem
1155  // these are guessed, look reasonable on a540
1156  camera_meminfo->free_size = fw_info[0];
1157  camera_meminfo->free_block_count = fw_info[1];
1158  camera_meminfo->free_block_max_size = fw_info[2];
1159  camera_meminfo->allocated_size = fw_info[3];
1160  camera_meminfo->allocated_count = fw_info[4];
1161 #endif
1163  }
1164 #endif
1165 }
unsigned int GetTotalCardSpaceKb ( void  )

Definiert in Zeile 833 der Datei wrappers.c.

833  {
834  return (_GetDrive_TotalClusters(0)*(_GetDrive_ClusterSize(0)>>9))>>1;
835 }
void GiveSemaphore ( int  sem)

Definiert in Zeile 2037 der Datei wrappers.c.

2038 {
2039  _GiveSemaphore(sem);
2040 }
void gui_set_need_restore ( )

Definiert in Zeile 2430 der Datei gui.c.

2431 {
2433 }
int is_partition_changed ( void  )

Definiert in Zeile 1473 der Datei wrappers.c.

1473 { return 0; }
int isalpha ( int  c)

Definiert in Zeile 27 der Datei wrappers.c.

27 { return _isalpha(c); }
int isdigit ( int  c)

Definiert in Zeile 25 der Datei wrappers.c.

25 { return _isdigit(c); }
int islower ( int  c)

Definiert in Zeile 29 der Datei wrappers.c.

29 { return _islower(c); }
int ispunct ( int  c)

Definiert in Zeile 30 der Datei wrappers.c.

30 { return _ispunct(c); }
int isspace ( int  c)

Definiert in Zeile 26 der Datei wrappers.c.

26 { return _isspace(c); }
long IsStrobeChargeCompleted ( void  )

Definiert in Zeile 389 der Datei wrappers.c.

389 { return _IsStrobeChargeCompleted(); }
int isupper ( int  c)

Definiert in Zeile 28 der Datei wrappers.c.

28 { return _isupper(c); }
int isxdigit ( int  c)

Definiert in Zeile 31 der Datei wrappers.c.

31 { return _isxdigit(c); }
long lens_get_zoom_point ( )

Definiert in Zeile 191 der Datei wrappers.c.

192 {
193  return _GetZoomLensCurrentPoint();
194 }
long lens_get_zoom_pos ( )

Definiert in Zeile 186 der Datei wrappers.c.

187 {
189 }
void lens_set_focus_pos ( long  newpos)

Definiert in Zeile 281 der Datei wrappers.c.

282 {
283  if (newpos >= CAMERA_MAX_DIST) newpos = INFINITY_DIST; // Set to infinity value that will work on all cameras
284  _MoveFocusLensToDistance((short*)&newpos);
285  while ((shooting_is_flash_ready()!=1) || (focus_busy)) msleep(10);
286  newpos = _GetFocusLensSubjectDistance();
287  _SetPropertyCase(PROPCASE_SUBJECT_DIST1, &newpos, sizeof(newpos));
288  _SetPropertyCase(PROPCASE_SUBJECT_DIST2, &newpos, sizeof(newpos));
289 }
void lens_set_zoom_point ( long  newpt)

Definiert in Zeile 205 der Datei wrappers.c.

206 {
207  if (newpt < 0) {
208  newpt = 0;
209  } else if (newpt >= zoom_points) {
210  newpt = zoom_points-1;
211  }
212 
213 #if defined(CAM_USE_ALT_SET_ZOOM_POINT)
214 
215  if (lens_get_zoom_point() != newpt)
216  {
217  int digizoom_pos;
218  get_property_case(PROPCASE_DIGITAL_ZOOM_POSITION,&digizoom_pos,sizeof(digizoom_pos));
219  // check current digital zoom mode & state
220  // state == 1 && mode == 0 --> Digital Zoom Standard
221  if ((shooting_get_digital_zoom_state() == 1) && (shooting_get_digital_zoom_mode() == 0) && (digizoom_pos != 0))
222  {
223  // reset digital zoom in case camera is in this zoom range
224  extern void _PT_MoveDigitalZoomToWide();
225  _PT_MoveDigitalZoomToWide();
226  }
227 
228  // starting around digic 4 - _MoveZoomLensWithPoint crashes many cameras
229  // _PT_MoveOpticalZoomAt works, and updates PROPCASE_OPTICAL_ZOOM_POSITION; but doesn't wait for zoom to finish
230  // _MoveOpticalZoom at is underlying function that accepts speed
231  // updates jpeg engine distortion correction setting, maintains focus position
232  extern void _MoveOpticalZoomAt(long pt,int speed);
233  _MoveOpticalZoomAt(newpt,mz_speed);
234 
235  // have to sleep here, zoom_busy set in another task, without sleep this will hang
236  while (zoom_busy) msleep(10);
237 
238  // g10,g12 & sx30 only use this value for optical zoom
240  }
241 #else // !(CAM_USE_ALT_SET_ZOOM_POINT)
242  _MoveZoomLensWithPoint((short*)&newpt);
243 
244  // tight loop here hangs some cameras (the task that clears zoom_busy
245  // is starved; seen at least on S95 and IXUS 220), so stick in a sleep
246  while (zoom_busy) msleep(10);
247 
248  if (newpt==0) zoom_status=ZOOM_OPTICAL_MIN;
249  else if (newpt >= zoom_points) zoom_status=ZOOM_OPTICAL_MAX;
251  _SetPropertyCase(PROPCASE_OPTICAL_ZOOM_POSITION, &newpt, sizeof(newpt));
252 #endif // !(CAM_USE_ALT_SET_ZOOM_POINT)
253 }
void lens_set_zoom_speed ( long  newspd)

Definiert in Zeile 255 der Datei wrappers.c.

256 {
257 // translate % to speed values for _MoveOpticalZoomAt
258 // which correspond to different speeds varies by camera
259 #if defined(CAM_USE_ALT_SET_ZOOM_POINT)
260  if (newspd < 25) {
261  mz_speed = 0;
262  } else if (newspd < 50) {
263  mz_speed = 1;
264  } else if (newspd < 75) {
265  mz_speed = 2;
266  } else {
267  mz_speed = 3;
268  }
269 #else // !CAM_USE_ALT_SET_ZOOM_POINT
270  // a few old cameras support setting by %
271  if (newspd < 5) {
272  newspd = 5;
273  } else if (newspd > 100) {
274  newspd = 100;
275  }
276  _SetZoomActuatorSpeedPercent((short*)&newspd);
277 #endif // !CAM_USE_ALT_SET_ZOOM_POINT
278 }
struct tm* localtime ( const time_t _tod)

Definiert in Zeile 958 der Datei wrappers.c.

958  {
959 #if !CAM_DRYOS
960  return _localtime(_tod);
961 #else
962  // for DRYOS cameras do something with this! - sizeof(x[]) must be >= sizeof(struct tm) : 'static int x[9];'
963  static int x[10];
964  return _LocalTime(_tod, &x);
965 #endif
966 }
double log ( double  x)

Definiert in Zeile 1002 der Datei wrappers.c.

1002  {
1003  return __log(x);
1004 }
double log10 ( double  x)

Definiert in Zeile 1006 der Datei wrappers.c.

1006  {
1007  return __log10(x);
1008 }
double log2 ( double  x)

Definiert in Zeile 1019 der Datei wrappers.c.

1019 { return (log(x) * ((double)1.44269504088906)); }
int lseek ( int  fd,
long  offset,
int  whence 
)

Definiert in Zeile 529 der Datei wrappers.c.

530 {
531  return _lseek(fd, offset, whence); /* yes, it's lower-case lseek here since Lseek calls just lseek (A610) */
532 }
void mark_filesystem_bootable ( )

Definiert in Zeile 165 der Datei wrappers.c.

166 {
167 #ifdef CAM_DRYOS_2_3_R47
168  // DryOS release 47 (2011) no longer has the UpdateMBROnFlash function to write the master boot record on
169  // the SD card. Instead it has seperate functions for writing the 'BOOTDISK' and 'SCRIPT' signatures to
170  // the MBR. The firmware function also takes care of writing the bootdisk signature to the correct location
171  // for FAT32 formatted cards.
172  _MakeSDCardBootable(0);
173 #else
174  _UpdateMBROnFlash(0, 0x40, "BOOTDISK");
175 #endif
176 }
void* memchr ( const void *  s,
int  c,
int  n 
)

Definiert in Zeile 1104 der Datei wrappers.c.

1104  {
1105  return _memchr(s,c,n);
1106 }
int memcmp ( const void *  s1,
const void *  s2,
long  n 
)

Definiert in Zeile 1099 der Datei wrappers.c.

1099  {
1100  return _memcmp(s1, s2, n);
1101 }
void* memcpy ( void *  dest,
const void *  src,
long  n 
)

Definiert in Zeile 1091 der Datei wrappers.c.

1091  {
1092  return _memcpy(dest, src, n);
1093 }
void* memset ( void *  s,
int  c,
int  n 
)

Definiert in Zeile 1095 der Datei wrappers.c.

1095  {
1096  return _memset(s, c, n);
1097 }
long mkdir ( const char *  dirname)

Definiert in Zeile 534 der Datei wrappers.c.

535 {
536 #ifdef MKDIR_RETURN_ONE_ON_SUCCESS
537  // mkdir returns 1 on success, 0 on fail. So, values are inverted, to be compatible with previous versions
538  if(_MakeDirectory_Fut(dirname,1)) return 0;
539  else return 1;
540 #else
541  return _MakeDirectory_Fut(dirname,-1); // meaning of second arg is not clear, firmware seems to use -1
542 #endif
543 }
long mkdir_if_not_exist ( const char *  dirname)

Definiert in Zeile 545 der Datei wrappers.c.

546 {
547  // Check if directory exists and create it if it does not.
548  if (stat(dirname,0) != 0) return mkdir(dirname);
549  return 0; // Success
550 }
time_t mktime ( struct tm timp)

Definiert in Zeile 972 der Datei wrappers.c.

972  {
973 #if !CAM_DRYOS
974  return _mktime(timp);
975 #else
976  int timp_ext[10]; // struct tm + a ptr
977  _memcpy(timp_ext,timp,9*sizeof(int));
978  timp_ext[9]=0;
979  long retval = _mktime_ext(&timp_ext);
980  _memcpy(timp,timp_ext,9*sizeof(int));
981  return retval;
982 #endif
983 }
void msleep ( long  msec)

Definiert in Zeile 48 der Datei wrappers.c.

49 {
50  _SleepTask(msec);
51 }
int mute_on_zoom ( int  x)

Definiert in Zeile 1477 der Datei wrappers.c.

1477  {
1478  static int old_busy=0;
1479  int busy=zoom_busy||focus_busy;
1480  if (old_busy!=busy) {
1481  if (busy) {
1482 #if CAM_CAN_MUTE_MICROPHONE
1483  if (conf.mute_on_zoom) _TurnOffMic();
1484 #endif
1485  }
1486  else {
1487 #if CAM_CAN_MUTE_MICROPHONE
1488  if (conf.mute_on_zoom) _TurnOnMic();
1489 #endif
1490 #if CAM_EV_IN_VIDEO
1492 #endif
1493  }
1494  old_busy=busy;
1495  }
1496  return x; // preserve R0 if called from assembler
1497 }
int open ( const char *  name,
int  flags,
int  mode 
)

Definiert in Zeile 446 der Datei wrappers.c.

447 {
448 #if defined(OPT_FILEIO_STATS)
449  camera_info.fileio_stats.open_count++;
450 #endif
451 #if !CAM_DRYOS
452  // Adjust O_TRUNC and O_CREAT flags for VxWorks
453  // Remove O_APPEND flag if present (not in VxWorks)
454  flags = (flags & ~(O_TRUNC|O_CREAT|O_APPEND)) | ((flags & (O_TRUNC|O_CREAT)) << 1);
455 #else
456  if(!name || name[0]!='A')
457  return -1;
458 #endif
459  int haveSemaphore = takeFileIOSemaphore();
460  if (!haveSemaphore)
461 #if defined(CAM_IS_VID_REC_WORKS)
462  if (!conf.allow_unsafe_io)
463 #endif
464  return -1;
465  int fd = _Open(name, flags, mode);
466  if (haveSemaphore)
467  _GiveSemaphore(fileio_semaphore);
468 #if defined(OPT_FILEIO_STATS)
469  if (fd == -1)
470  camera_info.fileio_stats.open_fail_count++;
471 #endif
472  return fd;
473 }
void play_sound ( unsigned  sound)

Definiert in Zeile 291 der Datei wrappers.c.

292 {
293  static const int sounds[]={ 0x2001, //startup sound
294  0x2002, //shutter sound
295  0x2003, //button press sound
296  0x2004, //self-timer sound
297  0xC211, //short beep
298  50000, // AF confirmation
299  0xC507, // error beep imo
300  0x400D, // LONG ERROR BEEP CONTINIUOUS- warning, cannot be stopped (yet)
301  };
302  if(sound >= sizeof(sounds)/sizeof(sounds[0]))
303  return;
304 
305  _PT_PlaySound(sounds[sound], 0, 0);
306 }
void PostLogicalEventForNotPowerType ( unsigned  id,
unsigned  x 
)

Definiert in Zeile 1611 der Datei wrappers.c.

1611  {
1613 }
void PostLogicalEventToUI ( unsigned  id,
unsigned  x 
)

Definiert in Zeile 1615 der Datei wrappers.c.

1615  {
1617 }
double pow ( double  x,
double  y 
)

Definiert in Zeile 1010 der Datei wrappers.c.

1010  {
1011  return __pow(x, y);
1012 }
void qsort ( void *  __base,
int  __nelem,
int  __size,
int(*)(const void *__e1, const void *__e2)  __cmp 
)

Definiert in Zeile 1177 der Datei wrappers.c.

1177  {
1178  _qsort(__base, __nelem, __size, __cmp);
1179 }
int rand ( void  )

Definiert in Zeile 1169 der Datei wrappers.c.

1169  {
1170  return _rand();
1171 }
int read ( int  fd,
void *  buffer,
long  nbytes 
)

Definiert in Zeile 524 der Datei wrappers.c.

525 {
526  return _Read(fd, buffer, nbytes);
527 }
int remove ( const char *  name)

Definiert in Zeile 552 der Datei wrappers.c.

553 {
554 #ifdef CAM_DRYOS_2_3_R39
555  // For DryOS R39 and later need to check if 'name' is a file or directory
556  // and call appropriate delete function.
557  struct stat st;
558  if (stat(name,&st) == 0)
559  {
560  if (st.st_attrib & DOS_ATTR_DIRECTORY)
561  return _DeleteDirectory_Fut(name);
562  else
563  return _DeleteFile_Fut(name);
564  }
565  return -1; // return fail - file / directory does not exist
566 #else
567  return _DeleteFile_Fut(name);
568 #endif
569 }
int rename ( const char *  oldname,
const char *  newname 
)

Definiert in Zeile 818 der Datei wrappers.c.

818  {
819  return _RenameFile_Fut(oldname, newname);
820 }
void set_clock ( int  year,
int  month,
int  day,
int  hour,
int  minute,
int  second 
)

Definiert in Zeile 985 der Datei wrappers.c.

986 {
987  int buf[6];
988  buf[0] = year;
989  buf[1] = month;
990  buf[2] = day;
991  buf[3] = hour;
992  buf[4] = minute;
993  buf[5] = second;
994  _SetDate(buf);
995  // SetDate sets second, so adjust subsec offset
997 }
long set_parameter_data ( long  id,
void *  buf,
long  bufsize 
)

Definiert in Zeile 152 der Datei wrappers.c.

153 {
154  return _SetParameterData(id|PARAMETER_DATA_FLAG, buf, bufsize);
155 }
long set_property_case ( long  id,
void *  buf,
long  bufsize 
)

Definiert in Zeile 96 der Datei wrappers.c.

97 {
98  // ignore set on fake prop
99 #if CAM_PROPSET == 7 || CAM_PROPSET == 9 || CAM_PROPSET == 10 || CAM_PROPSET == 11 || CAM_PROPSET == 12 || CAM_PROPSET == 13
100  if(id==PROPCASE_SHOOTING) {
101  return 0;
102  }
103 #endif
104 
105  return _SetPropertyCase(id, buf, bufsize);
106 }
void SetCurrentCaptureModeType ( void  )

Definiert in Zeile 390 der Datei wrappers.c.

unsigned char SetFileAttributes ( const char *  fn,
unsigned char  attr 
)

Definiert in Zeile 1805 der Datei wrappers.c.

1806 {
1807 #ifdef CAM_DRYOS_2_3_R39
1808  return _SetFileAttributes(fn, attr);
1809 #else
1810  int fd;
1811  unsigned char ret = -1;
1812 
1813  fd = open(fn, 0, 0);
1814  if( fd ) {
1815  _SetFileAttributes(fd, attr);
1816  close(fd);
1817  ret = attr;
1818  }
1819  return ret;
1820 #endif
1821 }
int SetHPTimerAfterNow ( int  delay,
int(*)(int, int)  good_cb,
int(*)(int, int)  bad_cb,
int  param 
)

Definiert in Zeile 1967 der Datei wrappers.c.

1968 {
1969  return _SetHPTimerAfterNow(delay,good_cb,bad_cb,param);
1970 }
void SetLogicalEventActive ( unsigned  id,
unsigned  state 
)

Definiert in Zeile 1619 der Datei wrappers.c.

1619  {
1620  _SetLogicalEventActive(id, state);
1621 }
void SetScriptMode ( unsigned  mode)

Definiert in Zeile 1623 der Datei wrappers.c.

1623  {
1625 }
long shooting_get_current_av96 ( )

Definiert in Zeile 385 der Datei wrappers.c.

385 { return _GetCurrentAvValue(); }
long shooting_get_current_base_sv96 ( )

Definiert in Zeile 387 der Datei wrappers.c.

387 { return _GetCurrentDriveBaseSvValue(); }
long shooting_get_current_delta_sv96 ( )

Definiert in Zeile 386 der Datei wrappers.c.

386 { return _get_current_deltasv(); }
long shooting_get_current_tv96 ( )

Definiert in Zeile 377 der Datei wrappers.c.

378 {
379  // old cameras crash if _GetCurrentShutterSpeed called when inactive
381  return SHOOTING_TV96_INVALID;
382  }
383  return _GetCurrentShutterSpeed();
384 }
short shooting_get_nd_current_ev96 ( void  )

Definiert in Zeile 368 der Datei wrappers.c.

369 {
370 #if CAM_HAS_ND_FILTER
371  return _get_current_nd_value();
372 #else
373  return 0;
374 #endif
375 }
short shooting_get_nd_value_ev96 ( void  )

Definiert in Zeile 359 der Datei wrappers.c.

360 {
361 #if CAM_HAS_ND_FILTER
362  return _get_nd_value();
363 #else
364  return 0;
365 #endif
366 }
long sprintf ( char *  s,
const char *  st,
  ... 
)

Definiert in Zeile 904 der Datei wrappers.c.

905 {
906  long res;
907  __builtin_va_list va;
908  __builtin_va_start(va, st);
909  res = _vsprintf(s, st, va);
910  __builtin_va_end(va);
911  return res;
912 }
double sqrt ( double  x)

Definiert in Zeile 1014 der Datei wrappers.c.

1014  {
1015  return __sqrt(x);
1016 }
void* srand ( unsigned int  seed)

Definiert in Zeile 1173 der Datei wrappers.c.

1173  {
1174  return _srand(seed);
1175 }
int start_usb_HPtimer ( int  interval)

Definiert in Zeile 1938 der Datei wrappers.c.

1939 {
1940 #ifdef CAM_REMOTE_USB_HIGHSPEED
1941 
1942  if ( usb_HPtimer_handle == 0 )
1943  {
1946  if (!(usb_HPtimer_handle & 0x01)) return 1 ;
1947  usb_HPtimer_handle = 0 ;
1948  }
1949 #endif
1950  return 0;
1951 }
int stat ( const char *  name,
struct stat pStat 
)

Definiert in Zeile 749 der Datei wrappers.c.

750 {
751  // sanity check. canon firmware hangup if start not from 'A/'
752  if ( !name || (name[0] | 0x20)!='a' || name[1]!='/' ) return 1;
753 
754  // use temp __stat stucture to match camera firmware
755  // and copy values across to output
756  struct __stat lStat;
757  int rv = _stat(name, &lStat);
758  if (pStat)
759  {
760  if (rv == 0)
761  {
762  pStat->st_attrib = lStat.st_attrib;
763  pStat->st_size = lStat.st_size;
764  pStat->st_ctime = lStat.st_ctime;
765  pStat->st_mtime = lStat.st_mtime;
766  }
767  else
768  {
769  memset( pStat, 0, sizeof(struct stat));
770  }
771  }
772  return rv;
773 }
long stat_get_vbatt ( )

Definiert in Zeile 308 der Datei wrappers.c.

309 {
310  return _VbattGet();
311 }
int stop_usb_HPtimer ( )

Definiert in Zeile 1953 der Datei wrappers.c.

1954 {
1955 #ifdef CAM_REMOTE_USB_HIGHSPEED
1956  if( usb_HPtimer_handle )
1957  {
1959  usb_HPtimer_handle = 0 ;
1960  return 1 ;
1961  }
1962 #endif
1963  return 0;
1964 }
char* strcat ( char *  dest,
const char *  app 
)

Definiert in Zeile 875 der Datei wrappers.c.

875  {
876  return _strcat(dest, app);
877 }
char* strchr ( const char *  s,
int  c 
)

Definiert in Zeile 863 der Datei wrappers.c.

863  {
864  return _strchr(s, c);
865 }
int strcmp ( const char *  s1,
const char *  s2 
)

Definiert in Zeile 855 der Datei wrappers.c.

855  {
856  return _strcmp(s1, s2);
857 }
char* strcpy ( char *  dest,
const char *  src 
)

Definiert in Zeile 867 der Datei wrappers.c.

867  {
868  return _strcpy(dest, src);
869 }
const char* strerror ( int  en)

Definiert in Zeile 916 der Datei wrappers.c.

916  {
917 #if !CAM_DRYOS
918  static char msg[20];
919  sprintf(msg,"errno 0x%X",en);
920  return msg;
921 #else
922  (void)en;
923  return "error";
924 #endif
925 }
long strftime ( char *  s,
unsigned long  maxsize,
const char *  format,
const struct tm timp 
)

Definiert in Zeile 968 der Datei wrappers.c.

968  {
969  return _strftime(s,maxsize,format,timp);
970 }
long strlen ( const char *  s)

Definiert in Zeile 851 der Datei wrappers.c.

851  {
852  return _strlen(s);
853 }
int strncmp ( const char *  s1,
const char *  s2,
long  n 
)

Definiert in Zeile 859 der Datei wrappers.c.

859  {
860  return _strncmp(s1, s2, n);
861 }
char* strncpy ( char *  dest,
const char *  src,
long  n 
)

Definiert in Zeile 871 der Datei wrappers.c.

871  {
872  return _strncpy(dest, src, n);
873 }
char* strpbrk ( const char *  s,
const char *  accept 
)

Definiert in Zeile 896 der Datei wrappers.c.

897 {
898  return _strpbrk(s, accept);
899 }
char* strrchr ( const char *  s,
int  c 
)

Definiert in Zeile 879 der Datei wrappers.c.

879  {
880  return _strrchr(s, c);
881 }
long strtol ( const char *  nptr,
char **  endptr,
int  base 
)

Definiert in Zeile 883 der Datei wrappers.c.

883  {
884  return _strtol(nptr, endptr, base);
885 }
unsigned long strtoul ( const char *  nptr,
char **  endptr,
int  base 
)

Definiert in Zeile 887 der Datei wrappers.c.

887  {
888 #if CAM_DRYOS
889  return (unsigned long)_strtolx(nptr, endptr, base, 0);
890 #else
891  return _strtoul(nptr, endptr, base);
892 #endif
893 }
int submenu_sort_arm ( const void *  v1,
const void *  v2 
)

Definiert in Zeile 40 der Datei wrappers.c.

41 {
42  extern int submenu_sort(const void* v1, const void* v2);
43  return submenu_sort(v1, v2);
44 }
int swap_partitions ( __attribute__((unused)) int  new_partition)

Definiert in Zeile 1469 der Datei wrappers.c.

1469 { return 0; }
int takeFileIOSemaphore ( )

Definiert in Zeile 420 der Datei wrappers.c.

421 {
422  int timeout = CAM_FILEIO_SEM_TIMEOUT;
423 #if defined(CAM_IS_VID_REC_WORKS)
424  if (is_video_recording())
425  timeout = CAM_FILEIO_SEM_TIMEOUT_VID;
426 #endif
427 #if defined(OPT_FILEIO_STATS)
428  int t = get_tick_count();
429 #endif
430  // Check fileio semaphore with timeout, if not available we are probably recording video
431  if (_TakeSemaphore(fileio_semaphore,timeout) & 1)
432  {
433 #if defined(OPT_FILEIO_STATS)
434  camera_info.fileio_stats.fileio_semaphore_errors++;
435 #endif
436  return 0;
437  }
438 #if defined(OPT_FILEIO_STATS)
439  t = get_tick_count() - t;
440  if (t > camera_info.fileio_stats.max_semaphore_timeout)
441  camera_info.fileio_stats.max_semaphore_timeout = t;
442 #endif
443  return 1;
444 }
int TakeSemaphore ( int  sem,
int  timeout 
)

Definiert in Zeile 2032 der Datei wrappers.c.

2033 {
2034  return _TakeSemaphore(sem, timeout);
2035 }
int task_id_list_get ( int *  idlist,
int  size 
)

Definiert in Zeile 69 der Datei wrappers.c.

70 {
71  return _taskIdListGet(idlist,size);
72 }
long task_lock ( )

Definiert in Zeile 54 der Datei wrappers.c.

55 {
56  return _taskLock();
57 }
const char* task_name ( int  id)

Definiert in Zeile 64 der Datei wrappers.c.

65 {
66  return _taskName(id);
67 }
long task_unlock ( )

Definiert in Zeile 59 der Datei wrappers.c.

60 {
61  return _taskUnlock();
62 }
unsigned long time ( unsigned long *  timer)

Definiert in Zeile 930 der Datei wrappers.c.

930  {
931  return _time(timer);
932 }
int tolower ( int  c)

Definiert in Zeile 33 der Datei wrappers.c.

33 { return _tolower(c); }
int toupper ( int  c)

Definiert in Zeile 34 der Datei wrappers.c.

34 { return _toupper(c); }
void TurnOffBackLight ( void  )

Definiert in Zeile 1218 der Datei wrappers.c.

1219 {
1221 }
void TurnOffDisplay ( void  )

Definiert in Zeile 1232 der Datei wrappers.c.

1233 {
1234  _TurnOffDisplay();
1235 }
void TurnOnBackLight ( void  )

Definiert in Zeile 1213 der Datei wrappers.c.

1214 {
1215  _TurnOnBackLight();
1216 }
void TurnOnDisplay ( void  )

Definiert in Zeile 1225 der Datei wrappers.c.

1226 {
1227  _TurnOnDisplay();
1228  // required to re-draw the canon and CHDK UI after re-enabling display
1230 }
void ufree ( void *  p)

Definiert in Zeile 1080 der Datei wrappers.c.

1080  {
1081 #if CAM_DRYOS
1083 #else
1087  }
1088 #endif
1089 }
void* umalloc ( long  size)

Definiert in Zeile 1066 der Datei wrappers.c.

1066  {
1067 #if CAM_DRYOS
1068  return _AllocateUncacheableMemory(size);
1069 #else
1071  return 0;
1072  } else {
1073  void *r=_AllocateUncacheableMemory(size);
1075  return r;
1076  }
1077 #endif
1078 }
void UnlockAE ( void  )

Definiert in Zeile 1245 der Datei wrappers.c.

1246 {
1248  {
1249  _UnlockAE();
1250  }
1251 }
void UnlockAF ( void  )

Definiert in Zeile 1263 der Datei wrappers.c.

1264 {
1266  {
1267  int af_lock=0;
1268  _UnlockAF();
1269  set_property_case(PROPCASE_AF_LOCK,&af_lock,sizeof(af_lock));
1270  }
1271 }
int usb_HPtimer_bad ( int  ,
int   
)

Definiert in Zeile 304 der Datei usb_remote.c.

305 {
307  return (usb_HPtimer_good(time, interval));
308 }
int usb_HPtimer_good ( int  ,
int   
)
int utime ( const char *  file,
struct utimbuf newTimes 
)

Definiert in Zeile 934 der Datei wrappers.c.

934  {
935 #if !CAM_DRYOS
936  return _utime(file, newTimes);
937 #else
938  int res=0;
939  int fd;
940  fd = _open(file, 0, 0);
941 
942 #ifdef CAM_DRYOS_2_3_R39
943  if (fd>=0) {
944  _close(fd);
945  res=_SetFileTimeStamp(file, newTimes->modtime, newTimes->actime);
946  }
947 #else
948  if (fd>=0) {
949  res=_SetFileTimeStamp(fd, newTimes->modtime, newTimes->actime);
950  _close(fd);
951  }
952  // return value compatibe with utime: ok=0 fail=-1
953 #endif
954  return (res)?0:-1;
955 #endif
956 }
void* vid_get_viewport_active_buffer ( )

Definiert in Zeile 1857 der Datei wrappers.c.

1858 {
1859  void *p;
1860 
1862  {
1863  p = vid_get_viewport_fb_d();
1864  } else {
1866  if ( !p )
1867  {
1868  p = vid_get_viewport_fb();
1869  }
1870  }
1871 
1872  return p;
1873 }
int vid_get_viewport_type ( )

Definiert in Zeile 1665 der Datei wrappers.c.

1665  {
1666  return LV_FB_YUV8;
1667 }
int write ( int  fd,
const void *  buffer,
long  nbytes 
)

Definiert in Zeile 503 der Datei wrappers.c.

504 {
505  if (fd == -1)
506  {
507 #if defined(OPT_FILEIO_STATS)
508  camera_info.fileio_stats.write_badfile_count++;
509 #endif
510  return -1;
511  }
512  int haveSemaphore = takeFileIOSemaphore();
513  if (!haveSemaphore)
514 #if defined(CAM_IS_VID_REC_WORKS)
515  if (!conf.allow_unsafe_io)
516 #endif
517  return -1;
518  int r = _Write(fd, buffer, nbytes);
519  if (haveSemaphore)
520  _GiveSemaphore(fileio_semaphore);
521  return r;
522 }

Variablen-Dokumentation

int canon_heap_sem

Definiert in Zeile 234 der Datei memmgmt.c.

long drv_struct[16]
static

Definiert in Zeile 1565 der Datei wrappers.c.

int fileio_semaphore
int shutdown_disabled = 0
static

Definiert in Zeile 1181 der Datei wrappers.c.

int usb_HPtimer_handle =0

Definiert in Zeile 1933 der Datei wrappers.c.