Data_TPMS.c 16.6 KB
Newer Older
1
#include "Application.h"
2 3 4
#include "Data_TPMS\Data_TPMS.h"

_TPMS_Display TPMS;
李俭双's avatar
李俭双 committed
5 6
uint32_t LearnTime_Count = 0;
uint32_t LearnTime_Count1 = 0;
7
uint8_t Can_341_Flg = 0;
8 9
void Data_TPMS_KL30_Init ( void )
{
李俭双's avatar
李俭双 committed
10 11
    uint8_t TPMS_L[2] = {0,0};
    Data_User_EEPROM_Read(EM_MenuData_TPMS_LEARN, (uint32_t*)TPMS_L, 1u);
12 13
    MenuData.TPMS_Front_Learn = TPMS_L[0];
    MenuData.TPMS_Rear_Learn  = TPMS_L[1];
李俭双's avatar
李俭双 committed
14 15
    //MenuData.TPMS_Front_FirstLearn_Flag = TPMS_L[2];
    //MenuData.TPMS_Rear_FirstLearn_Flag  = TPMS_L[3];
16 17
    TPMS.Front_Press_Value = 0;
    TPMS.Rear_Press_Value  = 0;
李俭双's avatar
李俭双 committed
18

19 20 21
    TPMS.Front_TPMS_Valid  = 0;
    TPMS.Rear_TPMS_Valid   = 0;
    TPMS.TPMS_Warning      = 0;
22
    //TPMS.TPMS_Unit         = Get_Dis_Tpms_Unit();
23 24
    TPMS.TPMS_Front_Learn  = MenuData.TPMS_Front_Learn;
    TPMS.TPMS_Rear_Learn   = MenuData.TPMS_Rear_Learn;
李俭双's avatar
李俭双 committed
25 26
    TPMS.TPMS_Front_FirstLearn_Flag  = MenuData.TPMS_Front_FirstLearn_Flag;
    TPMS.TPMS_Rear_FirstLearn_Flag   = MenuData.TPMS_Rear_FirstLearn_Flag;
27 28

    TPMS.TPMS_LOST = 0;
29 30
    LearnTime_Count = 6001;
    LearnTime_Count1 = 6001;
31 32

    Can_341_Flg = 0;
33 34 35
}
void Data_TPMS_KL15_WAKE_UP_Init ( void )
{
李俭双's avatar
李俭双 committed
36 37
    uint8_t TPMS_L[2] = {0,0};
    Data_User_EEPROM_Read(EM_MenuData_TPMS_LEARN, (uint32_t*)TPMS_L, 1);
38 39
    MenuData.TPMS_Front_Learn = TPMS_L[0];
    MenuData.TPMS_Rear_Learn  = TPMS_L[1];
李俭双's avatar
李俭双 committed
40 41
    //MenuData.TPMS_Front_FirstLearn_Flag = TPMS_L[2];
    //MenuData.TPMS_Rear_FirstLearn_Flag  = TPMS_L[3];
42 43
    TPMS.TPMS_Front_Learn     = MenuData.TPMS_Front_Learn;
    TPMS.TPMS_Rear_Learn      = MenuData.TPMS_Rear_Learn;
李俭双's avatar
李俭双 committed
44 45
    TPMS.TPMS_Front_FirstLearn_Flag  = MenuData.TPMS_Front_FirstLearn_Flag;
    TPMS.TPMS_Rear_FirstLearn_Flag   = MenuData.TPMS_Rear_FirstLearn_Flag;
46 47

    TPMS.TPMS_LOST = 0;
48 49
    LearnTime_Count = 6001;
    LearnTime_Count1 = 6001;
50 51 52 53 54 55 56

    Can_341_Flg = 0;
}

void Can_341_Receive(void)
{
    Can_341_Flg = 1;
57 58 59 60 61 62
}

void Data_TPMS_Processing_Service ( void )
{
    uint16_t Front_TPMS = 0;
    uint16_t Rear_TPMS  = 0;
李俭双's avatar
李俭双 committed
63 64 65 66 67 68
    uint8_t  TPMS_L[2] = {0,0};
    
    if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x341_Msg_Count) != CAN_SIG_LOST) 
    {
        TPMS.TPMS_Front_Learn = Get_CAN_CH0_ID_341_Sig_Front_LearningStatus();
        TPMS.TPMS_Rear_Learn = Get_CAN_CH0_ID_341_Sig_Rear_LearningStatus();
69
        TPMS.TPMS_LOST = 1;
李俭双's avatar
李俭双 committed
70 71 72 73 74
    }
    else
    {
        TPMS.TPMS_Front_Learn = MenuData.TPMS_Front_Learn;
        TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
75
        TPMS.TPMS_LOST = 0;
李俭双's avatar
李俭双 committed
76 77 78 79 80
    }
       
    
    if(TPMS.TPMS_Front_Learn == 0x0)
    {        
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
        if(LearnTime_Count <= 6000)
        {
            LearnTime_Count++;

          TPMS.TPMS_Front_Learn = Unstudied;
          //LearnTime_Count = 0;
        }
        else
        {
            if(TPMS.TPMS_Front_Timeclean == 1)
            {
                LearnTime_Count = 0;
            }
            TPMS.TPMS_Front_Timeclean = 0;  
            if ((MenuData.TPMS_Front_Learn != 0x2) && (MenuData.TPMS_Front_Learn != 0x3) ) 
            {
                if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x341_Msg_Count) != CAN_SIG_LOST) 
                {
                    TPMS.TPMS_Front_Learn = LearningFailure;
                }
                else
                {
                    TPMS.TPMS_Front_Learn = MenuData.TPMS_Front_Learn;
                }
                
            }
            else
            {
                TPMS.TPMS_Front_Learn = MenuData.TPMS_Front_Learn;
            }
        }
李俭双's avatar
李俭双 committed
112 113
    }
    else if(TPMS.TPMS_Front_Learn == 0x1)
114
    { 
115 116 117 118 119
        if(TPMS.TPMS_Front_Timeclean == 0)
        {
            LearnTime_Count = 0;
        }
        TPMS.TPMS_Front_Timeclean = 1;        
李俭双's avatar
李俭双 committed
120 121 122 123 124 125 126 127 128
        if(LearnTime_Count <= 6000)
        {
            LearnTime_Count++;
            TPMS.TPMS_Front_Learn = Learning;
        }
        else
        {
            if ((MenuData.TPMS_Front_Learn != 0x2) && (MenuData.TPMS_Front_Learn != 0x3) ) 
            {
129 130 131 132 133 134 135 136
                if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x341_Msg_Count) != CAN_SIG_LOST) 
                {
                    TPMS.TPMS_Front_Learn = LearningFailure;
                }
                else
                {
                    TPMS.TPMS_Front_Learn = MenuData.TPMS_Front_Learn;
                }
李俭双's avatar
李俭双 committed
137 138 139 140 141 142 143 144 145 146 147 148
            }
            else
            {
                TPMS.TPMS_Front_Learn = MenuData.TPMS_Front_Learn;
            }
        }
    }
    else if (TPMS.TPMS_Front_Learn == 0x2)
    {
        LearnTime_Count = 0;
        if((Get_CAN_CH0_ID_373_Sig_Front_id() != 0) && (Get_CAN_CH0_ID_373_Sig_Front_id() != 0xFFFFFFFF))
        {
149 150
            TPMS.TPMS_Front_ID_Value = 1;
            //TPMS.TPMS_Front_Learn = LearningCompletion;
李俭双's avatar
李俭双 committed
151 152 153
        }
        else
        {
154
            TPMS.TPMS_Front_ID_Value = 0;
李俭双's avatar
李俭双 committed
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
        }
        
    }
    else if (TPMS.TPMS_Front_Learn == 0x3)
    {
        LearnTime_Count = 0;
        TPMS.TPMS_Front_Learn = LearningFailure;
    }
    else
    {
        LearnTime_Count = 0;
        TPMS.TPMS_Front_Learn = MenuData.TPMS_Front_Learn;
    }

    if(TPMS.TPMS_Rear_Learn == 0x0)
    {        
171 172
        if(LearnTime_Count1 <= 6000)
        {
173
            LearnTime_Count1 = 0;
李俭双's avatar
李俭双 committed
174
            TPMS.TPMS_Rear_Learn = Unstudied;
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
        }
        else
        {
            if(TPMS.TPMS_Rear_Timeclean == 1)
            {
                LearnTime_Count1 = 0;
            }
            TPMS.TPMS_Rear_Timeclean = 0; 
            if ((MenuData.TPMS_Rear_Learn != 0x2) && (MenuData.TPMS_Rear_Learn != 0x3) ) 
            {
                if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x341_Msg_Count) != CAN_SIG_LOST) 
                {
                    TPMS.TPMS_Rear_Learn = LearningFailure;
                }
                else
                {
                    TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
                }
            }
            else
            {
                TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
            }
        }
李俭双's avatar
李俭双 committed
199 200 201 202 203 204 205 206 207 208
    }
    else if(TPMS.TPMS_Rear_Learn == 0x1)
    {        
        if(LearnTime_Count1 <= 6000)
        {
            LearnTime_Count1++;
            TPMS.TPMS_Rear_Learn = Learning;
        }
        else
        {
209 210 211 212 213
            if(TPMS.TPMS_Rear_Timeclean == 0)
            {
                LearnTime_Count1 = 0;
            }
            TPMS.TPMS_Rear_Timeclean = 1; 
李俭双's avatar
李俭双 committed
214 215
            if ((MenuData.TPMS_Rear_Learn != 0x2) && (MenuData.TPMS_Rear_Learn != 0x3) )
            {
216 217 218 219 220 221 222 223
                if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x341_Msg_Count) != CAN_SIG_LOST) 
                {
                    TPMS.TPMS_Rear_Learn = LearningFailure;
                }
                else
                {
                    TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
                }
李俭双's avatar
李俭双 committed
224 225 226
            }
            else
            {
227
                TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
李俭双's avatar
李俭双 committed
228 229 230 231 232 233 234 235
            }
        }
    }
    else if (TPMS.TPMS_Rear_Learn == 0x2)
    {
        LearnTime_Count1 = 0;
        if((Get_CAN_CH0_ID_373_Sig_Rear_id() != 0) && (Get_CAN_CH0_ID_373_Sig_Rear_id() != 0xFFFFFFFF))
        {
236 237
            TPMS.TPMS_Rear_ID_Value = 1;
            //TPMS.TPMS_Rear_Learn = LearningCompletion;
李俭双's avatar
李俭双 committed
238 239 240
        }
        else
        {
241
            TPMS.TPMS_Rear_ID_Value = 0;
李俭双's avatar
李俭双 committed
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
        }
        
    }
    else if (TPMS.TPMS_Rear_Learn == 0x3)
    {
        LearnTime_Count1 = 0;
        TPMS.TPMS_Rear_Learn = LearningFailure;
    }
    else
    {
        LearnTime_Count1 = 0;
        TPMS.TPMS_Rear_Learn = MenuData.TPMS_Front_Learn;
    }
    

257 258
    if((TPMS.TPMS_Front_Learn != MenuData.TPMS_Front_Learn) || (TPMS.TPMS_Rear_Learn != MenuData.TPMS_Rear_Learn))
    {
李俭双's avatar
李俭双 committed
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
        if(TPMS.TPMS_Front_Learn != MenuData.TPMS_Front_Learn)
        {
            TPMS.TPMS_Front_FirstLearn_Flag = 1;
        }
        if(TPMS.TPMS_Rear_Learn != MenuData.TPMS_Rear_Learn)
        {
            TPMS.TPMS_Rear_FirstLearn_Flag = 1;
        }
         
        if((TPMS.TPMS_Front_Learn == 0x2) || (TPMS.TPMS_Front_Learn == 0x3))
        {
            MenuData.TPMS_Front_Learn = TPMS.TPMS_Front_Learn;
        }
        if((TPMS.TPMS_Rear_Learn == 0x2) || (TPMS.TPMS_Rear_Learn == 0x3))
        {
            MenuData.TPMS_Rear_Learn  = TPMS.TPMS_Rear_Learn;
        }
276 277 278 279 280 281 282 283
        if(((TPMS.TPMS_Front_Learn == 0x2) || (TPMS.TPMS_Front_Learn == 0x3)) && (TPMS.TPMS_Front_Learn != MenuData.TPMS_Front_Learn))
        {
            TPMS_L[0] = MenuData.TPMS_Front_Learn;
            TPMS_L[1] = MenuData.TPMS_Rear_Learn;            
            Data_User_EEPROM_Write(EM_MenuData_TPMS_LEARN, (uint32_t*)TPMS_L, 1u); 
            
        }
        if( ((TPMS.TPMS_Rear_Learn == 0x2) || (TPMS.TPMS_Rear_Learn == 0x3)) && (TPMS.TPMS_Rear_Learn != MenuData.TPMS_Rear_Learn))
李俭双's avatar
李俭双 committed
284 285 286 287 288 289 290
        {
            TPMS_L[0] = MenuData.TPMS_Front_Learn;
            TPMS_L[1] = MenuData.TPMS_Rear_Learn;            
            Data_User_EEPROM_Write(EM_MenuData_TPMS_LEARN, (uint32_t*)TPMS_L, 1u); 
            
        }
        
291
    }
李俭双's avatar
李俭双 committed
292

293
    //TPMS.TPMS_Unit      = Get_Dis_Tpms_Unit();
294 295
    Front_TPMS          = Get_CAN_CH0_ID_341_Sig_Front_Pressure();
    Rear_TPMS           = Get_CAN_CH0_ID_341_Sig_Rear_Pressure();
296

297 298 299 300 301 302 303 304 305 306 307 308 309 310
    if ( Common_Get_IG_Sts() == COMMON_POWER_ON )
    {
        if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x341_Msg_Count) == CAN_SIG_LOST)
        {
            TPMS.Front_TPMS_Valid  = 0;  //信号掉线,显示--
            TPMS.Rear_TPMS_Valid   = 0;  //信号掉线,显示--
            TPMS.Front_Press_Value = 0;
            TPMS.Rear_Press_Value  = 0;
            TPMS.TPMS_Warning      = 0;  //白灯
        }
        else
        {            
            if((Front_TPMS == 0xFF) || (Rear_TPMS == 0xFF))
            {
李俭双's avatar
李俭双 committed
311
                
312 313 314
                if((Front_TPMS == 0xFF) && (Rear_TPMS != 0xFF))
                {
                    TPMS.Front_TPMS_Valid  = 0;
李俭双's avatar
李俭双 committed
315
                    TPMS.Rear_TPMS_Valid   = 1;
316
                    TPMS.Front_Press_Value = 990;
317
                    TPMS.Rear_Press_Value  = Rear_TPMS * 2750;
318
                    TPMS.Rear_Press_Value  /= 102 ;
319
                    if(TPMS.Rear_Press_Value > 9900)
320
                    {
321
                        TPMS.Rear_Press_Value = 9900;
322
                    }
323
                    if(((TPMS.Rear_Press_Value + 50)< 1700) || ((TPMS.Rear_Press_Value + 50) > 2500))
324 325 326 327 328 329 330 331
                    {
                        TPMS.TPMS_Warning = 1;
                    }
                    else
                    {
                        TPMS.TPMS_Warning = 0;
                    }
                }
332
                else if ((Front_TPMS != 0xFF) && (Rear_TPMS == 0xFF))
333
                {
李俭双's avatar
李俭双 committed
334
                    TPMS.Front_TPMS_Valid  = 1;
335
                    TPMS.Rear_TPMS_Valid   = 0;
336
                    TPMS.Rear_Press_Value  = 990;
337
                    TPMS.Front_Press_Value = Front_TPMS *2750 ;
338
                    TPMS.Front_Press_Value  /= 102 ;
339
                    if(TPMS.Front_Press_Value > 9900)
340
                    {
341
                        TPMS.Front_Press_Value = 9900;
342
                    }
343
                    if(((TPMS.Front_Press_Value + 50) < 1700) || ((TPMS.Front_Press_Value + 50) > 2300))
344 345 346 347 348 349 350 351 352 353
                    {
                        TPMS.TPMS_Warning = 1;
                    }
                    else
                    {
                        TPMS.TPMS_Warning = 0;
                    }
                }
                else
                {
354 355
                    TPMS.Front_Press_Value = 9900;
                    TPMS.Rear_Press_Value = 9900;
356
                    TPMS.TPMS_Warning = 0;
357 358 359 360 361 362
                    TPMS.Front_TPMS_Valid  = 0;
                    TPMS.Rear_TPMS_Valid   = 0;
                }
            }
            else
            {
李俭双's avatar
李俭双 committed
363 364
                TPMS.Front_TPMS_Valid  = 1;
                TPMS.Rear_TPMS_Valid   = 1;
365
                TPMS.Front_Press_Value = Front_TPMS * 2750 ;                
366
                TPMS.Front_Press_Value  /= 102 ;
367
                if(TPMS.Front_Press_Value > 9900)
368
                {
369
                    TPMS.Front_Press_Value = 9900;
370 371
                }

372
                TPMS.Rear_Press_Value  = Rear_TPMS * 2750;                
373
                TPMS.Rear_Press_Value  /= 102 ;
374
                if(TPMS.Rear_Press_Value > 9900)
375
                {
376
                    TPMS.Rear_Press_Value = 9900;
377
                }
378
                if (((TPMS.Front_Press_Value + 50) < 1700) || ((TPMS.Front_Press_Value + 50) > 2300) || ((TPMS.Rear_Press_Value + 50) < 1700) || ((TPMS.Rear_Press_Value + 50) > 2500))
379 380 381 382 383 384 385 386 387 388
                {
                    TPMS.TPMS_Warning = 1;
                }
                else
                {
                    TPMS.TPMS_Warning = 0;
                }
            }
            
        }
李俭双's avatar
李俭双 committed
389
        if(TPMS.TPMS_Front_Learn == Unstudied)
390
        {
李俭双's avatar
李俭双 committed
391
            TPMS.TPMS_Front_FirstLearn_Flag = Unstudied;            
392
        }
李俭双's avatar
李俭双 committed
393
        else if(TPMS.TPMS_Front_Learn == Learning)
394
        {
李俭双's avatar
李俭双 committed
395
            TPMS.TPMS_Front_FirstLearn_Flag = Learning;            
396
        }
李俭双's avatar
李俭双 committed
397
        else if(TPMS.TPMS_Front_Learn == LearningCompletion)
398
        {
李俭双's avatar
李俭双 committed
399 400
            TPMS.TPMS_Front_FirstLearn_Flag = LearningCompletion;
            
401
        }
李俭双's avatar
李俭双 committed
402
        else if(TPMS.TPMS_Front_Learn == LearningFailure)
403
        {
李俭双's avatar
李俭双 committed
404
            TPMS.TPMS_Front_FirstLearn_Flag = LearningFailure;
405
            TPMS.Front_Press_Value = 9900;
406 407 408 409 410 411
        }
        else
        {
            ;
        }

李俭双's avatar
李俭双 committed
412
        if(TPMS.TPMS_Rear_Learn == Unstudied)
413
        {
李俭双's avatar
李俭双 committed
414
            TPMS.TPMS_Rear_FirstLearn_Flag = Unstudied;
415
        }
李俭双's avatar
李俭双 committed
416
        else if(TPMS.TPMS_Rear_Learn == Learning)
417
        {
李俭双's avatar
李俭双 committed
418
            TPMS.TPMS_Rear_FirstLearn_Flag = Learning;
419
        }
李俭双's avatar
李俭双 committed
420
        else if(TPMS.TPMS_Rear_Learn == LearningCompletion)
421
        {
李俭双's avatar
李俭双 committed
422 423
            TPMS.TPMS_Rear_FirstLearn_Flag = LearningCompletion;
            
424
        }
李俭双's avatar
李俭双 committed
425
        else if(TPMS.TPMS_Rear_Learn == LearningFailure)
426
        {
李俭双's avatar
李俭双 committed
427
            TPMS.TPMS_Rear_FirstLearn_Flag = LearningFailure;
428
            TPMS.Rear_Press_Value = 9900;
429 430 431 432 433 434
        }
        else
        {
            ;
        }

李俭双's avatar
李俭双 committed
435 436 437 438
        //if ((MenuData.TPMS_Rear_Learn != LearningCompletion) && (MenuData.TPMS_Front_Learn != LearningCompletion))
        //{
        //    TPMS.TPMS_Warning = 0;
        //}
439

440 441 442 443 444 445 446 447 448 449
    }
    else
    {
        TPMS.Front_TPMS_Valid  = 0;
        TPMS.Rear_TPMS_Valid   = 0; 
        TPMS.Front_Press_Value = 0;
        TPMS.Rear_Press_Value  = 0;
        TPMS.TPMS_Warning      = 0; 
    }
}
450
uint32_t Data_Bar_To_Psi (uint32_t bar)
451
{
452 453 454
    uint32_t Bar = 0;
    Bar = bar * 145;
    Bar /= 10;
455
    //Bar += 5;
456 457 458 459
    // bar *= 145;
    // bar /= 10;
    // bar += 5;    
    return Bar;
460
}
461 462

/*指示灯报警信号  0:白色常亮   1:黄色常亮*/
463 464 465 466
uint8_t Get_Led_TPMS_Waring (void)
{
    return TPMS.TPMS_Warning;
}
467

李俭双's avatar
李俭双 committed
468
/*0:无效,常显--  1:有效,按实际胎压数值显示  */
469 470 471 472 473 474 475 476
uint8_t Get_Front_TPMS_Sig_Vaild (void)
{
    return TPMS.Front_TPMS_Valid;
}
uint8_t Get_Rear_TPMS_Sig_Vaild (void)
{
    return TPMS.Rear_TPMS_Valid;
}
477 478 479 480 481 482 483 484 485

uint8_t Get_Front_TPMS_ID_Vaild (void)
{
    return TPMS.TPMS_Front_ID_Value;
}
uint8_t Get_Rear_TPMS_ID_Vaild (void)
{
    return TPMS.TPMS_Rear_ID_Value;
}
486
//10倍
487 488 489
uint16_t Get_Front_TPMS_Sig_Value (void)
{
    uint16_t value = 0;
490 491 492 493 494 495 496 497 498
    //if (TPMS.TPMS_Unit == 1)
    //{
    //    value = (Data_Bar_To_Psi(TPMS.Front_Press_Value) + 500) / 1000;
    //    if(value > 99)
    //    {
    //        value = 99;
    //    }
    //}
    //else
499
    {        
500 501
        value = TPMS.Front_Press_Value + 50;        
        value = value / 100;
502 503 504 505 506 507
    }
    return value;
}
uint16_t Get_Rear_TPMS_Sig_Value (void)
{
    uint16_t value = 0;
508 509 510 511 512 513 514 515 516 517
    //if (TPMS.TPMS_Unit == 1)
    //{
    //    value = (Data_Bar_To_Psi(TPMS.Rear_Press_Value) + 500) / 1000;
    //    if(value > 99)
    //    {
    //        value = 99;
    //    }
    //    
    //}
    //else
518
    {        
519 520
        value = TPMS.Rear_Press_Value + 50;        
        value = value / 100;        
521 522 523 524 525
    }
    return value;    
}
uint16_t Get_Rear_TPMS_TX (void)
{
526
    uint16_t value = 0;
527
    value = Data_Bar_To_Psi(TPMS.Rear_Press_Value) / 100;
528 529 530 531 532
    if(value > 990)
    {
        value = 990;
    }
    return value;
533 534 535
}
uint16_t Get_Front_TPMS_TX (void)
{
536
    uint16_t value = 0;
537
    value = Data_Bar_To_Psi(TPMS.Front_Press_Value) / 100;
538 539 540 541 542
    if(value > 990)
    {
        value = 990;
    }
    return value;
543
}
李俭双's avatar
李俭双 committed
544 545 546 547 548 549 550 551 552 553 554 555

/*前轮胎压学习结果 0-未学习“--”常显  1-学习中“--”闪烁  2-学习成功,正常显示数值  3-学习失败,闪烁显示最大值99*/
uint8_t Get_Front_FirstLearn_Flag (void)
{
    return TPMS.TPMS_Front_FirstLearn_Flag;
}
/*后轮胎压学习结果 0-未学习“--”常显  1-学习中“--”闪烁  2-学习成功,正常显示数值  3-学习失败,闪烁显示最大值99*/
uint8_t Get_Rear_FirstLearn_Flag (void)
{
    return TPMS.TPMS_Rear_FirstLearn_Flag;
}

556 557 558 559 560 561
/*获取0x341是否掉线  0-掉线  “--”闪烁   1-在线  获取学习结果进行显示*/
uint8_t Get_TPMS_CAN_LOST (void)
{
    return TPMS.TPMS_LOST ;
}