From b2b08bf71b633ec8d18ec0297341ed1295c4a388 Mon Sep 17 00:00:00 2001 From: Klagarge Date: Sat, 16 Dec 2023 17:37:18 +0100 Subject: [PATCH] small polish on main.c --- Core/Src/main.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/Core/Src/main.c b/Core/Src/main.c index 7ae8935..a1e136e 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -132,10 +132,11 @@ int main(void) if(isTransmitDone){ isTransmitDone=0; - fps++; + fps++; HAL_GPIO_WritePin(CS_NOKIA_GPIO_Port, CS_NOKIA_Pin, GPIO_PIN_SET); NokiaGotoXY(0,0); HAL_GPIO_WritePin(CS_NOKIA_GPIO_Port, CS_NOKIA_Pin, GPIO_PIN_RESET); + #ifdef INTERRUPT HAL_SPI_Transmit_IT(&hspi2, gNokiaBuffer, gNokiaBufferSize); #endif @@ -143,7 +144,7 @@ int main(void) #ifdef DMA HAL_SPI_Transmit_DMA(&hspi2, gNokiaBuffer, gNokiaBufferSize); #endif - + ScreenSaver(); } newTick=HAL_GetTick(); @@ -153,27 +154,7 @@ int main(void) printf("FPS: %d\r\n",fps); fps=0; } - - -//Task 2 - /*while(HAL_DMA_GetState(&hdma_spi2_tx)!=HAL_DMA_STATE_READY){ - } - HAL_GPIO_WritePin(CS_NOKIA_GPIO_Port, CS_NOKIA_Pin, GPIO_PIN_SET); - NokiaGotoXY(0,0); - HAL_GPIO_WritePin(CS_NOKIA_GPIO_Port, CS_NOKIA_Pin, GPIO_PIN_RESET); - HAL_SPI_Transmit_DMA(&hspi2, gNokiaBuffer, gNokiaBufferSize); - fps++; - newTick=HAL_GetTick(); - - if(newTick-oldTick>1000){ - oldTick=newTick; - printf("FPS: %d\r\n",fps); - fps=0; - }*/ - - - - ScreenSaver(); + // NokiaUpdate();