root/platform/sx510hs/sub/boot_hdr.c

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

DEFINITIONS

This source file includes following definitions.
  1. CreateTask_spytask
  2. debug_blink
  3. 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 /*----------------------------------------------------------------------
  11     CreateTask_spytask
  12 -----------------------------------------------------------------------*/
  13 void CreateTask_spytask()
  14 {
  15     _CreateTask("SpyTask", 0x19, 0x2000, core_spytask, 0);
  16 }
  17 
  18 ///*----------------------------------------------------------------------
  19 // Pointer to stack location where jogdial task records previous and current
  20 // jogdial positions
  21 short *jog_position;
  22 
  23 
  24 #define GREEN_LED       0xC0220120
  25 #define AF_LED          0xC0223030
  26 //debug use only
  27 
  28 int debug_blink(int save_R0) {
  29         int i;
  30         *((volatile int *) AF_LED) = 0x46; // Turn on LED
  31         for (i=0; i<800000; i++) // Wait a while
  32                 {
  33                 asm volatile ( "nop\n" );
  34                 }
  35 
  36         *((volatile int *) AF_LED) = 0x44; // Turn off LED
  37         for (i=0; i<800000; i++) // Wait a while
  38                 {
  39                 asm volatile ( "nop\n" );
  40                 }
  41         return save_R0;
  42 };
  43 
  44 void __attribute__((naked,noinline)) my_blinker(int n) {
  45         asm volatile (
  46       "            STMFD   SP!, {R0-R9,LR}\n"
  47 );
  48         int i, j;
  49         for (j=0; j<n; j++)
  50         {
  51                 *((volatile int *) GREEN_LED) = 0x46; // Turn on LED
  52                 for (i=0; i<0x200000; i++) { asm volatile ( "nop \n" ); }
  53 
  54                 *((volatile int *) GREEN_LED) = 0x44; // Turn off LED
  55                 for (i=0; i<0x400000; i++) { asm volatile ( "nop \n" ); }
  56         }
  57         for (i=0; i<0x900000; i++) { asm volatile ( "nop \n" ); }
  58         asm volatile (
  59       "            LDMFD   SP!, {R0-R9,PC}\n"
  60         );
  61 }
  62 
  63 /*----------------------------------------------------------------------
  64     boot()
  65 
  66     Main entry point for the CHDK code
  67 -----------------------------------------------------------------------*/

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