Browse Source

fix:lcd刷屏有白点

alienwalker 3 years ago
parent
commit
11fcbbcc1c

+ 1 - 1
bsp/air105/hal/core_debug.c

@@ -102,7 +102,7 @@ void add_printf_data(uint8_t *data, uint32_t len)
 #ifdef __BUILD_APP__
 
 	uint32_t Critical = OS_EnterCritical();
-	configASSERT(prvDBGCtrl.InsertBusy == 0);
+	ASSERT(prvDBGCtrl.InsertBusy == 0);
 	prvDBGCtrl.InsertBusy = 1;
 	if ((prvDBGCtrl.LogBuffer.Pos + len) > prvDBGCtrl.LogBuffer.MaxLen)
 	{

+ 1 - 1
bsp/air105/hal/core_spi.c

@@ -70,7 +70,7 @@ typedef struct
 	const uint16_t DMARxChannel;
 	CBFuncEx_t Callback;
 	void *pParam;
-	HANDLE Sem;
+	volatile HANDLE Sem;
 	Buffer_Struct TxBuf;
 	Buffer_Struct RxBuf;
 	uint32_t Speed;

+ 2 - 1
bsp/air105/include/FreeRTOSConfig.h

@@ -180,7 +180,8 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
 /* Normal assert() semantics without relying on the provision of an assert.h
 header file. */
 //#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
-#if(defined(__DEBUG__) || defined(DEBUG))
+//#if(defined(__DEBUG__) || defined(DEBUG))
+#if 0
 #define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); DBG_Trace("\r\nassert %s,%d", __FUNCTION__, __LINE__); for( ;; ); }
 #else
 #define configASSERT( x )

+ 1 - 1
bsp/common/include/bsp_common.h

@@ -554,7 +554,7 @@ extern uint64_t GetSysTickMS();
 #define calloc OS_Calloc
 
 #ifndef ASSERT
-#if(defined(__DEBUG__) || defined(DEBUG))
+#if defined(__DEBUG__)
 #define ASSERT( x ) if( ( x ) == 0 ) { __disable_irq(); DBG_Trace("\r\nassert %s,%d", __FUNCTION__, __LINE__); for( ;; ); }
 #else
 #define ASSERT( x )

+ 5 - 2
bsp/common/src/core_service.c

@@ -141,6 +141,7 @@ static void prvLCD_Task(void* params)
 	PV_Union uPV;
 	uint16_t uColor[256];
 	uint32_t i, j, Size;
+	uint8_t CSPin;
 	for(i = 0; i < 256; i++)
 	{
 		uColor[i] = RGB888toRGB565(i, i, i, 1);
@@ -174,14 +175,16 @@ static void prvLCD_Task(void* params)
 //			SPI_Transfer(Draw->SpiID, Draw->Data, Draw->Data, Draw->Size, 2);
 
 			SPI_BlockTransfer(Draw->SpiID, Draw->Data, Draw->Data, Draw->Size);
-//			if (Draw->Size > 38000)
+
 //			{
 //				DBG("%u, %u", Draw->Size, (uint32_t)(GetSysTickUS() - StartUS));
 //			}
 			prvService.LCDDrawDoneByte += Draw->Size;
 			free(Draw->Data);
-			GPIO_Output(Draw->CSPin, 1);
+			CSPin = Draw->CSPin;
 			free(Draw);
+			GPIO_Output(CSPin, 1);
+
 			SPI_SetTxOnlyFlag(Draw->SpiID, 0);
 			break;
 		case SERVICE_CAMERA_DRAW: