CHDK_DE Vorschauversion  Trunk Rev. 6014
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
boot.c-Dateireferenz
#include "lolevel.h"
#include "platform.h"
#include "core.h"
#include "dryos31.h"
+ Include-Abhängigkeitsdiagramm für boot.c:

gehe zum Quellcode dieser Datei

Makrodefinitionen

#define offsetof(TYPE, MEMBER)   ((int) &((TYPE *)0)->MEMBER)
 
#define DP   (void*)0xC02200C4
 
#define LED_PR   0xc02200C4
 
#define LED_RED   0xc02200C8
 
#define LED_GRN   0xc02200CC
 
#define LED_PWR   0xc02200D0
 
#define DELAY   800000
 

Funktionen

void debug_my_blink ()
 
void task_PhySw ()
 
void task_CaptSeq ()
 
void task_InitFileModules ()
 
void task_MovieRecord ()
 
void task_ExpDrv ()
 
void task_FileWrite ()
 
void task_RotaryEncoder ()
 
void JogDial_task_my (void)
 
void taskCreateHook (context_t **context)
 
void CreateTask_spytask ()
 
void boot ()
 
void __attribute__ ((naked, noinline))
 *-------------------------------------------------------------------— Mehr ...
 

Variablen

const char *const new_sa = &_end
 

Makro-Dokumentation

#define DELAY   800000

Definiert in Zeile 16 der Datei boot.c.

#define DP   (void*)0xC02200C4

Definiert in Zeile 10 der Datei boot.c.

#define LED_GRN   0xc02200CC

Definiert in Zeile 13 der Datei boot.c.

#define LED_PR   0xc02200C4

Definiert in Zeile 11 der Datei boot.c.

#define LED_PWR   0xc02200D0

Definiert in Zeile 14 der Datei boot.c.

#define LED_RED   0xc02200C8

Definiert in Zeile 12 der Datei boot.c.

#define offsetof (   TYPE,
  MEMBER 
)    ((int) &((TYPE *)0)->MEMBER)

Definiert in Zeile 8 der Datei boot.c.

Dokumentation der Funktionen

void __attribute__ ( (naked, noinline)  )

*-------------------------------------------------------------------—

!!

IS_ERROR( hSoundHandle )

IS_ERROR( RetCode )

IS_ERROR( RetCode )

IS_ERROR( RetCode )

IS_ERROR( RetCode )

"MOV R3, #0\n" "STR R3, [R9]\n"

TODO! below is from sd400

"MOV R3, #0\n" "STR R3, [R9]\n"

TODO! below is from sd400

__MovieRecorder_c__100

__MovieRecorder_c__100

Definiert in Zeile 103 der Datei boot.c.

103  {
104  *(int*)0x1930=(int)taskCreateHook;
105  *(int*)0x1934=(int)taskCreateHook;
106  *(int*)(0x2478+0x4) = (*(int*)0xC02200B8)&1 ? 0x100000: 0x200000; // replacement of sub_FFC111A4 //from taskcreate_startup to sub_FFC111A4 and there to sub_FFC35CC4
107  asm volatile (
108  "loc_FFC001A4:\n"
109  "LDR R0, =0xFFC0021C\n"
110  "MOV R1, #0\n"
111  "LDR R3, =0xFFC00254\n"
112  "loc_FFC001B0:\n"
113  "CMP R0, R3\n"
114  "LDRCC R2, [R0],#4\n"
115  "STRCC R2, [R1],#4\n"
116  "BCC loc_FFC001B0\n"
117  "LDR R0, =0xFFC00254\n"
118  "MOV R1, #0x4B0\n"
119  "LDR R3, =0xFFC00468\n"
120  "loc_FFC001CC:\n"
121  "CMP R0, R3\n"
122  "LDRCC R2, [R0],#4\n"
123  "STRCC R2, [R1],#4\n"
124  "BCC loc_FFC001CC\n"
125  "MOV R0, #0xD2\n"
126  "MSR CPSR_cxsf, R0\n"
127  "MOV SP, #0x1000\n"
128  "MOV R0, #0xD3\n"
129  "MSR CPSR_cxsf, R0\n"
130  "MOV SP, #0x1000\n"
131  "LDR R0, =loc_FFC00210\n"
132  "LDR R2, =0xEEEEEEEE\n"
133  "MOV R3, #0x1000\n"
134 
135  "loc_FFC00200:\n"
136  "CMP R0, R3\n"
137  "STRCC R2, [R0],#4\n"
138  "BCC loc_FFC00200\n"
139  "BL sub_FFC00F98_my\n" // <---------- changed
140 
141  "loc_FFC00210:\n"
142  "ANDEQ R0, R0, R4,ASR#13\n"
143 
144  "loc_FFC00214:\n"
145 
146  "ANDEQ R0, R0, R0,ROR R6\n"
147 
148  "loc_FFC00218:\n"
149  "ANDEQ R0, R0, R4,ROR R6\n"
150 
151  "loc_FFC0021C:\n"
152  "NOP\n"
153  "LDR PC, =0xFFC00468\n"
154  );
155 }
void boot ( )

Definiert in Zeile 38 der Datei boot.c.

38  { //#fs
39  long *canon_data_src = (void*)0xFFEBFB4C;
40  long *canon_data_dst = (void*)0x1900;
41  long canon_data_len = 0xD700 - 0x1900; // data_end - data_start
42  long *canon_bss_start = (void*)0xD700; // just after data
43  long canon_bss_len = 0xA47E0 - 0xD700;
44 
45  long i;
46 
47 
48  // Code taken from VxWorks CHDK. Changes CPU speed?
49  asm volatile (
50  "MRC p15, 0, R0,c1,c0\n"
51  "ORR R0, R0, #0x1000\n"
52  "ORR R0, R0, #4\n"
53  "ORR R0, R0, #1\n"
54  "MCR p15, 0, R0,c1,c0\n"
55  :::"r0");
56 
57  for(i=0;i<canon_data_len/4;i++)
58  canon_data_dst[i]=canon_data_src[i];
59 
60  for(i=0;i<canon_bss_len/4;i++)
61  canon_bss_start[i]=0;
62 
63 /* asm volatile (
64  "MRC p15, 0, R0,c1,c0\n"
65  "ORR R0, R0, #0x1000\n"
66  "BIC R0, R0, #4\n"
67  "ORR R0, R0, #1\n"
68  "MCR p15, 0, R0,c1,c0\n"
69  :::"r0");
70 */
71 
72  *(int*)0x1930=(int)taskCreateHook;
73  *(int*)0x1934=(int)taskCreateHook;
74  *(int*)0x1938=(int)taskCreateHook2;
75 
76  // jump to init-sequence that follows the data-copy-routine
77  asm volatile ("B sub_FFC001A4_my\n");
78 }; //#fe
void CreateTask_spytask ( )

Definiert in Zeile 62 der Datei boot.c.

62  {
63  _CreateTask("SpyTask", 0x19, 0x2000, core_spytask, 0);
64 };
void debug_my_blink ( )

Definiert in Zeile 18 der Datei boot.c.

19 {
20  volatile long *p = (void*)DP; // turned off later, so assumed to be power
21  volatile long *p2 = (void*)LED_RED; // turned off later, so assumed to be power
22  int counter;
23 
24  // DEBUG: blink led
25  //led on
26  counter = DELAY;
27  *p = 0x46;
28  while (counter--) { asm("nop\n nop\n"); };
29  *p2 = 0x46;
30  //led off
31  counter = DELAY;
32  *p = 0x44;
33  while (counter--) { asm("nop\n nop\n"); };
34  *p2= 0x44;
35 }
void JogDial_task_my ( void  )
void task_CaptSeq ( )
void task_ExpDrv ( )
void task_FileWrite ( )
void task_InitFileModules ( )
void task_MovieRecord ( )
void task_PhySw ( )
void task_RotaryEncoder ( )
void taskCreateHook ( context_t **  context)

Definiert in Zeile 49 der Datei boot.c.

49  {
50 
51  task_t *tcb=(task_t*)((char*)context-offsetof(task_t, context));
52 
53  if(tcb->entry == (void*)task_CaptSeq) tcb->entry = (void*)capt_seq_task;
54  if(tcb->entry == (void*)task_PhySw) tcb->entry = (void*)mykbd_task;
55  if(tcb->entry == (void*)task_RotaryEncoder) tcb->entry = (void*)JogDial_task_my;
56  if(tcb->entry == (void*)task_InitFileModules) tcb->entry = (void*)init_file_modules_task;
57  if(tcb->entry == (void*)task_MovieRecord) tcb->entry = (void*)movie_record_task;
58  if(tcb->entry == (void*)task_ExpDrv) tcb->entry = (void*)exp_drv_task;
59  if(tcb->entry == (void*)task_FileWrite) tcb->entry = (void*)filewritetask;
60 }

Variablen-Dokumentation

const char* const new_sa = &_end

Definiert in Zeile 38 der Datei boot.c.