small polish on main.c

This commit is contained in:
Rémi Heredero 2023-12-16 17:37:18 +01:00
parent 103c7c0c2c
commit b2b08bf71b

View File

@ -132,10 +132,11 @@ int main(void)
if(isTransmitDone){ if(isTransmitDone){
isTransmitDone=0; isTransmitDone=0;
fps++; fps++;
HAL_GPIO_WritePin(CS_NOKIA_GPIO_Port, CS_NOKIA_Pin, GPIO_PIN_SET); HAL_GPIO_WritePin(CS_NOKIA_GPIO_Port, CS_NOKIA_Pin, GPIO_PIN_SET);
NokiaGotoXY(0,0); NokiaGotoXY(0,0);
HAL_GPIO_WritePin(CS_NOKIA_GPIO_Port, CS_NOKIA_Pin, GPIO_PIN_RESET); HAL_GPIO_WritePin(CS_NOKIA_GPIO_Port, CS_NOKIA_Pin, GPIO_PIN_RESET);
#ifdef INTERRUPT #ifdef INTERRUPT
HAL_SPI_Transmit_IT(&hspi2, gNokiaBuffer, gNokiaBufferSize); HAL_SPI_Transmit_IT(&hspi2, gNokiaBuffer, gNokiaBufferSize);
#endif #endif
@ -143,7 +144,7 @@ int main(void)
#ifdef DMA #ifdef DMA
HAL_SPI_Transmit_DMA(&hspi2, gNokiaBuffer, gNokiaBufferSize); HAL_SPI_Transmit_DMA(&hspi2, gNokiaBuffer, gNokiaBufferSize);
#endif #endif
ScreenSaver();
} }
newTick=HAL_GetTick(); newTick=HAL_GetTick();
@ -153,27 +154,7 @@ int main(void)
printf("FPS: %d\r\n",fps); printf("FPS: %d\r\n",fps);
fps=0; 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(); // NokiaUpdate();