comparison Small_CPU/Src/scheduler.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 4b000e2386c2
children 3328189786e7
comparison
equal deleted inserted replaced
487:0f5080f50ba7 488:9eeab3fead8f
638 638
639 // new hw 170523 639 // new hw 170523
640 if(global.I2C_SystemStatus != HAL_OK) 640 if(global.I2C_SystemStatus != HAL_OK)
641 { 641 {
642 MX_I2C1_TestAndClear(); 642 MX_I2C1_TestAndClear();
643 HAL_Delay(100);
644 I2C_DeInit();
645 HAL_Delay(100);
643 MX_I2C1_Init(); 646 MX_I2C1_Init();
647 HAL_Delay(100);
648
644 init_pressure(); 649 init_pressure();
645 } 650 }
646 } 651 }
647 if(ticksdiff >= 1000) 652 if(ticksdiff >= 1000)
648 { 653 {
874 879
875 /* check if I2C is not up an running and try to reactivate if necessary. Also do initialization if problem occured during startup */ 880 /* check if I2C is not up an running and try to reactivate if necessary. Also do initialization if problem occured during startup */
876 if(global.I2C_SystemStatus != HAL_OK) 881 if(global.I2C_SystemStatus != HAL_OK)
877 { 882 {
878 MX_I2C1_TestAndClear(); 883 MX_I2C1_TestAndClear();
884 HAL_Delay(100);
885 I2C_DeInit();
886 HAL_Delay(100);
879 MX_I2C1_Init(); 887 MX_I2C1_Init();
888 HAL_Delay(100);
889
880 if(global.I2C_SystemStatus == HAL_OK) 890 if(global.I2C_SystemStatus == HAL_OK)
881 { 891 {
882 init_pressure(); 892 init_pressure();
883 if(is_init_pressure_done()) /* Init surface data with initial measurement */ 893 if(is_init_pressure_done()) /* Init surface data with initial measurement */
884 { 894 {
1034 1044
1035 /* check if I2C is not up and running and try to reactivate if necessary. Also do initialization if problem occurred during startup */ 1045 /* check if I2C is not up and running and try to reactivate if necessary. Also do initialization if problem occurred during startup */
1036 if(global.I2C_SystemStatus != HAL_OK) 1046 if(global.I2C_SystemStatus != HAL_OK)
1037 { 1047 {
1038 MX_I2C1_TestAndClear(); 1048 MX_I2C1_TestAndClear();
1049 HAL_Delay(100);
1050 I2C_DeInit();
1051 HAL_Delay(100);
1039 MX_I2C1_Init(); 1052 MX_I2C1_Init();
1053 HAL_Delay(100);
1054
1040 1055
1041 if((global.I2C_SystemStatus == HAL_OK) && (!is_init_pressure_done())) 1056 if((global.I2C_SystemStatus == HAL_OK) && (!is_init_pressure_done()))
1042 { 1057 {
1043 init_pressure(); 1058 init_pressure();
1044 } 1059 }