用stm32F103和stm32F4寫俄羅斯方塊代碼有何不同
單片機源程序如下:
- #include "stm32f10x.h"
- #include "stm32_eval.h"
- #include "key.h"
- #include "app.h"
- #include "printf.h"
- #include "adc.h"
- #include "lcd.h"
- //#include "bmp.c"
- #include "backimg.c"
- #include "RussiaGame.h"
- #define GPIO_LED GPIOF
- #define RCC_APB2Periph_GPIO_LED RCC_APB2Periph_GPIOF
- extern __IO uint16_t ADCConvertedValue;
- extern __IO int sys_count;
- //extern u8 Image_Table[];
- /** @addtogroup STM32F10x_StdPeriph_Examples
- * @{
- */
- GPIO_InitTypeDef GPIO_InitStructure;
- /** @addtogroup EXTI_Example
- * @{
- */
- /* Private typedef -----------------------------------------------------------*/
- /* Private define ------------------------------------------------------------*/
- /* Private macro -------------------------------------------------------------*/
- /* Private variables ---------------------------------------------------------*/
- /* Private function prototypes -----------------------------------------------*/
- /* Private functions ---------------------------------------------------------*/
- /**
- * @brief Main program.
- * @param None
- * @retval None
- */
- extern u8 dis_tab_now[19][9];
- int main(void)
- {
- //int x=0,y=0;
-
- SystemInit();
- InitUsart1();
- STM3210E_LCD_Init();
- KeyInit();
- LedInit();
- RussiaGameInit();
- Printf("\r\nSysterm Init.");
- while (1)
- {
- SecondHandle();
- KeyHandle();
- ChicRusiaStatus();
- }
- }
- #ifdef USE_FULL_ASSERT
- /**
- * @brief Reports the name of the source file and the source line number
- * where the assert_param error has occurred.
- * @param file: pointer to the source file name
- * @param line: assert_param error line source number
- * @retval None
- */
- void assert_failed(uint8_t* file, uint32_t line)
- {
- /* User can add his own implementation to report the file name and line number,
- ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
- /* Infinite loop */
- while (1)
- {
- }
- }
- #endif
- /**
- * @}
- */
- /**
- * @}
- */
- /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/
復制代碼
所有資料51hei提供下載:
21.俄羅斯方塊.rar
(530.01 KB, 下載次數: 46)
2018-12-28 09:52 上傳
點擊文件名下載附件
俄羅斯方塊 下載積分: 黑幣 -5
|