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     (void)ua; (void)ub; (void)uc; (void)ud; (void)ue; (void)uf;
  23         core_spytask();
  24 }
  25 
  26 /*----------------------------------------------------------------------
  27         CreateTask_spytask
  28 -----------------------------------------------------------------------*/
  29 void CreateTask_spytask()
  30 {
  31         _CreateTask("SpyTask", 0x19, 0x2000, spytask, 0);
  32 }
  33 
  34 ///*----------------------------------------------------------------------
  35 // Pointer to stack location where jogdial task records previous and current
  36 // jogdial positions
  37 short *jog_position;
  38 
  39 #define GREEN_LED       0xC022D1FC
  40 #define AF_LED          0xC022D034
  41 //debug use only
  42 
  43 int debug_blink(int save_R0) {
  44         int i;
  45         *((volatile int *) GREEN_LED) = 0x93d800; // Turn on LED
  46         for (i=0; i<800000; i++) // Wait a while
  47                 {
  48                 asm volatile ( "nop\n" );
  49                 }
  50 
  51         *((volatile int *) GREEN_LED) = 0x83dc00; // Turn off LED
  52         for (i=0; i<800000; i++) // Wait a while
  53                 {
  54                 asm volatile ( "nop\n" );
  55                 }
  56         return save_R0;
  57 };
  58 
  59 void __attribute__((naked,noinline)) my_blinker(int n) {
  60         asm volatile (
  61       "            STMFD   SP!, {R0-R9,LR}\n"
  62 );
  63         int i, j;
  64         for (j=0; j<n; j++)
  65         {
  66                 *((volatile int *) GREEN_LED) = 0x93d800; // Turn on LED
  67                 for (i=0; i<0x200000; i++) { asm volatile ( "nop \n" ); }
  68 
  69                 *((volatile int *) GREEN_LED) = 0x83dc00; // Turn off LED
  70                 for (i=0; i<0x400000; i++) { asm volatile ( "nop \n" ); }
  71         }
  72         for (i=0; i<0x900000; i++) { asm volatile ( "nop \n" ); }
  73         asm volatile (
  74       "            LDMFD   SP!, {R0-R9,PC}\n"
  75         );
  76 }
  77 
  78 /*----------------------------------------------------------------------
  79         boot()
  80 
  81         Main entry point for the CHDK code
  82 -----------------------------------------------------------------------*/

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