Syrostan-MCU-C/Core/Src/User/user_main.c

29 lines
707 B
C
Raw Normal View History

2021-07-26 17:17:04 +08:00
#include "user_main.h"
int8_t fsmc_buf;
2021-07-27 09:58:57 +08:00
void user_setup()
2021-07-26 17:17:04 +08:00
{
flash_fpga();
// ethernet_init();
2021-07-26 17:17:04 +08:00
HAL_TIM_Base_Start_IT(&htim4);
HAL_TIM_Base_Start(&htim3);
eem_power_init();
uint8_t str[10] = "test";
HAL_UART_Transmit(&huart4, str, 5, 100);
2021-07-26 17:17:04 +08:00
}
2021-07-27 09:58:57 +08:00
void user_loop()
2021-07-26 17:17:04 +08:00
{
read_fsmc(0, (uint8_t*)&fsmc_buf);
// for (uint16_t i = 0; i < 65536; i++)
// {
// read_fsmc(i, fsmc_buf);
// HAL_Delay(1000);
// }
// fsmc_buf[0] = HAL_GPIO_ReadPin(GPIOD, GPIO_PIN_14);
// fsmc_buf[1] = HAL_GPIO_ReadPin(GPIOD, GPIO_PIN_15);
// fsmc_buf[2] = HAL_GPIO_ReadPin(GPIOD, GPIO_PIN_0);
// fsmc_buf[3] = HAL_GPIO_ReadPin(GPIOD, GPIO_PIN_1);
key_events();
2021-07-26 17:17:04 +08:00
}