annotate chipsetsw/layer1/dyn_dwl_cfile/l1_dyn_dwl_apihisr.c @ 87:33c16c173666

l1_ctl.c: l1ctl_csgc() reconstructed
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Thu, 07 Apr 2016 02:25:26 +0000
parents 757ae82219de
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1 /************* Revision Controle System Header *************
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2 * GSM Layer 1 software
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
3 * L1_DYN_DWL_APIHISR.C
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
4 *
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
5 * Filename l1_dyn_dwl_apihisr.c
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
6 * Copyright 2004 (C) Texas Instruments
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
7 *
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
8 ************* Revision Controle System Header *************/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
9
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
10 #include <stdio.h>
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
11 #include <string.h>
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
12 #include "nucleus.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
13 #include "l1_confg.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
14 #include "sys_types.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
15 #include "l1_types.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
16 #include "l1audio_cust.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
17 #include "l1audio_defty.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
18 #include "l1audio_const.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
19 #include "l1_const.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
20 #include "l1tm_defty.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
21
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
22 #if (L1_GTT == 1)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
23 #include "l1gtt_const.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
24 #include "l1gtt_defty.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
25 #endif
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
26
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
27 #if (L1_DYN_DSP_DWNLD == 1)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
28 #include "l1_dyn_dwl_const.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
29 #include "l1_dyn_dwl_signa.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
30 #include "l1_dyn_dwl_defty.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
31 #include "l1_dyn_dwl_msgty.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
32 #include "l1_dyn_dwl_error.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
33 #include "l1_dyn_dwl_proto.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
34 #include "l1_api_hisr.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
35 #endif
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
36 #if (L1_MP3 == 1)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
37 #include "l1mp3_defty.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
38 #endif //L1_MP3
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
39 #if (L1_MIDI == 1)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
40 #include "l1midi_defty.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
41 #endif
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
42
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
43 #include "l1_defty.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
44 #include "cust_os.h"
25
757ae82219de l1_dyn_dwl_apihisr.c compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 19
diff changeset
45 /* #include "nu_main.h" */
19
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
46 #include "l1audio_signa.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
47 #include "l1audio_cust.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
48 #include "l1_varex.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
49 #include "l1_macro.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
50 #include "l1_api_hisr.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
51 #include "l1_trace.h"
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
52
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
53 #if (L1_DYN_DSP_DWNLD == 1)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
54
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
55 /* Dynamic Download NDB API */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
56 T_DYN_DWNLD_MCU_DSP *dyn_dwl_ndb;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
57
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
58 #if (CODE_VERSION == SIMULATION)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
59 T_DYN_DWNLD_MCU_DSP dyn_dwl_ndb_sim;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
60 UWORD16 dwnld_area_array[SIZE_DWNLD_AREA_SIMU];
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
61 #endif
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
62
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
63 enum states
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
64 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
65 RESET = 0,
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
66 WAIT_UNINSTALL = 1,
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
67 WAIT_DSP_END_BUFFER = 2,
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
68 WAIT_CRC = 3,
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
69 WAIT_INSTALL = 4
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
70 };
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
71 /*------------------------------------------------------------------------------------------------------------- */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
72 /* l1_dyn_dwnld_copy_patch_process() */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
73 /*------------------------------------------------------------------------------------------------------------- */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
74 /* */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
75 /* Parameters : BOOL new_patch: TRUE if the patch is copied from scratch, FALSE if it has been started so far */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
76 /* */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
77 /* Return : state in which must be stepped into */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
78 /* */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
79 /* Description : Performs the copy of the patch and computes next state of corresponding APIHISR state machine */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
80 /* */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
81 /*------------------------------------------------------------------------------------------------------------- */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
82
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
83 UWORD8 l1_dyn_dwnld_copy_patch_process (BOOL new_patch)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
84 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
85 BOOL still_words_to_be_copied;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
86 UWORD16 tmp_dwnld_area_size;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
87 UWORD8 return_state;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
88 UWORD16 *p_src_mcu = NULL;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
89 UWORD16 *p_dest_mcu = NULL;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
90 UWORD16 *tmp_pointer = NULL;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
91
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
92 UWORD16 tmp_patch_size = l1_apihisr.dyn_dwnld.tmp_patch_size;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
93
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
94 /* Copy first N block of data */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
95 still_words_to_be_copied = l1_init_pointers_and_copy_first_block_of_data(&(tmp_dwnld_area_size), &(tmp_patch_size), &(p_dest_mcu), &(p_src_mcu),new_patch);
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
96
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
97 /* Set download command */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
98 dyn_dwl_ndb->d_api_dwl_download_ctrl = (API) C_DWL_DOWNLOAD_CTRL_DOWNLOAD;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
99
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
100 #if (CODE_VERSION == SIMULATION)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
101 l1_trigger_api_interrupt();
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
102 #endif
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
103
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
104 /* Check if there are still words to be copied after first API interrupt generation: if not */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
105 /* the patch has been completely downloaded and MCU waits for CRC*/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
106 if(still_words_to_be_copied == FALSE)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
107 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
108 return_state = WAIT_CRC;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
109 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
110
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
111 /* If not copy the patch: if download area is bigger than patch size copy until the end of the patch */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
112 /* Else copy till the end of buffer download area and wait for DSP interrupt */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
113 else
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
114 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
115 if (tmp_dwnld_area_size >= tmp_patch_size)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
116 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
117 l1_copy_till_the_end_of_the_patch_and_update_write_pointer(tmp_patch_size,p_dest_mcu,p_src_mcu);
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
118 return_state = WAIT_CRC;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
119 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
120 else
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
121 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
122 l1_copy_till_end_of_dwnld_area_and_update_write_pointer(tmp_dwnld_area_size,p_dest_mcu,&tmp_patch_size,&p_src_mcu);
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
123
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
124 /* Save source patch file pointerand temporary patch size*/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
125 l1_apihisr.dyn_dwnld.running_source_pointer = (UWORD32) p_src_mcu;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
126 l1_apihisr.dyn_dwnld.tmp_patch_size = tmp_patch_size;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
127
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
128 /* Change state*/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
129 return_state = WAIT_DSP_END_BUFFER;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
130 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
131 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
132 return return_state;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
133 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
134 /*-------------------------------------------------------------*/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
135 /* l1_dyn_dwnld_apihisr() */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
136 /*-------------------------------------------------------------*/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
137 /* */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
138 /* Parameters : none */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
139 /* */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
140 /* Return : n/a */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
141 /* */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
142 /* Description : implements Dynamic Download API HISR */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
143 /* */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
144 /*-------------------------------------------------------------*/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
145
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
146 void l1_dyn_dwnld_apihisr()
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
147 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
148
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
149 UWORD8 *state = &l1_apihisr.dyn_dwnld.state;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
150
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
151
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
152 /* Variables for copy process */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
153
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
154 xSignalHeaderRec *conf_msg;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
155 BOOL flag_error;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
156
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
157 /* Dynamic Download error handler : check if critical error occured */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
158 if( l1_dyn_dwnld_apihisr_error_handler() == TRUE )
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
159 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
160 /* Send notification to L1A */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
161 conf_msg = os_alloc_sig(sizeof(T_API_L1_DYN_DWNLD_STOP));
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
162 DEBUGMSG(status,NU_ALLOC_ERR)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
163 conf_msg->SignalCode = API_L1_DYN_DWNLD_STOP;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
164 ((T_API_L1_DYN_DWNLD_STOP *) (conf_msg->SigP))->error = dyn_dwl_ndb->d_api_dwl_error_code;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
165 dyn_dwl_ndb->d_api_dwl_error_code = C_DWL_ERR_RESET;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
166 os_send_sig(conf_msg,L1C1_QUEUE);
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
167 DEBUGMSG(status,NU_SEND_QUEUE_ERR)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
168
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
169 /* Branch state */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
170 *state = RESET;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
171 flag_error = TRUE;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
172 return;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
173 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
174 else
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
175 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
176 flag_error = FALSE;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
177 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
178
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
179 /****************/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
180 /*STATE MACHINE */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
181 /****************/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
182
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
183 while (1){
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
184 switch(*state)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
185 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
186 /*********/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
187 /* RESET */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
188 /*********/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
189 case RESET:
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
190 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
191 /* Check reset init command (if reset by DSP) / Restart in case dynamic download delayed */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
192 if ( dyn_dwl_ndb->d_api_dwl_download_ctrl == (API) C_DWL_DOWNLOAD_CTRL_DSP_ACK ||
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
193 l1a_apihisr_com.dyn_dwnld.command.restart == TRUE)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
194 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
195 if (flag_error == FALSE)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
196 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
197
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
198 /* Send confirmation to L1A */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
199 conf_msg = os_alloc_sig(0);
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
200 DEBUGMSG(status,NU_ALLOC_ERR)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
201 conf_msg->SignalCode = API_L1_DYN_DWNLD_START_CON;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
202 os_send_sig(conf_msg,L1C1_QUEUE);
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
203 DEBUGMSG(status,NU_SEND_QUEUE_ERR)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
204
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
205 /* Store patch IDs to install counter in global API */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
206 l1_apihisr.dyn_dwnld.patch_ids_counter = l1a_apihisr_com.dyn_dwnld.copy_parameters.num_of_elem;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
207
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
208 /* Reset command */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
209 l1a_apihisr_com.dyn_dwnld.command.restart = FALSE;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
210
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
211 /* Test if number of uninstall elements is greater than zero */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
212 if ( l1a_apihisr_com.dyn_dwnld.uninstall_parameters.num_of_elem > 0 )
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
213 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
214 /* Copy num of elem L1A-API variable counter into global uninstall counter */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
215 l1_apihisr.dyn_dwnld.uninstall_counter = l1a_apihisr_com.dyn_dwnld.uninstall_parameters.num_of_elem;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
216
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
217 l1_set_uninstall_parameters();
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
218
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
219 #if (CODE_VERSION == SIMULATION)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
220 l1_trigger_api_interrupt();
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
221 #endif
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
222
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
223 /* Change state */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
224 *state = WAIT_UNINSTALL;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
225 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
226 else /* No elements to uninstall*/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
227 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
228 /* Reset patch size */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
229 l1_apihisr.dyn_dwnld.tmp_patch_size = 0;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
230
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
231 /* Copy the patch and update current state*/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
232 *state = l1_dyn_dwnld_copy_patch_process(TRUE);
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
233
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
234 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
235 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
236 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
237 return;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
238 } /* end case RESET */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
239 //omaps00090550 break;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
240
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
241 /******************/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
242 /* WAIT_UNINSTALL */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
243 /******************/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
244 case WAIT_UNINSTALL:
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
245 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
246 /* Check uninstall command (if reset by DSP) */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
247 if ( dyn_dwl_ndb->d_api_dwl_download_ctrl == (API) C_DWL_DOWNLOAD_CTRL_DSP_ACK )
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
248 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
249 /* Decrement uninstall counter */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
250 l1_apihisr.dyn_dwnld.uninstall_counter--;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
251
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
252 /* Check uninstall counter: if it is 0 no more uninstall to perform*/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
253 if ( l1_apihisr.dyn_dwnld.uninstall_counter == 0 )
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
254 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
255 /* Send confirmation to L1A */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
256 conf_msg = os_alloc_sig(0);
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
257 DEBUGMSG(status,NU_ALLOC_ERR)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
258 conf_msg->SignalCode = API_L1_DYN_DWNLD_UNINST_OK;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
259 os_send_sig(conf_msg,L1C1_QUEUE);
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
260 DEBUGMSG(status,NU_SEND_QUEUE_ERR)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
261
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
262 /* Reset patch size */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
263 l1_apihisr.dyn_dwnld.tmp_patch_size = 0;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
264
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
265 /* Copy the patch and update current state*/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
266 *state = l1_dyn_dwnld_copy_patch_process(TRUE);
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
267 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
268 else /* there are some uninstall to perform */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
269 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
270 l1_set_uninstall_parameters();
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
271
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
272 #if (CODE_VERSION == SIMULATION)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
273 l1_trigger_api_interrupt();
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
274 #endif
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
275 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
276 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
277 return;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
278 } /* end case WAIT_UNINSTALL */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
279 //omaps00090550 break;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
280
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
281 /***********************/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
282 /* WAIT_DSP_END_BUFFER */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
283 /***********************/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
284 case WAIT_DSP_END_BUFFER:
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
285 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
286 if ( dyn_dwl_ndb->d_api_dwl_download_ctrl == (API) C_DWL_DOWNLOAD_CTRL_DSP_ACK )
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
287 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
288 /* Copy the patch and update current state*/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
289 *state = l1_dyn_dwnld_copy_patch_process(FALSE);
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
290 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
291 return;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
292 } /* end case WAIT_DSP_END_BUFFER */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
293 //omaps00090550 break;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
294
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
295 /************/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
296 /* WAIT_CRC */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
297 /************/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
298 case WAIT_CRC:
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
299 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
300 /* Check if DSP install command is reset */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
301 if (dyn_dwl_ndb->d_api_dwl_download_ctrl == (API) C_DWL_DOWNLOAD_CTRL_DSP_ACK )
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
302 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
303 /* Test if CRC is OK */
25
757ae82219de l1_dyn_dwl_apihisr.c compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 19
diff changeset
304 if ( dyn_dwl_ndb->d_api_dwl_crc != l1a_apihisr_com.dyn_dwnld.copy_parameters.crc[l1a_apihisr_com.dyn_dwnld.copy_parameters.num_of_elem-l1_apihisr.dyn_dwnld.patch_ids_counter]) /* CRC not OK */
19
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
305 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
306 /* Send notification to L1A */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
307 conf_msg = os_alloc_sig(sizeof(T_API_L1_CRC_NOT_OK));
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
308 DEBUGMSG(status,NU_ALLOC_ERR)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
309 conf_msg->SignalCode = API_L1_CRC_NOT_OK;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
310 ((T_API_L1_CRC_NOT_OK *) (conf_msg->SigP))->patch_id = dyn_dwl_ndb->d_api_dwl_crc;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
311 os_send_sig(conf_msg,L1C1_QUEUE);
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
312 DEBUGMSG(status,NU_SEND_QUEUE_ERR)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
313
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
314 /* Change state */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
315 *state = RESET;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
316 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
317 else /* CRC OK */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
318 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
319 conf_msg = os_alloc_sig(sizeof(T_API_L1_CRC_NOT_OK));
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
320 DEBUGMSG(status,NU_ALLOC_ERR)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
321 conf_msg->SignalCode = API_L1_CRC_OK;
25
757ae82219de l1_dyn_dwl_apihisr.c compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 19
diff changeset
322 ((T_API_L1_CRC_NOT_OK *) (conf_msg->SigP))->patch_id = l1a_apihisr_com.dyn_dwnld.copy_parameters.crc[l1a_apihisr_com.dyn_dwnld.copy_parameters.num_of_elem-l1_apihisr.dyn_dwnld.patch_ids_counter];
19
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
323 os_send_sig(conf_msg,L1C1_QUEUE);
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
324 DEBUGMSG(status,NU_SEND_QUEUE_ERR)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
325 *state = WAIT_INSTALL;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
326
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
327 /* Set install parameters */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
328
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
329 dyn_dwl_ndb->d_api_dwl_function_address[0] =
25
757ae82219de l1_dyn_dwl_apihisr.c compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 19
diff changeset
330 (API) (l1a_apihisr_com.dyn_dwnld.copy_parameters.address_to_install[l1a_apihisr_com.dyn_dwnld.copy_parameters.num_of_elem-l1_apihisr.dyn_dwnld.patch_ids_counter] & 0x0000FFFF);
19
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
331 dyn_dwl_ndb->d_api_dwl_function_address[1] =
25
757ae82219de l1_dyn_dwl_apihisr.c compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 19
diff changeset
332 (API) ((l1a_apihisr_com.dyn_dwnld.copy_parameters.address_to_install[l1a_apihisr_com.dyn_dwnld.copy_parameters.num_of_elem-l1_apihisr.dyn_dwnld.patch_ids_counter] >> 16) & 0x0000FFFF);
19
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
333
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
334 dyn_dwl_ndb->d_api_dwl_download_ctrl = (API) C_DWL_DOWNLOAD_CTRL_INSTALL;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
335
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
336 #if (CODE_VERSION == SIMULATION)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
337 l1_trigger_api_interrupt();
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
338 #endif
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
339 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
340 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
341 return;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
342 } /* end case WAIT_CRC */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
343 //omaps00090550 break;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
344
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
345 /****************/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
346 /* WAIT_INSTALL */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
347 /****************/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
348 case WAIT_INSTALL:
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
349 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
350 /* Check if DSP install command is reset */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
351 if (dyn_dwl_ndb->d_api_dwl_download_ctrl == (API) C_DWL_DOWNLOAD_CTRL_DSP_ACK )
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
352 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
353 /* Decrement patch counter */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
354 l1_apihisr.dyn_dwnld.patch_ids_counter--;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
355
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
356 /* Test if patch counter is null */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
357 if ( l1_apihisr.dyn_dwnld.patch_ids_counter == 0 )
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
358 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
359 /* Send notification to L1A */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
360 conf_msg = os_alloc_sig(0);
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
361 DEBUGMSG(status,NU_ALLOC_ERR)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
362 conf_msg->SignalCode = API_L1_DYN_DWNLD_FINISHED;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
363 os_send_sig(conf_msg,L1C1_QUEUE);
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
364 DEBUGMSG(status,NU_SEND_QUEUE_ERR)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
365 *state = RESET;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
366 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
367 else
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
368 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
369 /* Reset patch size */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
370 l1_apihisr.dyn_dwnld.tmp_patch_size = 0;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
371
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
372 /* Copy the patch and update current state*/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
373 *state = l1_dyn_dwnld_copy_patch_process(TRUE);
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
374 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
375 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
376 return;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
377 } /* end case WAIT_INSTALL */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
378 //omaps00090550 break;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
379 } /* end switch */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
380 } /* end while */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
381 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
382
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
383 /*-------------------------------------------------------------*/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
384 /* l1_dyn_dwnld_apihisr_error_handler() */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
385 /*-------------------------------------------------------------*/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
386 /* */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
387 /* Parameters : error_code (OUT) error_code received from DSP */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
388 /* */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
389 /* Return : TRUE if errors signaled by DSP */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
390 /* */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
391 /*-------------------------------------------------------------*/
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
392 BOOL l1_dyn_dwnld_apihisr_error_handler()
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
393 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
394 BOOL critical;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
395
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
396 /* Initialisation */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
397 critical = FALSE;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
398
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
399 if(dyn_dwl_ndb->d_api_dwl_error_code != 0)
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
400 {
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
401 critical = TRUE;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
402 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
403
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
404 return critical;
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
405 }
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
406
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
407
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
408 #endif /* L1_DYN_DSP_DWNLD */
06d94fdaadf6 l1_dyn_dwl_*.c imported from LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
409