root/platform/g10/sub/boot_hdr.c

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

DEFINITIONS

This source file includes following definitions.
  1. task_blinker
  2. CreateTask_Blinker
  3. taskCreateHook
  4. taskCreateHook2

   1 #include "lolevel.h"
   2 #include "platform.h"
   3 #include "core.h"
   4 
   5 // run blinker task
   6 //#define BLINKER 1
   7 #ifdef BLINKER
   8 #include "gui.h"
   9 #include "../../../../core/gui_draw.h"
  10 #endif
  11 
  12 const char * const new_sa = &_end;
  13 
  14 #define LED_ISO  (void*) 0xC02200D0 // G10 ISO select dial LED
  15 #define LED_DP   (void*) 0xC02200D4 // G10 direct print button LED
  16 #define LED_ECL  (void*) 0xC02200D8 // G10 exposure compensation dial LED
  17 #define LED_PWR  (void*) 0xC02200DC // G10 power LED
  18 
  19 extern void task_CaptSeq();
  20 extern void task_InitFileModules();
  21 extern void task_RotaryEncoder();
  22 extern void task_MovieRecord();
  23 extern void task_ExpDrv();
  24 extern void task_FileWrite();
  25 
  26 // Forward declarations
  27 void CreateTask_PhySw();
  28 void CreateTask_spytask();
  29 extern volatile int jogdial_stopped;
  30 void JogDial_task_my(void);
  31 
  32 #ifdef BLINKER
  33 void __attribute__((naked,noinline)) task_blinker() {
  34 
  35 int pwr_led_count = 0 ;
  36 int blue_led_count = 0 ;
  37 int gui_mode, gui_mode_flag = GUI_MODE_NONE ;
  38 
  39 volatile long *pwr_LED = (void*)LED_PWR;
  40 volatile long *blue_LED = (void*)LED_DP;
  41 
  42         _SleepTask(2000);
  43 
  44         while(1){
  45 
  46             gui_mode = camera_info.state.gui_mode;
  47 
  48             if(( (gui_mode == GUI_MODE_ALT)  && (gui_mode_flag != GUI_MODE_ALT) ) || ( (gui_mode == GUI_MODE_NONE)  && (gui_mode_flag != GUI_MODE_NONE) ) )
  49             {
  50                 gui_mode_flag = gui_mode ;
  51                 blue_led_count = 10 ;
  52                 *blue_LED = 0x46;
  53             }
  54             if ( blue_led_count > 0 )
  55             {
  56                 if ( --blue_led_count == 0 )
  57                 {
  58                     *blue_LED = 0x44;
  59                 }
  60             }
  61 
  62             if ( pwr_led_count == 2 )
  63             {
  64                 *pwr_LED = 0x44;
  65             }
  66             if ( --pwr_led_count <= 0 )
  67             {
  68                 pwr_led_count = 20 ;
  69                 *pwr_LED = 0x46;
  70             }
  71 
  72             _SleepTask(100);
  73         }
  74 };
  75 
  76 void CreateTask_Blinker() {
  77         _CreateTask("Blinker", 0x1, 0x200, task_blinker, 0);
  78 };
  79 #endif
  80 
  81 void taskCreateHook(int *p) {
  82     p-=17;
  83 
  84     if (p[0]==(int)task_InitFileModules) p[0]=(int)init_file_modules_task;
  85     if (p[0]==(int)task_MovieRecord)     p[0]=(int)movie_record_task;
  86     if (p[0]==(int)task_CaptSeq)         p[0]=(int)capt_seq_task;
  87     if (p[0]==(int)task_ExpDrv)          p[0]=(int)exp_drv_task;
  88     if (p[0]==(int)task_RotaryEncoder)   p[0]=(int)JogDial_task_my;
  89     if (p[0]==(int)task_FileWrite)       p[0]=(int)filewritetask;
  90 }
  91 
  92 void taskCreateHook2(int *p) {
  93     p-=17;
  94     if (p[0]==(int)task_InitFileModules) p[0]=(int)init_file_modules_task;
  95     if (p[0]==(int)task_ExpDrv)          p[0]=(int)exp_drv_task;
  96     if (p[0]==(int)task_FileWrite)       p[0]=(int)filewritetask;
  97 }
  98 
  99 /*----------------------------------------------------------------------
 100     boot()
 101 
 102     Main entry point for the CHDK code
 103 -----------------------------------------------------------------------*/

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