# HG changeset patch # User Dmitry Romanov # Date 1543235152 -10800 # Node ID 6a2308b9a3d4980ed98f194fec01e43b39e57258 # Parent 01169b86f9c639998e51610322a974945957f462 Config for debug data diff -r 01169b86f9c6 -r 6a2308b9a3d4 Discovery/Inc/global_constants.h --- a/Discovery/Inc/global_constants.h Mon Nov 26 13:58:51 2018 +0300 +++ b/Discovery/Inc/global_constants.h Mon Nov 26 15:25:52 2018 +0300 @@ -35,4 +35,8 @@ #define MAX_BUTTONRESPONSIVENESS MAX_BUTTONRESPONSIVENESS_GUI+20//MIN_BUTTONRESPONSIVENESS_GUI+20correction #define BUTTON_DEBOUNCE_DELAY 7 //Delay for debounce filter for piezo buttons + +//Spi sync data debug +#define SPI_SHOW_SYNC_STATS 1 +#define SPI_MIN_ERROR_SHOW 2 #endif diff -r 01169b86f9c6 -r 6a2308b9a3d4 Discovery/Src/data_exchange_main.c --- a/Discovery/Src/data_exchange_main.c Mon Nov 26 13:58:51 2018 +0300 +++ b/Discovery/Src/data_exchange_main.c Mon Nov 26 15:25:52 2018 +0300 @@ -167,7 +167,7 @@ void DataEX_init(void) { SDiveState * pStateReal = stateRealGetPointerWrite(); - pStateReal->data_old__lost_connection_to_slave = 1; + pStateReal->data_old__lost_connection_to_slave = 0; //initial value data_old__lost_connection_to_slave_counter_temp = 0; data_old__lost_connection_to_slave_counter_total = 0; diff -r 01169b86f9c6 -r 6a2308b9a3d4 Discovery/Src/tHome.c --- a/Discovery/Src/tHome.c Mon Nov 26 13:58:51 2018 +0300 +++ b/Discovery/Src/tHome.c Mon Nov 26 15:25:52 2018 +0300 @@ -436,27 +436,27 @@ uint8_t tHome_show_lost_connection_count(GFX_DrawCfgScreen *ScreenToWriteOn) { -// return 0; - -// if(!DataEX_lost_connection_count()) return 0; + if(!SPI_MIN_ERROR_SHOW) return 0; + if(DataEX_lost_connection_count()>=SPI_MIN_ERROR_SHOW){ - char text[10]; -// if(get_DataEX_Error_place()) last_place=get_DataEX_Error_place(); + char text[64]; -// if(get_DataEX_Error_Handler()) last_err=get_DataEX_Error_Handler(); SDataExchangeSlaveToMaster* dataIn=get_dataInPointer(); - snprintf(text,10,"spi:\002%i",DataEX_lost_connection_count()); - Gfx_write_label_var(ScreenToWriteOn, 600,800, 0,&FontT24,CLUT_ButtonSymbols,text); + snprintf(text,32,"spi err:\002 %i/%i",DataEX_lost_connection_count(),get_num_SPI_CALLBACKS()); + Gfx_write_label_var(ScreenToWriteOn, 100,300, 0,&FontT24,CLUT_ButtonSymbols,text); - snprintf(text,10,"\002%X%X%X%X",dataIn->header.checkCode[0],dataIn->header.checkCode[1],dataIn->header.checkCode[2],dataIn->header.checkCode[3]); - Gfx_write_label_var(ScreenToWriteOn, 600,800, 30,&FontT24,CLUT_ButtonSymbols,text); + 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]); + Gfx_write_label_var(ScreenToWriteOn, 350,550, 0,&FontT24,CLUT_ButtonSymbols,text); - snprintf(text,10,"\002%X%X%X%X",dataIn->footer.checkCode[0],dataIn->footer.checkCode[1],dataIn->footer.checkCode[2],dataIn->footer.checkCode[3]); - Gfx_write_label_var(ScreenToWriteOn, 600,800, 60,&FontT24,CLUT_ButtonSymbols,text); + 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]); + Gfx_write_label_var(ScreenToWriteOn, 600,800, 0,&FontT24,CLUT_ButtonSymbols,text); + } - snprintf(text,10,"cpt:\002%i",get_num_SPI_CALLBACKS()); - Gfx_write_label_var(ScreenToWriteOn, 600,800, 90,&FontT24,CLUT_ButtonSymbols,text); + + +// snprintf(text,32,"cpt:\002%i",get_num_SPI_CALLBACKS()); +// Gfx_write_label_var(ScreenToWriteOn, 600,800, 90,&FontT24,CLUT_ButtonSymbols,text); // snprintf(text,10,"i2c:\002%i",get_DataEX_Error_place()); // Gfx_write_label_var(ScreenToWriteOn, 600,800, 90,&FontT24,CLUT_ButtonSymbols,text); diff -r 01169b86f9c6 -r 6a2308b9a3d4 ostc4pack/OSTC4_Firmware.bin Binary file ostc4pack/OSTC4_Firmware.bin has changed diff -r 01169b86f9c6 -r 6a2308b9a3d4 ostc4pack/OSTC4_firmware_upload.bin Binary file ostc4pack/OSTC4_firmware_upload.bin has changed