Mercurial > public > ostc4
comparison Discovery/Src/tHome.c @ 209:2de856965c55
Merged in Ideenmodellierer/ostc4/ImprovmentSPI (pull request #9)
ImprovmentSPI
author | heinrichsweikamp <bitbucket@heinrichsweikamp.com> |
---|---|
date | Sun, 24 Mar 2019 22:09:37 +0000 |
parents | 9fc06e1e0f66 |
children | b2a9e9b02df0 |
comparison
equal
deleted
inserted
replaced
200:7116c0ffb862 | 209:2de856965c55 |
---|---|
423 return (uint8_t) snprintf(text,10,"%02i/%02i",oxygen_percentage,helium_percentage); | 423 return (uint8_t) snprintf(text,10,"%02i/%02i",oxygen_percentage,helium_percentage); |
424 } | 424 } |
425 | 425 |
426 uint8_t tHome_show_lost_connection_count(GFX_DrawCfgScreen *ScreenToWriteOn) | 426 uint8_t tHome_show_lost_connection_count(GFX_DrawCfgScreen *ScreenToWriteOn) |
427 { | 427 { |
428 static uint8_t LastKnowRTEState = SPI_RX_STATE_INVALID; | |
429 | |
428 if(!SPI_MIN_ERROR_SHOW) return 0; | 430 if(!SPI_MIN_ERROR_SHOW) return 0; |
429 if(DataEX_lost_connection_count()>=SPI_MIN_ERROR_SHOW && SPI_SHOW_SYNC_STATS){ | 431 if(DataEX_lost_connection_count()>=SPI_MIN_ERROR_SHOW && SPI_SHOW_SYNC_STATS){ |
430 | 432 |
431 char text[64]; | 433 char text[64]; |
432 | 434 |
433 SDataExchangeSlaveToMaster* dataIn=get_dataInPointer(); | 435 SDataExchangeSlaveToMaster* dataIn=get_dataInPointer(); |
436 SDataReceiveFromMaster* pDataOut = dataOutGetPointer(); | |
434 | 437 |
435 snprintf(text,32,"spi err:\002 %i/%i",DataEX_lost_connection_count(),get_num_SPI_CALLBACKS()); | 438 snprintf(text,32,"spi err:\002 %i/%i",DataEX_lost_connection_count(),get_num_SPI_CALLBACKS()); |
436 Gfx_write_label_var(ScreenToWriteOn, 100,300, 0,&FontT24,CLUT_ButtonSymbols,text); | 439 Gfx_write_label_var(ScreenToWriteOn, 100,300, 0,&FontT24,CLUT_ButtonSymbols,text); |
437 | 440 |
438 // snprintf(text,32,"header:\002%X%X%X%X",dataIn->header.checkCode[0],dataIn->header.checkCode[1],dataIn->header.checkCode[2],dataIn->header.checkCode[3]); | 441 // snprintf(text,32,"header:\002%X%X%X%X",dataIn->header.checkCode[0],dataIn->header.checkCode[1],dataIn->header.checkCode[2],dataIn->header.checkCode[3]); |
439 // Gfx_write_label_var(ScreenToWriteOn, 350,550, 0,&FontT24,CLUT_ButtonSymbols,text); | 442 // Gfx_write_label_var(ScreenToWriteOn, 350,550, 0,&FontT24,CLUT_ButtonSymbols,text); |
440 | 443 |
441 snprintf(text,32,"footer:\002%X%X%X%X",dataIn->footer.checkCode[0],dataIn->footer.checkCode[1],dataIn->footer.checkCode[2],dataIn->footer.checkCode[3]); | 444 //snprintf(text,32,"footer:\002%X%X%X%X",dataIn->footer.checkCode[0],dataIn->footer.checkCode[1],dataIn->footer.checkCode[2],dataIn->footer.checkCode[3]); |
445 | |
446 /* data shifted => ignore received data */ | |
447 if((pDataOut->header.checkCode[SPI_HEADER_INDEX_RX_STATE] == SPI_RX_STATE_SHIFTED) || (pDataOut->header.checkCode[SPI_HEADER_INDEX_RX_STATE] == SPI_RX_STATE_OFFLINE)) | |
448 { | |
449 dataIn->header.checkCode[SPI_HEADER_INDEX_RX_STATE] = LastKnowRTEState; | |
450 } | |
451 else | |
452 { | |
453 LastKnowRTEState =dataIn->header.checkCode[SPI_HEADER_INDEX_RX_STATE]; | |
454 } | |
455 snprintf(text,32,"RX State M|R:\002%X|%X",pDataOut->header.checkCode[SPI_HEADER_INDEX_RX_STATE], dataIn->header.checkCode[SPI_HEADER_INDEX_RX_STATE] ); | |
442 Gfx_write_label_var(ScreenToWriteOn, 600,800, 0,&FontT24,CLUT_ButtonSymbols,text); | 456 Gfx_write_label_var(ScreenToWriteOn, 600,800, 0,&FontT24,CLUT_ButtonSymbols,text); |
443 } | 457 } |
444 | 458 |
445 | 459 |
446 | 460 |