root/platform/sx530hs/sub/boot_hdr.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. spytask
  2. CreateTask_spytask
  3. debug_blink
  4. my_blinker

   1 #include "lolevel.h"
   2 #include "platform.h"
   3 #include "core.h"
   4 #include "dryos31.h"
   5 
   6 #define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)
   7 
   8 const char * const new_sa = &_end;
   9 
  10 extern void task_CaptSeq();
  11 extern void task_InitFileModules();
  12 extern void task_RotaryEncoder();
  13 //extern void task_MovieRecord();
  14 extern void task_ExpDrv();
  15 //extern void task_FileWrite();
  16 
  17 /*----------------------------------------------------------------------
  18         spytask
  19 -----------------------------------------------------------------------*/
  20 void spytask(long ua, long ub, long uc, long ud, long ue, long uf)
  21 {
  22         core_spytask();
  23 }
  24 
  25 /*----------------------------------------------------------------------
  26         CreateTask_spytask
  27 -----------------------------------------------------------------------*/
  28 void CreateTask_spytask()
  29 {
  30         _CreateTask("SpyTask", 0x19, 0x2000, spytask, 0);
  31 }
  32 
  33 ///*----------------------------------------------------------------------
  34 // Pointer to stack location where jogdial task records previous and current
  35 // jogdial positions
  36 short *jog_position;
  37 
  38 #define GREEN_LED       0xC022D1FC
  39 #define AF_LED          0xC022D034
  40 //debug use only
  41 
  42 int debug_blink(int save_R0) {
  43         int i;
  44         *((volatile int *) GREEN_LED) = 0x93d800; // Turn on LED
  45         for (i=0; i<800000; i++) // Wait a while
  46                 {
  47                 asm volatile ( "nop\n" );
  48                 }
  49 
  50         *((volatile int *) GREEN_LED) = 0x83dc00; // Turn off LED
  51         for (i=0; i<800000; i++) // Wait a while
  52                 {
  53                 asm volatile ( "nop\n" );
  54                 }
  55         return save_R0;
  56 };
  57 
  58 void __attribute__((naked,noinline)) my_blinker(int n) {
  59         asm volatile (
  60       "            STMFD   SP!, {R0-R9,LR}\n"
  61 );
  62         int i, j;
  63         for (j=0; j<n; j++)
  64         {
  65                 *((volatile int *) GREEN_LED) = 0x93d800; // Turn on LED
  66                 for (i=0; i<0x200000; i++) { asm volatile ( "nop \n" ); }
  67 
  68                 *((volatile int *) GREEN_LED) = 0x83dc00; // Turn off LED
  69                 for (i=0; i<0x400000; i++) { asm volatile ( "nop \n" ); }
  70         }
  71         for (i=0; i<0x900000; i++) { asm volatile ( "nop \n" ); }
  72         asm volatile (
  73       "            LDMFD   SP!, {R0-R9,PC}\n"
  74         );
  75 }
  76 
  77 /*----------------------------------------------------------------------
  78         boot()
  79 
  80         Main entry point for the CHDK code
  81 -----------------------------------------------------------------------*/

/* [<][>][^][v][top][bottom][index][help] */