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

@ -136,6 +136,7 @@ int main(void)
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,37 +144,17 @@ int main(void)
#ifdef DMA #ifdef DMA
HAL_SPI_Transmit_DMA(&hspi2, gNokiaBuffer, gNokiaBufferSize); HAL_SPI_Transmit_DMA(&hspi2, gNokiaBuffer, gNokiaBufferSize);
#endif #endif
}
newTick=HAL_GetTick();
if(newTick-oldTick>1000){
oldTick=newTick;
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(); ScreenSaver();
}
newTick=HAL_GetTick();
if(newTick-oldTick>1000){
oldTick=newTick;
printf("FPS: %d\r\n",fps);
fps=0;
}
// NokiaUpdate(); // NokiaUpdate();