CHDK_DE Vorschauversion  Trunk Rev. 5229
 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 "stdlib.h"
#include "ptp_chdk.h"
#include "live_view.h"
#include "usb_remote.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 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)
 
double _log (double x)
 
double _log10 (double x)
 
double _pow (double x, double y)
 
double _sqrt (double x)
 
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 (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 ()
 
void dbg_printf (char *fmt,...)
 
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)
 

Variablen

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

Makro-Dokumentation

#define CANON_HEAP_SEM_TIMEOUT   1000

Definiert in Zeile 15 der Datei wrappers.c.

Dokumentation der Funktionen

short __attribute__ ( (weak)  )

Definiert in Zeile 156 der Datei wrappers.c.

157 {
158  // avoid asserts: return 0 if id is above limit
159  if (id >= uiprop_count)
160  return 0;
161  return _PTM_GetCurrentItem(id|0x8000);
162 }
int _CancelHPTimer ( int  )
double _log ( double  x)

Definiert in Zeile 944 der Datei wrappers.c.

944  {
945  return __log(x);
946 }
double _log10 ( double  x)

Definiert in Zeile 948 der Datei wrappers.c.

948  {
949  return __log10(x);
950 }
double _pow ( double  x,
double  y 
)

Definiert in Zeile 952 der Datei wrappers.c.

952  {
953  return __pow(x, y);
954 }
int _SetHPTimerAfterNow ( int  delay,
int(*)(int, int)  good_cb,
int(*)(int, int)  bad_cb,
int   
)
double _sqrt ( double  x)

Definiert in Zeile 956 der Datei wrappers.c.

956  {
957  return __sqrt(x);
958 }
int add_ptp_handler ( int  opcode,
ptp_handler  handler,
int  unknown 
)

Definiert in Zeile 1624 der Datei wrappers.c.

1625 {
1626 #ifdef CAM_CHDK_PTP
1627  return _add_ptp_handler(opcode,handler,unknown);
1628 #else
1629  return 0;
1630 #endif
1631 }
int apex2us ( int  apex_tv)

Definiert in Zeile 1519 der Datei wrappers.c.

1519  {
1520 #if CAM_EXT_TV_RANGE
1521 /*
1522  Extended Tv, by barberofcivil, http://chdk.setepontos.com/index.php/topic,4392.0.html
1523  Explanation by reyalP:
1524  In every port, the original shutter overrides (as opposed to super long exposure) worked by
1525  setting the propcase values at some point after auto-exposure has happened (except in manual
1526  modes, where the manual control propcases may be used instead). The Canon code previously took
1527  these values unchanged for short exposures. In newer cameras, like on the SX10 / SD980, the value
1528  is changed, apparently some time after it has been retrieved from the propcase. We know this is
1529  the case, because the propcase value itself doesn't get clamped to the allowed range (if it did,
1530  barberofcivil's code wouldn't work).
1531 */
1532  short tv;
1533  tv = shooting_get_tv96();
1534  if (tv<-576 || tv!=apex_tv) return 1000000.0*pow(2.0, -tv/96.0);
1535  else return _apex2us(apex_tv);
1536 #else
1537  return 0;
1538 #endif
1539 }
static int ARM_usb_HPtimer_bad ( int  time,
int  interval 
)
static

Definiert in Zeile 1817 der Datei wrappers.c.

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

Definiert in Zeile 1816 der Datei wrappers.c.

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

Definiert in Zeile 1126 der Datei wrappers.c.

1126  {
1127  int i;
1128  _SetAutoShutdownTime(1); // 1 sec
1129  for (i=0;i<200;i++)
1130  _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").
1131 }
int CancelHPTimer ( int  handle)

Definiert in Zeile 1853 der Datei wrappers.c.

1854 {
1855  return _CancelHPTimer(handle);
1856 }
void canon_free ( void *  p)

Definiert in Zeile 984 der Datei wrappers.c.

985 {
986 #if CAM_DRYOS
987  _free(p);
988 #else
990  _free(p);
992  }
993 #endif
994 }
void* canon_malloc ( long  size)

Definiert in Zeile 969 der Datei wrappers.c.

970 {
971 #if CAM_DRYOS
972  return _malloc(size);
973 #else
975  return 0;
976  } else {
977  void *r=_malloc(size);
979  return r;
980  }
981 #endif
982 }
int close ( int  fd)

Definiert in Zeile 457 der Datei wrappers.c.

458 {
459 #if defined(OPT_FILEIO_STATS)
460  camera_info.fileio_stats.close_count++;
461 #endif
462  if (fd == -1)
463  {
464 #if defined(OPT_FILEIO_STATS)
465  camera_info.fileio_stats.close_badfile_count++;
466 #endif
467  return -1;
468  }
469  int haveSemaphore = takeFileIOSemaphore();
470  if (!haveSemaphore)
471 #if defined(CAM_IS_VID_REC_WORKS)
472  if (!conf.allow_unsafe_io)
473 #endif
474  return -1;
475  int r = _Close(fd);
476  if (haveSemaphore)
477  _GiveSemaphore(fileio_semaphore);
478 #if defined(OPT_FILEIO_STATS)
479  if (r == -1)
480  camera_info.fileio_stats.close_fail_count++;
481 #endif
482  return r;
483 }
int CreateBinarySemaphore ( char *  name,
int  init 
)

Definiert in Zeile 1907 der Datei wrappers.c.

1908 {
1909  extern int _CreateBinarySemaphore(char*, int);
1910  return _CreateBinarySemaphore(name, init);
1911 }
int CreateTask ( const char *  name,
int  prio,
int  stack_size,
void *  entry 
)

Definiert in Zeile 1633 der Datei wrappers.c.

1634 {
1635  return _CreateTask(name, prio, stack_size, entry, 0);
1636 }
void dbg_printf ( char *  fmt,
  ... 
)

Definiert in Zeile 1770 der Datei wrappers.c.

1770  {
1771 #ifdef DEBUG_LOGGING
1772  char s[256];
1773  __builtin_va_list va;
1774  __builtin_va_start(va, fmt);
1775  _vsprintf(s, fmt, va);
1776  __builtin_va_end(va);
1777 
1778  // stdout - for use with uart redirection
1779  _ExecuteEventProcedure("Printf",s);
1780  // camera log - will show up in crash dumps, or in stdout on ShowCameraLog
1781  // _LogPrintf(0x120,s);
1782 
1783  // file TODO
1784 #endif
1785 }
void DebugAssert ( char *  err,
int  line 
)

Definiert in Zeile 1896 der Datei wrappers.c.

1897 {
1898 #if CAM_3ARG_DebugAssert
1899  extern void _DebugAssert(int, char*, int);
1900  _DebugAssert(0, err, line);
1901 #else
1902  extern void _DebugAssert(char*, int);
1903  _DebugAssert(err, line);
1904 #endif
1905 }
long dh_err ( )

Definiert in Zeile 1498 der Datei wrappers.c.

1499 {
1500  return -1;
1501 }
void disable_shutdown ( )

Definiert in Zeile 1112 der Datei wrappers.c.

1112  {
1113  if (!shutdown_disabled) {
1114  _LockMainPower();
1115  shutdown_disabled = 1;
1116  }
1117 }
void DoAELock ( void  )

Definiert in Zeile 1167 der Datei wrappers.c.

1168 {
1170  {
1171  _DoAELock();
1172  }
1173 }
void DoAFLock ( void  )

Definiert in Zeile 1183 der Datei wrappers.c.

1184 {
1186  {
1187  int af_lock=1;
1188  _DoAFLock();
1189  set_property_case(PROPCASE_AF_LOCK,&af_lock,sizeof(af_lock));
1190  }
1191 }
void drv_self_hide ( void  )

Definiert in Zeile 1504 der Datei wrappers.c.

1505 {
1506  long drvnum;
1507 
1509  if (drvnum >= 0)
1510  _iosDevAdd(drv_struct, "A/DISKBOOT.BIN", drvnum);
1511 }
void drv_self_unhide ( void  )

Definiert in Zeile 1513 der Datei wrappers.c.

1514 {
1516 }
void enable_shutdown ( )

Definiert in Zeile 1119 der Datei wrappers.c.

1119  {
1120  if (shutdown_disabled) {
1121  _UnlockMainPower();
1122  shutdown_disabled = 0;
1123  }
1124 }
int EngDrvRead ( int  gpio_reg)

Definiert in Zeile 1203 der Datei wrappers.c.

1204 {
1205  return _EngDrvRead(gpio_reg);
1206 }
void EnterToCompensationEVF ( void  )

Definiert in Zeile 1133 der Datei wrappers.c.

1134 {
1136 }
int errnoOfTaskGet ( int  tid)

Definiert in Zeile 797 der Datei wrappers.c.

797  {
798 #if !CAM_DRYOS
799  return _errnoOfTaskGet(tid);
800 #else
801  return 0;
802 #endif
803 }
void ExitFromCompensationEVF ( void  )

Definiert in Zeile 1138 der Datei wrappers.c.

1139 {
1141 }
void ExitTask ( )

Definiert in Zeile 1638 der Datei wrappers.c.

1639 {
1640  _ExitTask();
1641 }
long fclose ( FILE f)

Definiert in Zeile 755 der Datei wrappers.c.

755  {
756  return _Fclose_Fut((long)f);
757 }
long feof ( FILE file)

Definiert in Zeile 771 der Datei wrappers.c.

771  {
772  return _Feof_Fut((long)file);
773 }
long fflush ( FILE file)

Definiert in Zeile 775 der Datei wrappers.c.

775  {
776  return _Fflush_Fut((long)file);
777 }
char* fgets ( char *  buf,
int  n,
FILE f 
)

Definiert in Zeile 779 der Datei wrappers.c.

779  {
780  return _Fgets_Fut(buf,n,(int)f);
781 }
FILE* fopen ( const char *  filename,
const char *  mode 
)

Definiert in Zeile 740 der Datei wrappers.c.

740  {
741 #ifdef CAM_DRYOS
742  if(!filename || filename[0]!='A') {
743  return NULL;
744  }
745 #endif
746 
747  // Check fileio semaphore, if not available we are probably recording video
748  if (!takeFileIOSemaphore())
749  return NULL;
750  _GiveSemaphore(fileio_semaphore);
751 
752  return (FILE *)_Fopen_Fut(filename,mode);
753 }
long fread ( void *  buf,
long  elsize,
long  count,
FILE f 
)

Definiert in Zeile 759 der Datei wrappers.c.

759  {
760  return _Fread_Fut(buf,elsize,count,(long)f);
761 }
long fseek ( FILE file,
long  offset,
long  whence 
)

Definiert in Zeile 767 der Datei wrappers.c.

767  {
768  return _Fseek_Fut((long)file,offset,whence);
769 }
int fw_closedir ( void *  d)

Definiert in Zeile 556 der Datei wrappers.c.

557 {
558  int have_semaphore = takeFileIOSemaphore();
559  if (!have_semaphore)
560 #if defined(CAM_IS_VID_REC_WORKS)
561  if (!conf.allow_unsafe_io)
562 #endif
563  return -1;
564 
565  extern int _closedir(void *d);
566  int ret = _closedir(d);
567 
568  if (have_semaphore)
569  _GiveSemaphore(fileio_semaphore);
570 
571  return ret;
572 }
void* fw_opendir ( const char *  name)

Definiert in Zeile 614 der Datei wrappers.c.

615  {
616  void *ret;
617  int have_semaphore = takeFileIOSemaphore();
618  if (!have_semaphore)
619 #if defined(CAM_IS_VID_REC_WORKS)
620  if (!conf.allow_unsafe_io)
621 #endif
622  return NULL;
623 
624  extern void *_opendir(const char* name);
625  ret = _opendir(name);
626 
627  if (have_semaphore)
628  _GiveSemaphore(fileio_semaphore);
629 
630  return ret;
631  }
void* fw_readdir ( void *  d)

Definiert in Zeile 633 der Datei wrappers.c.

634  {
635  extern void *_readdir(void *d);
636  return _readdir(d);
637  }
long fwrite ( const void *  buf,
long  elsize,
long  count,
FILE f 
)

Definiert in Zeile 763 der Datei wrappers.c.

763  {
764  return _Fwrite_Fut(buf,elsize,count,(long)f);
765 }
unsigned char get_active_partition ( void  )

Definiert in Zeile 1402 der Datei wrappers.c.

1402 { return 1; }
int get_battery_temp ( )

Definiert in Zeile 307 der Datei wrappers.c.

308 {
309  return _GetBatteryTemperature();
310 }
int get_ccd_temp ( )

Definiert in Zeile 312 der Datei wrappers.c.

313 {
314  return _GetCCDTemperature();
315 }
int get_optical_temp ( )

Definiert in Zeile 317 der Datei wrappers.c.

318 {
319  return _GetOpticalTemperature();
320 }
long get_parameter_data ( long  id,
void *  buf,
long  bufsize 
)

Definiert in Zeile 146 der Datei wrappers.c.

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

Definiert in Zeile 136 der Datei wrappers.c.

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

Definiert in Zeile 1400 der Datei wrappers.c.

1400 { return 1; }
int get_part_type ( void  )

Definiert in Zeile 1401 der Datei wrappers.c.

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

Definiert in Zeile 74 der Datei wrappers.c.

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

Definiert in Zeile 322 der Datei wrappers.c.

323 {
324 long t;
325 #if !CAM_DRYOS
326  _GetSystemTime(&t);
327  return t;
328 #else
329  return (int)_GetSystemTime(&t);
330 #endif
331 }
unsigned int GetFreeCardSpaceKb ( void  )

Definiert in Zeile 787 der Datei wrappers.c.

787  {
788  return (_GetDrive_FreeClusters(0)*(_GetDrive_ClusterSize(0)>>9))>>1;
789 }
void GetMemInfo ( cam_meminfo camera_meminfo)

Definiert in Zeile 1041 der Datei wrappers.c.

1042 {
1043 // Use firmware GetMemInfo function to retrieve info about Canon heap memory allocation
1044 
1045 #if defined(CAM_DRYOS)
1046  // Prior to dryos R39 GetMemInfo returns 9 values, after R39 it returns 10 (all but 1 are used in each case)
1047  int fw_info[10];
1048  extern void _GetMemInfo(int*);
1049  _GetMemInfo(fw_info);
1050 
1051 #if defined(CAM_DRYOS_2_3_R39)
1052  // For newer dryos version copy all 9 used values to CHDK structure
1053  camera_meminfo->start_address = fw_info[0];
1054  camera_meminfo->end_address = fw_info[1];
1055  camera_meminfo->total_size = fw_info[2];
1056  camera_meminfo->allocated_size = fw_info[3];
1057  camera_meminfo->allocated_peak = fw_info[4];
1058  camera_meminfo->allocated_count = fw_info[5];
1059  camera_meminfo->free_size = fw_info[6];
1060  camera_meminfo->free_block_max_size = fw_info[7];
1061  camera_meminfo->free_block_count = fw_info[8];
1062 #else
1063  // For older dryos version copy 8 used values to CHDK structure and calculate missing value
1064  camera_meminfo->start_address = fw_info[0];
1065  camera_meminfo->end_address = fw_info[0] + fw_info[1];
1066  camera_meminfo->total_size = fw_info[1];
1067  camera_meminfo->allocated_size = fw_info[2];
1068  camera_meminfo->allocated_peak = fw_info[3];
1069  camera_meminfo->allocated_count = fw_info[4];
1070  camera_meminfo->free_size = fw_info[5];
1071  camera_meminfo->free_block_max_size = fw_info[6];
1072  camera_meminfo->free_block_count = fw_info[7];
1073 #endif
1074 #else // vxworks
1075 extern int sys_mempart_id;
1076  int fw_info[5];
1077  // -1 for invalid
1078  memset(camera_meminfo,0xFF,sizeof(cam_meminfo));
1080 #ifdef CAM_NO_MEMPARTINFO
1081  camera_meminfo->free_block_max_size = _memPartFindMax(sys_mempart_id);
1082 #else
1083  _memPartInfoGet(sys_mempart_id,fw_info);
1084  // TODO we could fill in start address from _start + MEMISOSIZE, if chdk not in exmem
1085  // these are guessed, look reasonable on a540
1086  camera_meminfo->free_size = fw_info[0];
1087  camera_meminfo->free_block_count = fw_info[1];
1088  camera_meminfo->free_block_max_size = fw_info[2];
1089  camera_meminfo->allocated_size = fw_info[3];
1090  camera_meminfo->allocated_count = fw_info[4];
1091 #endif
1093  }
1094 #endif
1095 }
unsigned int GetTotalCardSpaceKb ( void  )

Definiert in Zeile 791 der Datei wrappers.c.

791  {
792  return (_GetDrive_TotalClusters(0)*(_GetDrive_ClusterSize(0)>>9))>>1;
793 }
void GiveSemaphore ( int  sem)

Definiert in Zeile 1918 der Datei wrappers.c.

1919 {
1920  _GiveSemaphore(sem);
1921 }
void gui_set_need_restore ( )

Definiert in Zeile 2409 der Datei gui.c.

2410 {
2412 }
int is_partition_changed ( void  )

Definiert in Zeile 1403 der Datei wrappers.c.

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

Definiert in Zeile 26 der Datei wrappers.c.

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

Definiert in Zeile 24 der Datei wrappers.c.

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

Definiert in Zeile 28 der Datei wrappers.c.

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

Definiert in Zeile 29 der Datei wrappers.c.

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

Definiert in Zeile 25 der Datei wrappers.c.

25 { return _isspace(c); }
long IsStrobeChargeCompleted ( )

Definiert in Zeile 366 der Datei wrappers.c.

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

Definiert in Zeile 27 der Datei wrappers.c.

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

Definiert in Zeile 30 der Datei wrappers.c.

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

Definiert in Zeile 187 der Datei wrappers.c.

188 {
189  return _GetZoomLensCurrentPoint();
190 }
long lens_get_zoom_pos ( )

Definiert in Zeile 182 der Datei wrappers.c.

183 {
185 }
void lens_set_focus_pos ( long  newpos)

Definiert in Zeile 260 der Datei wrappers.c.

261 {
262  if (newpos >= CAMERA_MAX_DIST) newpos = INFINITY_DIST; // Set to infinity value that will work on all cameras
263  _MoveFocusLensToDistance((short*)&newpos);
264  while ((shooting_is_flash_ready()!=1) || (focus_busy)) msleep(10);
265  newpos = _GetFocusLensSubjectDistance();
266  _SetPropertyCase(PROPCASE_SUBJECT_DIST1, &newpos, sizeof(newpos));
267  _SetPropertyCase(PROPCASE_SUBJECT_DIST2, &newpos, sizeof(newpos));
268 }
void lens_set_zoom_point ( long  newpt)

Definiert in Zeile 192 der Datei wrappers.c.

193 {
194  if (newpt < 0) {
195  newpt = 0;
196  } else if (newpt >= zoom_points) {
197  newpt = zoom_points-1;
198  }
199 
200 #if defined(CAM_USE_ALT_SET_ZOOM_POINT)
201 
202  if (lens_get_zoom_point() != newpt)
203  {
204  int digizoom_pos;
205  get_property_case(PROPCASE_DIGITAL_ZOOM_POSITION,&digizoom_pos,sizeof(digizoom_pos));
206  // check current digital zoom mode & state
207  // state == 1 && mode == 0 --> Digital Zoom Standard
208  if ((shooting_get_digital_zoom_state() == 1) && (shooting_get_digital_zoom_mode() == 0) && (digizoom_pos != 0))
209  {
210  // reset digital zoom in case camera is in this zoom range
211  extern void _PT_MoveDigitalZoomToWide();
212  _PT_MoveDigitalZoomToWide();
213  }
214 
215  #if defined(CAM_USE_ALT_PT_MoveOpticalZoomAt)
216  // SX30 - _MoveZoomLensWithPoint crashes camera
217  // _PT_MoveOpticalZoomAt works, and updates PROPCASE_OPTICAL_ZOOM_POSITION; but doesn't wait for zoom to finish
218  // IXUS220, SX220/230 - _MoveZoomLensWithPoint does not notify the JPEG engine of the new focal length,
219  // causing incorrect lens distortion fixes to be applied; _PT_MoveOpticalZoomAt works
220  extern void _PT_MoveOpticalZoomAt(long*);
221  _PT_MoveOpticalZoomAt(&newpt);
222  #else
223  _MoveZoomLensWithPoint((short*)&newpt);
224  #endif
225 
226  // have to sleep here, zoom_busy set in another task, without sleep this will hang
227  while (zoom_busy) msleep(10);
228 
229  // g10,g12 & sx30 only use this value for optical zoom
231 
232  #if !defined(CAM_USE_ALT_PT_MoveOpticalZoomAt)
233  _SetPropertyCase(PROPCASE_OPTICAL_ZOOM_POSITION, &newpt, sizeof(newpt));
234  #endif
235  }
236 #else // !(CAM_USE_ALT_SET_ZOOM_POINT)
237  _MoveZoomLensWithPoint((short*)&newpt);
238 
239  // tight loop here hangs some cameras (the task that clears zoom_busy
240  // is starved; seen at least on S95 and IXUS 220), so stick in a sleep
241  while (zoom_busy) msleep(10);
242 
243  if (newpt==0) zoom_status=ZOOM_OPTICAL_MIN;
244  else if (newpt >= zoom_points) zoom_status=ZOOM_OPTICAL_MAX;
246  _SetPropertyCase(PROPCASE_OPTICAL_ZOOM_POSITION, &newpt, sizeof(newpt));
247 #endif // !(CAM_USE_ALT_SET_ZOOM_POINT)
248 }
void lens_set_zoom_speed ( long  newspd)

Definiert in Zeile 250 der Datei wrappers.c.

251 {
252  if (newspd < 5) {
253  newspd = 5;
254  } else if (newspd > 100) {
255  newspd = 100;
256  }
257  _SetZoomActuatorSpeedPercent((short*)&newspd);
258 }
struct tm* localtime ( const time_t _tod)

Definiert in Zeile 914 der Datei wrappers.c.

914  {
915 #if !CAM_DRYOS
916  return _localtime(_tod);
917 #else
918  // for DRYOS cameras do something with this! - sizeof(x[]) must be >= sizeof(struct tm) : 'static int x[9];'
919  static int x[10];
920  return _LocalTime(_tod, &x);
921 #endif
922 }
int lseek ( int  fd,
long  offset,
int  whence 
)

Definiert in Zeile 511 der Datei wrappers.c.

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

Definiert in Zeile 164 der Datei wrappers.c.

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

Definiert in Zeile 1034 der Datei wrappers.c.

1034  {
1035  return _memchr(s,c,n);
1036 }
int memcmp ( const void *  s1,
const void *  s2,
long  n 
)

Definiert in Zeile 1029 der Datei wrappers.c.

1029  {
1030  return _memcmp(s1, s2, n);
1031 }
void* memcpy ( void *  dest,
const void *  src,
long  n 
)

Definiert in Zeile 1021 der Datei wrappers.c.

1021  {
1022  return _memcpy(dest, src, n);
1023 }
void* memset ( void *  s,
int  c,
int  n 
)

Definiert in Zeile 1025 der Datei wrappers.c.

1025  {
1026  return _memset(s, c, n);
1027 }
long mkdir ( const char *  dirname)

Definiert in Zeile 516 der Datei wrappers.c.

517 {
518 #ifdef MKDIR_RETURN_ONE_ON_SUCCESS
519  // mkdir returns 1 on success, 0 on fail. So, values are inverted, to be compatible with previous versions
520  if(_MakeDirectory_Fut(dirname,1)) return 0;
521  else return 1;
522 #else
523  return _MakeDirectory_Fut(dirname,-1); // meaning of second arg is not clear, firmware seems to use -1
524 #endif
525 }
long mkdir_if_not_exist ( const char *  dirname)

Definiert in Zeile 527 der Datei wrappers.c.

528 {
529  // Check if directory exists and create it if it does not.
530  if (stat(dirname,0) != 0) return mkdir(dirname);
531  return 0; // Success
532 }
time_t mktime ( struct tm timp)

Definiert in Zeile 928 der Datei wrappers.c.

928  {
929 #if !CAM_DRYOS
930  return _mktime(timp);
931 #else
932  int timp_ext[10]; // struct tm + a ptr
933  _memcpy(timp_ext,timp,9*sizeof(int));
934  timp_ext[9]=0;
935  long retval = _mktime_ext(&timp_ext);
936  _memcpy(timp,timp_ext,9*sizeof(int));
937  return retval;
938 #endif
939 }
void msleep ( long  msec)

Definiert in Zeile 47 der Datei wrappers.c.

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

Definiert in Zeile 1407 der Datei wrappers.c.

1407  {
1408  static int old_busy=0;
1409  int busy=zoom_busy||focus_busy;
1410  if (old_busy!=busy) {
1411  if (busy) {
1412 #if CAM_CAN_MUTE_MICROPHONE
1413  if (conf.mute_on_zoom) _TurnOffMic();
1414 #endif
1415  }
1416  else {
1417 #if CAM_CAN_MUTE_MICROPHONE
1418  if (conf.mute_on_zoom) _TurnOnMic();
1419 #endif
1420 #if CAM_EV_IN_VIDEO
1422 #endif
1423  }
1424  old_busy=busy;
1425  }
1426  return x; // preserve R0 if called from assembler
1427 }
int open ( const char *  name,
int  flags,
int  mode 
)

Definiert in Zeile 428 der Datei wrappers.c.

429 {
430 #if defined(OPT_FILEIO_STATS)
431  camera_info.fileio_stats.open_count++;
432 #endif
433 #if !CAM_DRYOS
434  // Adjust O_TRUNC and O_CREAT flags for VxWorks
435  // Remove O_APPEND flag if present (not in VxWorks)
436  flags = (flags & ~(O_TRUNC|O_CREAT|O_APPEND)) | ((flags & (O_TRUNC|O_CREAT)) << 1);
437 #else
438  if(!name || name[0]!='A')
439  return -1;
440 #endif
441  int haveSemaphore = takeFileIOSemaphore();
442  if (!haveSemaphore)
443 #if defined(CAM_IS_VID_REC_WORKS)
444  if (!conf.allow_unsafe_io)
445 #endif
446  return -1;
447  int fd = _Open(name, flags, mode);
448  if (haveSemaphore)
449  _GiveSemaphore(fileio_semaphore);
450 #if defined(OPT_FILEIO_STATS)
451  if (fd == -1)
452  camera_info.fileio_stats.open_fail_count++;
453 #endif
454  return fd;
455 }
void play_sound ( unsigned  sound)

Definiert in Zeile 270 der Datei wrappers.c.

271 {
272  static const int sounds[]={ 0x2001, //startup sound
273  0x2002, //shutter sound
274  0x2003, //button press sound
275  0x2004, //self-timer sound
276  0xC211, //short beep
277  50000, // AF confirmation
278  0xC507, // error beep imo
279  0x400D, // LONG ERROR BEEP CONTINIUOUS- warning, cannot be stopped (yet)
280  };
281  if(sound >= sizeof(sounds)/sizeof(sounds[0]))
282  return;
283 
284  _PT_PlaySound(sounds[sound], 0);
285 }
void PostLogicalEventForNotPowerType ( unsigned  id,
unsigned  x 
)

Definiert in Zeile 1541 der Datei wrappers.c.

1541  {
1543 }
void PostLogicalEventToUI ( unsigned  id,
unsigned  x 
)

Definiert in Zeile 1545 der Datei wrappers.c.

1545  {
1547 }
void qsort ( void *  __base,
int  __nelem,
int  __size,
int(*)(const void *__e1, const void *__e2)  __cmp 
)

Definiert in Zeile 1107 der Datei wrappers.c.

1107  {
1108  _qsort(__base, __nelem, __size, __cmp);
1109 }
int rand ( void  )

Definiert in Zeile 1099 der Datei wrappers.c.

1099  {
1100  return _rand();
1101 }
int read ( int  fd,
void *  buffer,
long  nbytes 
)

Definiert in Zeile 506 der Datei wrappers.c.

507 {
508  return _Read(fd, buffer, nbytes);
509 }
int remove ( const char *  name)

Definiert in Zeile 534 der Datei wrappers.c.

535 {
536 #ifdef CAM_DRYOS_2_3_R39
537  // For DryOS R39 and later need to check if 'name' is a file or directory
538  // and call appropriate delete function.
539  struct stat st;
540  if (stat(name,&st) == 0)
541  {
542  if (st.st_attrib & DOS_ATTR_DIRECTORY)
543  return _DeleteDirectory_Fut(name);
544  else
545  return _DeleteFile_Fut(name);
546  }
547  return -1; // return fail - file / directory does not exist
548 #else
549  return _DeleteFile_Fut(name);
550 #endif
551 }
int rename ( const char *  oldname,
const char *  newname 
)

Definiert in Zeile 783 der Datei wrappers.c.

783  {
784  return _RenameFile_Fut(oldname, newname);
785 }
long set_parameter_data ( long  id,
void *  buf,
long  bufsize 
)

Definiert in Zeile 151 der Datei wrappers.c.

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

Definiert in Zeile 95 der Datei wrappers.c.

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

Definiert in Zeile 367 der Datei wrappers.c.

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

Definiert in Zeile 1695 der Datei wrappers.c.

1696 {
1697 #ifdef CAM_DRYOS_2_3_R39
1698  return _SetFileAttributes(fn, attr);
1699 #else
1700  int fd;
1701  unsigned char ret = -1;
1702 
1703  fd = open(fn, 0, 0);
1704  if( fd ) {
1705  _SetFileAttributes(fd, attr);
1706  close(fd);
1707  ret = attr;
1708  }
1709  return ret;
1710 #endif
1711 }
int SetHPTimerAfterNow ( int  delay,
int(*)(int, int)  good_cb,
int(*)(int, int)  bad_cb,
int  param 
)

Definiert in Zeile 1848 der Datei wrappers.c.

1849 {
1850  return _SetHPTimerAfterNow(delay,good_cb,bad_cb,param);
1851 }
void SetLogicalEventActive ( unsigned  id,
unsigned  state 
)

Definiert in Zeile 1549 der Datei wrappers.c.

1549  {
1550  _SetLogicalEventActive(id, state);
1551 }
void SetScriptMode ( unsigned  mode)

Definiert in Zeile 1553 der Datei wrappers.c.

1553  {
1555 }
long shooting_get_current_av96 ( )

Definiert in Zeile 364 der Datei wrappers.c.

364 { return _GetCurrentAvValue(); }
long shooting_get_current_tv96 ( )

Definiert in Zeile 356 der Datei wrappers.c.

357 {
358  // old cameras crash if _GetCurrentShutterSpeed called when inactive
360  return SHOOTING_TV96_INVALID;
361  }
362  return _GetCurrentShutterSpeed();
363 }
short shooting_get_nd_current_ev96 ( void  )

Definiert in Zeile 347 der Datei wrappers.c.

348 {
349 #if CAM_HAS_ND_FILTER
350  return _get_current_nd_value();
351 #else
352  return 0;
353 #endif
354 }
short shooting_get_nd_value_ev96 ( void  )

Definiert in Zeile 338 der Datei wrappers.c.

339 {
340 #if CAM_HAS_ND_FILTER
341  return _get_nd_value();
342 #else
343  return 0;
344 #endif
345 }
long sprintf ( char *  s,
const char *  st,
  ... 
)

Definiert in Zeile 861 der Datei wrappers.c.

862 {
863  long res;
864  __builtin_va_list va;
865  __builtin_va_start(va, st);
866  res = _vsprintf(s, st, va);
867  __builtin_va_end(va);
868  return res;
869 }
void* srand ( unsigned int  seed)

Definiert in Zeile 1103 der Datei wrappers.c.

1103  {
1104  return _srand(seed);
1105 }
int start_usb_HPtimer ( int  interval)

Definiert in Zeile 1819 der Datei wrappers.c.

1820 {
1821 #ifdef CAM_REMOTE_USB_HIGHSPEED
1822 
1823  if ( usb_HPtimer_handle == 0 )
1824  {
1827  if (!(usb_HPtimer_handle & 0x01)) return 1 ;
1828  usb_HPtimer_handle = 0 ;
1829  }
1830 #endif
1831  return 0;
1832 }
int stat ( const char *  name,
struct stat pStat 
)

Definiert in Zeile 714 der Datei wrappers.c.

715 {
716  // sanity check. canon firmware hangup if start not from 'A/'
717  if ( !name || (name[0] | 0x20)!='a' || name[1]!='/' ) return 1;
718 
719  // use temp __stat stucture to match camera firmware
720  // and copy values across to output
721  struct __stat lStat;
722  int rv = _stat(name, &lStat);
723  if (pStat)
724  {
725  if (rv == 0)
726  {
727  pStat->st_attrib = lStat.st_attrib;
728  pStat->st_size = lStat.st_size;
729  pStat->st_ctime = lStat.st_ctime;
730  pStat->st_mtime = lStat.st_mtime;
731  }
732  else
733  {
734  memset( pStat, 0, sizeof(struct stat));
735  }
736  }
737  return rv;
738 }
long stat_get_vbatt ( )

Definiert in Zeile 287 der Datei wrappers.c.

288 {
289  return _VbattGet();
290 }
int stop_usb_HPtimer ( )

Definiert in Zeile 1834 der Datei wrappers.c.

1835 {
1836 #ifdef CAM_REMOTE_USB_HIGHSPEED
1837  if( usb_HPtimer_handle )
1838  {
1840  usb_HPtimer_handle = 0 ;
1841  return 1 ;
1842  }
1843 #endif
1844  return 0;
1845 }
char* strcat ( char *  dest,
const char *  app 
)

Definiert in Zeile 832 der Datei wrappers.c.

832  {
833  return _strcat(dest, app);
834 }
char* strchr ( const char *  s,
int  c 
)

Definiert in Zeile 820 der Datei wrappers.c.

820  {
821  return _strchr(s, c);
822 }
int strcmp ( const char *  s1,
const char *  s2 
)

Definiert in Zeile 812 der Datei wrappers.c.

812  {
813  return _strcmp(s1, s2);
814 }
char* strcpy ( char *  dest,
const char *  src 
)

Definiert in Zeile 824 der Datei wrappers.c.

824  {
825  return _strcpy(dest, src);
826 }
const char* strerror ( int  en)

Definiert in Zeile 873 der Datei wrappers.c.

873  {
874 #if !CAM_DRYOS
875  static char msg[20];
876  sprintf(msg,"errno 0x%X",en);
877  return msg;
878 #else
879  return "error";
880 #endif
881 }
long strftime ( char *  s,
unsigned long  maxsize,
const char *  format,
const struct tm timp 
)

Definiert in Zeile 924 der Datei wrappers.c.

924  {
925  return _strftime(s,maxsize,format,timp);
926 }
long strlen ( const char *  s)

Definiert in Zeile 808 der Datei wrappers.c.

808  {
809  return _strlen(s);
810 }
int strncmp ( const char *  s1,
const char *  s2,
long  n 
)

Definiert in Zeile 816 der Datei wrappers.c.

816  {
817  return _strncmp(s1, s2, n);
818 }
char* strncpy ( char *  dest,
const char *  src,
long  n 
)

Definiert in Zeile 828 der Datei wrappers.c.

828  {
829  return _strncpy(dest, src, n);
830 }
char* strpbrk ( const char *  s,
const char *  accept 
)

Definiert in Zeile 853 der Datei wrappers.c.

854 {
855  return _strpbrk(s, accept);
856 }
char* strrchr ( const char *  s,
int  c 
)

Definiert in Zeile 836 der Datei wrappers.c.

836  {
837  return _strrchr(s, c);
838 }
long strtol ( const char *  nptr,
char **  endptr,
int  base 
)

Definiert in Zeile 840 der Datei wrappers.c.

840  {
841  return _strtol(nptr, endptr, base);
842 }
unsigned long strtoul ( const char *  nptr,
char **  endptr,
int  base 
)

Definiert in Zeile 844 der Datei wrappers.c.

844  {
845 #if CAM_DRYOS
846  return (unsigned long)_strtolx(nptr, endptr, base, 0);
847 #else
848  return _strtoul(nptr, endptr, base);
849 #endif
850 }
int submenu_sort_arm ( const void *  v1,
const void *  v2 
)

Definiert in Zeile 39 der Datei wrappers.c.

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

Definiert in Zeile 1399 der Datei wrappers.c.

1399 { return 0; }
int takeFileIOSemaphore ( )

Definiert in Zeile 402 der Datei wrappers.c.

403 {
404  int timeout = CAM_FILEIO_SEM_TIMEOUT;
405 #if defined(CAM_IS_VID_REC_WORKS)
406  if (is_video_recording())
407  timeout = CAM_FILEIO_SEM_TIMEOUT_VID;
408 #endif
409 #if defined(OPT_FILEIO_STATS)
410  int t = get_tick_count();
411 #endif
412  // Check fileio semaphore with timeout, if not available we are probably recording video
413  if (_TakeSemaphore(fileio_semaphore,timeout) & 1)
414  {
415 #if defined(OPT_FILEIO_STATS)
416  camera_info.fileio_stats.fileio_semaphore_errors++;
417 #endif
418  return 0;
419  }
420 #if defined(OPT_FILEIO_STATS)
421  t = get_tick_count() - t;
422  if (t > camera_info.fileio_stats.max_semaphore_timeout)
423  camera_info.fileio_stats.max_semaphore_timeout = t;
424 #endif
425  return 1;
426 }
int TakeSemaphore ( int  sem,
int  timeout 
)

Definiert in Zeile 1913 der Datei wrappers.c.

1914 {
1915  return _TakeSemaphore(sem, timeout);
1916 }
int task_id_list_get ( int *  idlist,
int  size 
)

Definiert in Zeile 68 der Datei wrappers.c.

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

Definiert in Zeile 53 der Datei wrappers.c.

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

Definiert in Zeile 63 der Datei wrappers.c.

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

Definiert in Zeile 58 der Datei wrappers.c.

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

Definiert in Zeile 886 der Datei wrappers.c.

886  {
887  return _time(timer);
888 }
int tolower ( int  c)

Definiert in Zeile 32 der Datei wrappers.c.

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

Definiert in Zeile 33 der Datei wrappers.c.

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

Definiert in Zeile 1148 der Datei wrappers.c.

1149 {
1151 }
void TurnOffDisplay ( void  )

Definiert in Zeile 1162 der Datei wrappers.c.

1163 {
1164  _TurnOffDisplay();
1165 }
void TurnOnBackLight ( void  )

Definiert in Zeile 1143 der Datei wrappers.c.

1144 {
1145  _TurnOnBackLight();
1146 }
void TurnOnDisplay ( void  )

Definiert in Zeile 1155 der Datei wrappers.c.

1156 {
1157  _TurnOnDisplay();
1158  // required to re-draw the canon and CHDK UI after re-enabling display
1160 }
void ufree ( void *  p)

Definiert in Zeile 1010 der Datei wrappers.c.

1010  {
1011 #if CAM_DRYOS
1013 #else
1017  }
1018 #endif
1019 }
void* umalloc ( long  size)

Definiert in Zeile 996 der Datei wrappers.c.

996  {
997 #if CAM_DRYOS
998  return _AllocateUncacheableMemory(size);
999 #else
1001  return 0;
1002  } else {
1003  void *r=_AllocateUncacheableMemory(size);
1005  return r;
1006  }
1007 #endif
1008 }
void UnlockAE ( void  )

Definiert in Zeile 1175 der Datei wrappers.c.

1176 {
1178  {
1179  _UnlockAE();
1180  }
1181 }
void UnlockAF ( void  )

Definiert in Zeile 1193 der Datei wrappers.c.

1194 {
1196  {
1197  int af_lock=0;
1198  _UnlockAF();
1199  set_property_case(PROPCASE_AF_LOCK,&af_lock,sizeof(af_lock));
1200  }
1201 }
int usb_HPtimer_bad ( int  ,
int   
)

Definiert in Zeile 305 der Datei usb_remote.c.

306 {
308  return (usb_HPtimer_good(time, interval));
309 }
int usb_HPtimer_good ( int  ,
int   
)

Definiert in Zeile 297 der Datei usb_remote.c.

298 {
301  usb_remote_key() ;
302  return 0;
303 }
int utime ( const char *  file,
struct utimbuf newTimes 
)

Definiert in Zeile 890 der Datei wrappers.c.

890  {
891 #if !CAM_DRYOS
892  return _utime(file, newTimes);
893 #else
894  int res=0;
895  int fd;
896  fd = _open(file, 0, 0);
897 
898 #ifdef CAM_DRYOS_2_3_R39
899  if (fd>=0) {
900  _close(fd);
901  res=_SetFileTimeStamp(file, newTimes->modtime, newTimes->actime);
902  }
903 #else
904  if (fd>=0) {
905  res=_SetFileTimeStamp(fd, newTimes->modtime, newTimes->actime);
906  _close(fd);
907  }
908  // return value compatibe with utime: ok=0 fail=-1
909 #endif
910  return (res)?0:-1;
911 #endif
912 }
void* vid_get_viewport_active_buffer ( )

Definiert in Zeile 1747 der Datei wrappers.c.

1748 {
1749  void *p;
1750 
1752  {
1753  p = vid_get_viewport_fb_d();
1754  } else {
1756  if ( !p )
1757  {
1758  p = vid_get_viewport_fb();
1759  }
1760  }
1761 
1762  return p;
1763 }
int vid_get_viewport_type ( )

Definiert in Zeile 1595 der Datei wrappers.c.

1595  {
1596  return LV_FB_YUV8;
1597 }
int write ( int  fd,
const void *  buffer,
long  nbytes 
)

Definiert in Zeile 485 der Datei wrappers.c.

486 {
487  if (fd == -1)
488  {
489 #if defined(OPT_FILEIO_STATS)
490  camera_info.fileio_stats.write_badfile_count++;
491 #endif
492  return -1;
493  }
494  int haveSemaphore = takeFileIOSemaphore();
495  if (!haveSemaphore)
496 #if defined(CAM_IS_VID_REC_WORKS)
497  if (!conf.allow_unsafe_io)
498 #endif
499  return -1;
500  int r = _Write(fd, buffer, nbytes);
501  if (haveSemaphore)
502  _GiveSemaphore(fileio_semaphore);
503  return r;
504 }

Variablen-Dokumentation

int canon_heap_sem

Definiert in Zeile 230 der Datei memmgmt.c.

long drv_struct[16]
static

Definiert in Zeile 1495 der Datei wrappers.c.

int fileio_semaphore
int shutdown_disabled = 0
static

Definiert in Zeile 1111 der Datei wrappers.c.

int usb_HPtimer_error_count =0

Definiert in Zeile 1814 der Datei wrappers.c.

int usb_HPtimer_handle =0

Definiert in Zeile 1813 der Datei wrappers.c.