diff Common/Inc/global_constants.h @ 208:9fc06e1e0f66 ImprovmentSPI

Update SPI error display and handling For easier identification of a communication problem the RX state of Main and RTE is displayed in the debug view. Also error reactions are now handles based on this state. E.g. RTE resets its DMA incase Main reports a data shift which can not be resolved by Main itself In addition the timeout for error detection has been decreased to have a faster reaction
author ideenmodellierer
date Sun, 24 Mar 2019 22:57:28 +0100
parents c659fda83e44
children a6c0375bc950
line wrap: on
line diff
--- a/Common/Inc/global_constants.h	Sun Mar 24 22:53:17 2019 +0100
+++ b/Common/Inc/global_constants.h	Sun Mar 24 22:57:28 2019 +0100
@@ -40,10 +40,14 @@
 #define SPI_SHOW_SYNC_STATS 0
 #define SPI_MIN_ERROR_SHOW 10
 
-// SPI header by index used for synchronization check (package sequence counter)
-#define SPI_HEADER_INDEX_MASTER 1
-#define SPI_HEADER_INDEX_SLAVE 2
+/* Define INDEX for information exchanged within the header */
+#define SPI_HEADER_INDEX_RX_STATE  (1)
+#define SPI_HEADER_INDEX_FRAME_CNT (2)
 
+#define SPI_RX_STATE_OK 		(0)
+#define SPI_RX_STATE_SHIFTED	(1)
+#define SPI_RX_STATE_OFFLINE	(2)
+#define SPI_RX_STATE_INVALID	(3)
 
 //Text data
 #define TEXT_PRESSURE_UNIT "hPa"