diff Small_CPU/Src/spi.c @ 85:923c4566a2a1 kittz

increased interCPU baudrate, cpu2: i2c in SPI1 IRQ
author Dmitry Romanov <kitt@bk.ru>
date Wed, 21 Nov 2018 12:49:54 +0300
parents e6abbef57475
children 3db7389d49cc
line wrap: on
line diff
--- a/Small_CPU/Src/spi.c	Wed Nov 21 10:25:15 2018 +0300
+++ b/Small_CPU/Src/spi.c	Wed Nov 21 12:49:54 2018 +0300
@@ -140,7 +140,7 @@
   hspi1.Init.CLKPolarity 				= SPI_POLARITY_LOW;
   hspi1.Init.CLKPhase 					= SPI_PHASE_1EDGE;
   hspi1.Init.NSS 								= SPI_NSS_HARD_INPUT;//SPI_NSS_SOFT;
-  hspi1.Init.BaudRatePrescaler	= SPI_BAUDRATEPRESCALER_128;
+  hspi1.Init.BaudRatePrescaler	= SPI_BAUDRATEPRESCALER_64;
   hspi1.Init.FirstBit 					= SPI_FIRSTBIT_MSB;
   hspi1.Init.TIMode 						= SPI_TIMODE_DISABLED;
   hspi1.Init.CRCCalculation 		= SPI_CRCCALCULATION_DISABLED;//_DISABLED; _ENABLED;
@@ -188,7 +188,7 @@
 		hdma_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
 		hdma_tx.Init.MemDataAlignment    = DMA_MDATAALIGN_BYTE;
 		hdma_tx.Init.Mode                = DMA_NORMAL;
-		hdma_tx.Init.Priority            = DMA_PRIORITY_LOW;
+		hdma_tx.Init.Priority            = DMA_PRIORITY_VERY_HIGH;
 		hdma_tx.Init.FIFOMode            = DMA_FIFOMODE_DISABLE;         
 		hdma_tx.Init.FIFOThreshold       = DMA_FIFO_THRESHOLD_FULL;
 		hdma_tx.Init.MemBurst            = DMA_MBURST_INC4;
@@ -369,11 +369,11 @@
 	}
 	global.dataSendToMaster.power_on_reset = 0;
 	global.deviceDataSendToMaster.power_on_reset = 0;
-	if(global.dataUpdateIsNeeded)
-		{
-		scheduleSpecial_Evaluate_DataSendToSlave();
-		global.dataUpdateIsNeeded=0;
-		}
+//	if(global.dataUpdateIsNeeded)
+//		{
+	scheduleSpecial_Evaluate_DataSendToSlave();
+//		global.dataUpdateIsNeeded=0;
+//		}
 	SPI_Start_single_TxRx_with_Master();
   }
 }