publishing to check changes in cdms code
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE_samp_23SEP_DMA_flag by
FMS_all.h@249:1560c64adffb, 2016-07-08 (annotated)
- Committer:
- chaithanyarss
- Date:
- Fri Jul 08 14:47:00 2016 +0000
- Revision:
- 249:1560c64adffb
- Parent:
- 248:407ab7e337cd
flash is done. MMS needs to be completed;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ee12b079 | 209:63e9c8f8b5d2 | 1 | |
chaithanyarss | 248:407ab7e337cd | 2 | /*===================================================FMS Functions=================================================*/ |
ee12b079 | 235:c127b15409b2 | 3 | //Run processes |
ee12b079 | 209:63e9c8f8b5d2 | 4 | void P_PL_INIT(); |
ee12b079 | 209:63e9c8f8b5d2 | 5 | void P_PL_MAIN(); |
ee12b079 | 209:63e9c8f8b5d2 | 6 | void P_COM_INIT(); |
ee12b079 | 209:63e9c8f8b5d2 | 7 | void P_CDMS_HK_MAIN(); |
ee12b079 | 209:63e9c8f8b5d2 | 8 | void P_PL_RCV_SC_DATA(); |
ee12b079 | 209:63e9c8f8b5d2 | 9 | void P_CDMS_INIT_SD(); |
ee12b079 | 235:c127b15409b2 | 10 | |
ee12b079 | 235:c127b15409b2 | 11 | // Switch ON/OFF functions |
ee12b079 | 209:63e9c8f8b5d2 | 12 | void CDMS_SD_SW_ON(); |
ee12b079 | 209:63e9c8f8b5d2 | 13 | void CDMS_SD_SW_OFF(); |
ee12b079 | 235:c127b15409b2 | 14 | void CDMS_RTC_ON(); |
ee12b079 | 235:c127b15409b2 | 15 | void CDMS_RTC_OFF(); |
ee12b079 | 209:63e9c8f8b5d2 | 16 | void SW_ON_BAE(); |
ee12b079 | 209:63e9c8f8b5d2 | 17 | void SW_OFF_BAE(); |
ee12b079 | 209:63e9c8f8b5d2 | 18 | void SW_ON_PL_BEE(); |
ee12b079 | 209:63e9c8f8b5d2 | 19 | void SW_OFF_PL_BEE(); |
ee12b079 | 209:63e9c8f8b5d2 | 20 | void SW_ON_PL_EPS(); |
ee12b079 | 209:63e9c8f8b5d2 | 21 | void SW_OFF_PL_EPS(); |
ee12b079 | 209:63e9c8f8b5d2 | 22 | void SW_ON_V_A_EN(); |
ee12b079 | 209:63e9c8f8b5d2 | 23 | void SW_OFF_V_A_EN(); |
ee12b079 | 235:c127b15409b2 | 24 | |
ee12b079 | 235:c127b15409b2 | 25 | // RST functions |
ee12b079 | 209:63e9c8f8b5d2 | 26 | void RST_SD(); |
ee12b079 | 235:c127b15409b2 | 27 | void SW_RST_BAE(); |
ee12b079 | 235:c127b15409b2 | 28 | void SW_RST_PL_BEE(); |
ee12b079 | 209:63e9c8f8b5d2 | 29 | void RST_BAE(); |
ee12b079 | 209:63e9c8f8b5d2 | 30 | void RST_PL_BEE(); |
chaithanyarss | 248:407ab7e337cd | 31 | void CDMS_RESET(); |
ee12b079 | 235:c127b15409b2 | 32 | void SYS_PWR_RESET(); // Have to be decided with EPS team. |
ee12b079 | 235:c127b15409b2 | 33 | void EPS_V_A_EN(); |
ee12b079 | 235:c127b15409b2 | 34 | void EPS_V_C_EN(); |
ee12b079 | 235:c127b15409b2 | 35 | |
ee12b079 | 209:63e9c8f8b5d2 | 36 | void RST_HK_COUNTER(); |
ee12b079 | 209:63e9c8f8b5d2 | 37 | uint8_t CDMS_RD_SD_HK(uint8_t *); |
ee12b079 | 235:c127b15409b2 | 38 | void CDMS_RD_RTC(uint64_t *); |
ee12b079 | 235:c127b15409b2 | 39 | void CDMS_CALIB_RTC(); |
chaithanyarss | 248:407ab7e337cd | 40 | void TOTAL_RESET_WITH_CDMS(); |
ee12b079 | 235:c127b15409b2 | 41 | |
ee12b079 | 209:63e9c8f8b5d2 | 42 | |
ee12b079 | 209:63e9c8f8b5d2 | 43 | void P_PL_INIT() |
ee12b079 | 209:63e9c8f8b5d2 | 44 | { |
ee12b079 | 209:63e9c8f8b5d2 | 45 | |
ee12b079 | 209:63e9c8f8b5d2 | 46 | } |
ee12b079 | 209:63e9c8f8b5d2 | 47 | |
ee12b079 | 209:63e9c8f8b5d2 | 48 | void P_PL_MAIN() |
ee12b079 | 209:63e9c8f8b5d2 | 49 | { |
chaithanyarss | 248:407ab7e337cd | 50 | FCTN_CDMS_PL_MAIN((void *)NULL); |
ee12b079 | 209:63e9c8f8b5d2 | 51 | } |
ee12b079 | 209:63e9c8f8b5d2 | 52 | |
ee12b079 | 209:63e9c8f8b5d2 | 53 | void P_COM_INIT() |
ee12b079 | 209:63e9c8f8b5d2 | 54 | { |
ee12b079 | 235:c127b15409b2 | 55 | P_COM_INIT; |
ee12b079 | 209:63e9c8f8b5d2 | 56 | } |
ee12b079 | 209:63e9c8f8b5d2 | 57 | |
ee12b079 | 209:63e9c8f8b5d2 | 58 | void P_CDMS_HK_MAIN() |
ee12b079 | 209:63e9c8f8b5d2 | 59 | { |
ee12b079 | 235:c127b15409b2 | 60 | FCTN_CDMS_HK_MAIN((void *)NULL); |
ee12b079 | 209:63e9c8f8b5d2 | 61 | } |
ee12b079 | 209:63e9c8f8b5d2 | 62 | |
ee12b079 | 209:63e9c8f8b5d2 | 63 | void P_PL_RCV_SC_DATA() |
ee12b079 | 209:63e9c8f8b5d2 | 64 | { |
ee12b079 | 235:c127b15409b2 | 65 | |
ee12b079 | 209:63e9c8f8b5d2 | 66 | } |
ee12b079 | 209:63e9c8f8b5d2 | 67 | |
ee12b079 | 209:63e9c8f8b5d2 | 68 | void P_CDMS_INIT_SD() |
ee12b079 | 209:63e9c8f8b5d2 | 69 | { |
ee12b079 | 209:63e9c8f8b5d2 | 70 | FCTN_CDMS_SD_INIT(); |
ee12b079 | 209:63e9c8f8b5d2 | 71 | } |
ee12b079 | 209:63e9c8f8b5d2 | 72 | |
ee12b079 | 209:63e9c8f8b5d2 | 73 | void CDMS_SD_SW_ON() |
ee12b079 | 209:63e9c8f8b5d2 | 74 | { |
ee12b079 | 235:c127b15409b2 | 75 | SD_SW_EN_DS = 0; |
ee12b079 | 209:63e9c8f8b5d2 | 76 | } |
ee12b079 | 209:63e9c8f8b5d2 | 77 | |
ee12b079 | 209:63e9c8f8b5d2 | 78 | void CDMS_SD_SW_OFF() |
ee12b079 | 209:63e9c8f8b5d2 | 79 | { |
ee12b079 | 235:c127b15409b2 | 80 | SD_SW_EN_DS = 1; |
ee12b079 | 209:63e9c8f8b5d2 | 81 | } |
ee12b079 | 209:63e9c8f8b5d2 | 82 | |
ee12b079 | 235:c127b15409b2 | 83 | void CDMS_RTC_ON() |
ee12b079 | 209:63e9c8f8b5d2 | 84 | { |
chaithanyarss | 248:407ab7e337cd | 85 | //FCTN_CDMS_INIT_RTC(); |
chaithanyarss | 248:407ab7e337cd | 86 | SPI_mutex.lock(); |
chaithanyarss | 248:407ab7e337cd | 87 | gCS_RTC=1; |
chaithanyarss | 248:407ab7e337cd | 88 | gCS_RTC=0; |
chaithanyarss | 248:407ab7e337cd | 89 | spi.write(0x81); //register address with write flag |
chaithanyarss | 248:407ab7e337cd | 90 | spi.write(0x00);//disabling stop bit in the seconds register |
chaithanyarss | 248:407ab7e337cd | 91 | SPI_mutex.unlock(); |
ee12b079 | 209:63e9c8f8b5d2 | 92 | } |
ee12b079 | 209:63e9c8f8b5d2 | 93 | |
ee12b079 | 235:c127b15409b2 | 94 | void CDMS_RTC_OFF() |
ee12b079 | 209:63e9c8f8b5d2 | 95 | { |
chaithanyarss | 248:407ab7e337cd | 96 | SPI_mutex.lock(); |
chaithanyarss | 248:407ab7e337cd | 97 | gCS_RTC=1; |
chaithanyarss | 248:407ab7e337cd | 98 | gCS_RTC=0; |
chaithanyarss | 248:407ab7e337cd | 99 | spi.write(0x81); //register address with write flag |
chaithanyarss | 248:407ab7e337cd | 100 | spi.write(0x80);//enabling stop bit in the seconds register |
chaithanyarss | 248:407ab7e337cd | 101 | SPI_mutex.unlock(); |
ee12b079 | 209:63e9c8f8b5d2 | 102 | } |
ee12b079 | 209:63e9c8f8b5d2 | 103 | |
ee12b079 | 235:c127b15409b2 | 104 | void SW_ON_BAE() |
ee12b079 | 235:c127b15409b2 | 105 | { |
ee12b079 | 235:c127b15409b2 | 106 | BAE_SW_EN_DS = 0; |
ee12b079 | 235:c127b15409b2 | 107 | } |
ee12b079 | 235:c127b15409b2 | 108 | |
ee12b079 | 235:c127b15409b2 | 109 | void SW_OFF_BAE() |
ee12b079 | 235:c127b15409b2 | 110 | { |
ee12b079 | 235:c127b15409b2 | 111 | BAE_SW_EN_DS = 1; |
ee12b079 | 235:c127b15409b2 | 112 | } |
ee12b079 | 235:c127b15409b2 | 113 | |
ee12b079 | 235:c127b15409b2 | 114 | void SW_ON_PL_BEE() |
ee12b079 | 235:c127b15409b2 | 115 | { |
ee12b079 | 235:c127b15409b2 | 116 | PYLD_DFF_CLK = 0;\ |
ee12b079 | 235:c127b15409b2 | 117 | PYLD_DFF = 1;\ |
ee12b079 | 235:c127b15409b2 | 118 | wait_us(1);\ |
ee12b079 | 235:c127b15409b2 | 119 | PYLD_DFF_CLK = 1;\ |
ee12b079 | 235:c127b15409b2 | 120 | wait_us(1);\ |
ee12b079 | 235:c127b15409b2 | 121 | PYLD_DFF_CLK = 0;\ |
ee12b079 | 235:c127b15409b2 | 122 | wait_us(1);\ |
ee12b079 | 235:c127b15409b2 | 123 | } |
ee12b079 | 235:c127b15409b2 | 124 | |
ee12b079 | 235:c127b15409b2 | 125 | void SW_OFF_PL_BEE() |
ee12b079 | 235:c127b15409b2 | 126 | { |
ee12b079 | 235:c127b15409b2 | 127 | PYLD_DFF_CLK = 0; |
ee12b079 | 235:c127b15409b2 | 128 | PYLD_DFF = 0; |
ee12b079 | 235:c127b15409b2 | 129 | wait_us(1); |
ee12b079 | 235:c127b15409b2 | 130 | PYLD_DFF_CLK = 1; |
ee12b079 | 235:c127b15409b2 | 131 | wait_us(1); |
ee12b079 | 235:c127b15409b2 | 132 | PYLD_DFF_CLK = 0; |
ee12b079 | 235:c127b15409b2 | 133 | wait_us(1); |
ee12b079 | 235:c127b15409b2 | 134 | } |
ee12b079 | 235:c127b15409b2 | 135 | |
ee12b079 | 235:c127b15409b2 | 136 | void SW_ON_PL_EPS() |
ee12b079 | 235:c127b15409b2 | 137 | { |
ee12b079 | 235:c127b15409b2 | 138 | PYLD_EPS_DFF_PWR_CLK = 0;\ |
ee12b079 | 235:c127b15409b2 | 139 | PYLD_EPS_DFF_PWR = 1;\ |
ee12b079 | 235:c127b15409b2 | 140 | wait_us(1);\ |
ee12b079 | 235:c127b15409b2 | 141 | PYLD_EPS_DFF_PWR_CLK = 1;\ |
ee12b079 | 235:c127b15409b2 | 142 | wait_us(1);\ |
ee12b079 | 235:c127b15409b2 | 143 | PYLD_EPS_DFF_PWR_CLK = 0;\ |
ee12b079 | 235:c127b15409b2 | 144 | wait_us(1);\ |
ee12b079 | 235:c127b15409b2 | 145 | } |
ee12b079 | 235:c127b15409b2 | 146 | |
ee12b079 | 209:63e9c8f8b5d2 | 147 | void SW_OFF_PL_EPS() |
ee12b079 | 209:63e9c8f8b5d2 | 148 | { |
ee12b079 | 235:c127b15409b2 | 149 | PYLD_EPS_DFF_PWR_CLK = 0;\ |
ee12b079 | 235:c127b15409b2 | 150 | PYLD_EPS_DFF_PWR = 0;\ |
ee12b079 | 235:c127b15409b2 | 151 | wait_us(1);\ |
ee12b079 | 235:c127b15409b2 | 152 | PYLD_EPS_DFF_PWR_CLK = 1;\ |
ee12b079 | 235:c127b15409b2 | 153 | wait_us(1);\ |
ee12b079 | 235:c127b15409b2 | 154 | PYLD_EPS_DFF_PWR_CLK = 0;\ |
ee12b079 | 235:c127b15409b2 | 155 | wait_us(1);\ |
ee12b079 | 209:63e9c8f8b5d2 | 156 | } |
ee12b079 | 209:63e9c8f8b5d2 | 157 | |
ee12b079 | 209:63e9c8f8b5d2 | 158 | void SW_ON_V_A_EN() |
ee12b079 | 209:63e9c8f8b5d2 | 159 | { |
chaithanyarss | 249:1560c64adffb | 160 | V_A_EN = 1; |
ee12b079 | 209:63e9c8f8b5d2 | 161 | } |
ee12b079 | 209:63e9c8f8b5d2 | 162 | |
ee12b079 | 209:63e9c8f8b5d2 | 163 | void SW_OFF_V_A_EN() |
ee12b079 | 209:63e9c8f8b5d2 | 164 | { |
chaithanyarss | 249:1560c64adffb | 165 | V_A_EN = 0; |
ee12b079 | 209:63e9c8f8b5d2 | 166 | } |
ee12b079 | 209:63e9c8f8b5d2 | 167 | |
ee12b079 | 209:63e9c8f8b5d2 | 168 | void RST_SD() |
ee12b079 | 209:63e9c8f8b5d2 | 169 | { |
ee12b079 | 235:c127b15409b2 | 170 | SD_SW_EN_DS = 1; |
ee12b079 | 209:63e9c8f8b5d2 | 171 | wait_ms(10); |
ee12b079 | 209:63e9c8f8b5d2 | 172 | SD_SW_EN_DS = 0; |
ee12b079 | 235:c127b15409b2 | 173 | } |
ee12b079 | 235:c127b15409b2 | 174 | |
ee12b079 | 235:c127b15409b2 | 175 | void SW_RST_BAE() |
ee12b079 | 235:c127b15409b2 | 176 | { |
ee12b079 | 235:c127b15409b2 | 177 | BAE_SW_EN_DS = 1; |
ee12b079 | 235:c127b15409b2 | 178 | wait_ms(10); |
ee12b079 | 235:c127b15409b2 | 179 | BAE_SW_EN_DS = 0; |
ee12b079 | 235:c127b15409b2 | 180 | } |
ee12b079 | 235:c127b15409b2 | 181 | |
ee12b079 | 235:c127b15409b2 | 182 | void SW_RST_PL_BEE() |
ee12b079 | 235:c127b15409b2 | 183 | { |
ee12b079 | 235:c127b15409b2 | 184 | PYLD_DFF = 1; |
ee12b079 | 235:c127b15409b2 | 185 | wait_ms(10); |
ee12b079 | 235:c127b15409b2 | 186 | PYLD_DFF = 0; |
ee12b079 | 209:63e9c8f8b5d2 | 187 | } |
ee12b079 | 209:63e9c8f8b5d2 | 188 | |
ee12b079 | 209:63e9c8f8b5d2 | 189 | void RST_BAE() |
ee12b079 | 209:63e9c8f8b5d2 | 190 | { |
ee12b079 | 235:c127b15409b2 | 191 | RESET_TO_BAE = 1; |
ee12b079 | 209:63e9c8f8b5d2 | 192 | wait_ms(10); |
ee12b079 | 235:c127b15409b2 | 193 | RESET_TO_BAE = 0; |
ee12b079 | 209:63e9c8f8b5d2 | 194 | } |
ee12b079 | 209:63e9c8f8b5d2 | 195 | |
ee12b079 | 209:63e9c8f8b5d2 | 196 | void RST_PL_BEE() |
ee12b079 | 209:63e9c8f8b5d2 | 197 | { |
ee12b079 | 235:c127b15409b2 | 198 | RESET_TO_PYLD = 1; |
ee12b079 | 209:63e9c8f8b5d2 | 199 | wait_ms(10); |
ee12b079 | 235:c127b15409b2 | 200 | RESET_TO_PYLD = 0; |
ee12b079 | 235:c127b15409b2 | 201 | } |
ee12b079 | 235:c127b15409b2 | 202 | |
ee12b079 | 235:c127b15409b2 | 203 | void CDMS_INTERNAL_RESET() |
ee12b079 | 235:c127b15409b2 | 204 | { |
ee12b079 | 235:c127b15409b2 | 205 | NVIC_SystemReset(); |
ee12b079 | 235:c127b15409b2 | 206 | } |
ee12b079 | 235:c127b15409b2 | 207 | |
ee12b079 | 235:c127b15409b2 | 208 | void SYS_PWR_RESET() // Have to be decided with EPS team. |
ee12b079 | 235:c127b15409b2 | 209 | { |
chaithanyarss | 249:1560c64adffb | 210 | /*sys_pwr_rst = 0; |
chaithanyarss | 249:1560c64adffb | 211 | wait_ms(10); |
chaithanyarss | 249:1560c64adffb | 212 | sys_pwr_rst = 1;*/ |
ee12b079 | 235:c127b15409b2 | 213 | } |
ee12b079 | 235:c127b15409b2 | 214 | |
ee12b079 | 235:c127b15409b2 | 215 | void EPS_V_A_EN() // This is a reset function |
ee12b079 | 235:c127b15409b2 | 216 | { |
chaithanyarss | 249:1560c64adffb | 217 | V_A_EN = 0; |
ee12b079 | 235:c127b15409b2 | 218 | wait_ms(10); |
chaithanyarss | 249:1560c64adffb | 219 | V_A_EN = 1; |
ee12b079 | 235:c127b15409b2 | 220 | } |
ee12b079 | 235:c127b15409b2 | 221 | |
ee12b079 | 235:c127b15409b2 | 222 | void EPS_V_C_EN() // This is a reset function |
ee12b079 | 235:c127b15409b2 | 223 | { |
ee12b079 | 235:c127b15409b2 | 224 | COM_RX_CNTRL = 0; |
ee12b079 | 235:c127b15409b2 | 225 | wait_ms(10); |
ee12b079 | 235:c127b15409b2 | 226 | COM_RX_CNTRL = 1; |
ee12b079 | 209:63e9c8f8b5d2 | 227 | } |
ee12b079 | 209:63e9c8f8b5d2 | 228 | |
ee12b079 | 209:63e9c8f8b5d2 | 229 | void RST_HK_COUNTER() |
ee12b079 | 209:63e9c8f8b5d2 | 230 | { |
ee12b079 | 209:63e9c8f8b5d2 | 231 | firstCount = true; |
ee12b079 | 209:63e9c8f8b5d2 | 232 | } |
ee12b079 | 209:63e9c8f8b5d2 | 233 | |
ee12b079 | 209:63e9c8f8b5d2 | 234 | uint8_t CDMS_RD_SD_HK(uint8_t *sd_statusbits) |
ee12b079 | 209:63e9c8f8b5d2 | 235 | { |
ee12b079 | 209:63e9c8f8b5d2 | 236 | uint8_t p; |
ee12b079 | 209:63e9c8f8b5d2 | 237 | uint8_t ACK; |
ee12b079 | 209:63e9c8f8b5d2 | 238 | if(SD_SW_EN_DS != DEVICE_POWERED) |
ee12b079 | 209:63e9c8f8b5d2 | 239 | { |
ee12b079 | 209:63e9c8f8b5d2 | 240 | ACK = 0x89; |
ee12b079 | 209:63e9c8f8b5d2 | 241 | SD_RD_ERROR = 1; |
ee12b079 | 209:63e9c8f8b5d2 | 242 | //Generate TM |
ee12b079 | 209:63e9c8f8b5d2 | 243 | } |
ee12b079 | 209:63e9c8f8b5d2 | 244 | else |
ee12b079 | 209:63e9c8f8b5d2 | 245 | { |
ee12b079 | 209:63e9c8f8b5d2 | 246 | p = disk_read_statusbits(sd_statusbits); |
ee12b079 | 209:63e9c8f8b5d2 | 247 | if(p == 0) |
ee12b079 | 209:63e9c8f8b5d2 | 248 | ACK = 0xA0; |
ee12b079 | 209:63e9c8f8b5d2 | 249 | else |
ee12b079 | 209:63e9c8f8b5d2 | 250 | ACK = 0x89; |
ee12b079 | 209:63e9c8f8b5d2 | 251 | } |
ee12b079 | 209:63e9c8f8b5d2 | 252 | return ACK; |
ee12b079 | 209:63e9c8f8b5d2 | 253 | } |
ee12b079 | 209:63e9c8f8b5d2 | 254 | |
ee12b079 | 235:c127b15409b2 | 255 | void CDMS_RD_RTC(uint64_t *time) |
ee12b079 | 235:c127b15409b2 | 256 | { |
ee12b079 | 235:c127b15409b2 | 257 | *time = FCTN_CDMS_RD_RTC(); |
ee12b079 | 235:c127b15409b2 | 258 | } |
ee12b079 | 235:c127b15409b2 | 259 | |
ee12b079 | 235:c127b15409b2 | 260 | void CDMS_CALIB_RTC() |
ee12b079 | 235:c127b15409b2 | 261 | { |
ee12b079 | 235:c127b15409b2 | 262 | |
ee12b079 | 235:c127b15409b2 | 263 | } |
ee12b079 | 235:c127b15409b2 | 264 | |
chaithanyarss | 224:3ac1f91e0ebc | 265 | void CDMS_RESET() |
chaithanyarss | 224:3ac1f91e0ebc | 266 | { |
chaithanyarss | 224:3ac1f91e0ebc | 267 | NVIC_SystemReset(); |
chaithanyarss | 224:3ac1f91e0ebc | 268 | } |
chaithanyarss | 224:3ac1f91e0ebc | 269 | |
ee12b079 | 235:c127b15409b2 | 270 | /* |
ee12b079 | 235:c127b15409b2 | 271 | //void CDMS_INTERNAL_RESET() |
ee12b079 | 209:63e9c8f8b5d2 | 272 | { |
ee12b079 | 209:63e9c8f8b5d2 | 273 | |
ee12b079 | 235:c127b15409b2 | 274 | } |
chaithanyarss | 248:407ab7e337cd | 275 | */ |
chaithanyarss | 248:407ab7e337cd | 276 | |
chaithanyarss | 248:407ab7e337cd | 277 | |
chaithanyarss | 248:407ab7e337cd | 278 | /*===================================================MMS Functions=================================================*/ |
chaithanyarss | 248:407ab7e337cd | 279 | |
chaithanyarss | 249:1560c64adffb | 280 | void WRITE_TO_FLASH(uint8_t *); |
chaithanyarss | 248:407ab7e337cd | 281 | |
chaithanyarss | 249:1560c64adffb | 282 | void WRITE_TO_FLASH(uint8_t *flash) |
chaithanyarss | 248:407ab7e337cd | 283 | { |
chaithanyarss | 249:1560c64adffb | 284 | uint32_t FLASH[5]; |
chaithanyarss | 249:1560c64adffb | 285 | FLASH[0] = ((uint32_t)flash[0] << 24) | ((uint32_t)flash[1] << 16) | ((uint32_t)flash[2] << 8) | ((uint32_t)flash[3]); |
chaithanyarss | 249:1560c64adffb | 286 | FLASH[1] = ((uint32_t)flash[4] << 24) | ((uint32_t)flash[5] << 16) | ((uint32_t)flash[6] << 8) | ((uint32_t)flash[7]); |
chaithanyarss | 249:1560c64adffb | 287 | FLASH[2] = ((uint32_t)flash[8] << 24) | ((uint32_t)flash[9] << 16) | ((uint32_t)flash[10] << 8) | ((uint32_t)flash[11]); |
chaithanyarss | 249:1560c64adffb | 288 | FLASH[3] = ((uint32_t)flash[12] << 24) | ((uint32_t)flash[13] << 16) | ((uint32_t)flash[14] << 8) | ((uint32_t)flash[15]); |
chaithanyarss | 249:1560c64adffb | 289 | FLASH[4] = ((uint32_t)flash[16] << 24) | ((uint32_t)flash[17] << 16) | ((uint32_t)flash[18] << 8) | ((uint32_t)flash[19]); |
chaithanyarss | 249:1560c64adffb | 290 | erase_sector(strt_add); |
chaithanyarss | 249:1560c64adffb | 291 | program_flash(strt_add, (char*)FLASH,160); |
chaithanyarss | 249:1560c64adffb | 292 | } |