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

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