comparison Small_CPU/Src/baseCPU2.c @ 488:9eeab3fead8f

Added "I2C_DeInit();" in hardware detection routines. It's the recommended way to do and solves potential issues with older OSTC4 hardware generations. Increased RTE and RTE required numbers updated "Current build"
author heinrichsweikamp
date Sat, 27 Jun 2020 18:40:32 +0200
parents edfc1a464b42
children 02e7e11fdbe8
comparison
equal deleted inserted replaced
487:0f5080f50ba7 488:9eeab3fead8f
162 162
163 // SHALL LOAD AT 0x08000000 + 0x00005000 = 0x08005000. 163 // SHALL LOAD AT 0x08000000 + 0x00005000 = 0x08005000.
164 // See CPU2-RTE.ld 164 // See CPU2-RTE.ld
165 const SFirmwareData cpu2_FirmwareData __attribute__(( section(".firmware_data") ))= { 165 const SFirmwareData cpu2_FirmwareData __attribute__(( section(".firmware_data") ))= {
166 .versionFirst = 2, 166 .versionFirst = 2,
167 .versionSecond = 3, 167 .versionSecond = 4,
168 .versionThird = 0, 168 .versionThird = 0,
169 .versionBeta = 0, 169 .versionBeta = 0,
170 170
171 /* 4 bytes with trailing 0 */ 171 /* 4 bytes with trailing 0 */
172 .signature = "mh", 172 .signature = "mh",
173 173
174 .release_year = 20, 174 .release_year = 20,
175 .release_month = 2, 175 .release_month = 6,
176 .release_day = 26, 176 .release_day = 30,
177 .release_sub = 0, 177 .release_sub = 0,
178 178
179 /* max 48 with trailing 0 */ 179 /* max 48 with trailing 0 */
180 //release_info ="12345678901234567890123456789012345678901" 180 //release_info ="12345678901234567890123456789012345678901"
181 .release_info = "stable Nov'19", 181 .release_info = "stable Nov'19",
312 if (global.I2C_SystemStatus != HAL_OK) 312 if (global.I2C_SystemStatus != HAL_OK)
313 { 313 {
314 if (MX_I2C1_TestAndClear() == GPIO_PIN_RESET) { 314 if (MX_I2C1_TestAndClear() == GPIO_PIN_RESET) {
315 MX_I2C1_TestAndClear(); // do it a second time 315 MX_I2C1_TestAndClear(); // do it a second time
316 } 316 }
317 HAL_Delay(100);
318 I2C_DeInit();
319 HAL_Delay(100);
317 MX_I2C1_Init(); 320 MX_I2C1_Init();
321 HAL_Delay(100);
318 } 322 }
319 323
320 324
321 325
322 //dangerous: TM_OTP_Write(0,0, 0x01); 326 //dangerous: TM_OTP_Write(0,0, 0x01);
326 if (global.I2C_SystemStatus != HAL_OK) 330 if (global.I2C_SystemStatus != HAL_OK)
327 { 331 {
328 if (MX_I2C1_TestAndClear() == GPIO_PIN_RESET) { 332 if (MX_I2C1_TestAndClear() == GPIO_PIN_RESET) {
329 MX_I2C1_TestAndClear(); // do it a second time 333 MX_I2C1_TestAndClear(); // do it a second time
330 } 334 }
335 HAL_Delay(100);
336 I2C_DeInit();
337 HAL_Delay(100);
331 MX_I2C1_Init(); 338 MX_I2C1_Init();
339 HAL_Delay(100);
332 global.sensorError[SENSOR_PRESSURE_ID] = init_pressure(); 340 global.sensorError[SENSOR_PRESSURE_ID] = init_pressure();
333 global.I2C_SystemStatus = global.sensorError[SENSOR_PRESSURE_ID]; 341 global.I2C_SystemStatus = global.sensorError[SENSOR_PRESSURE_ID];
334 } 342 }
335 343
336 global.dataSendToMaster.sensorErrors = 344 global.dataSendToMaster.sensorErrors =