#include "iostm32f10xxB.h"
#include "stm32f10x_lib.h"
#include "main.h"
//rac
/* Includes ------------------------------------------------------------------*/
#include "iic.c"
#include "uart.c"
#include "plc.c"
#include "stm32f10x_it.c"
/* Private functions ---------------------------------------------------------*/
int main(void)
{
#ifdef DEBUG
debug();
#endif
//配置系统时钟
sys_config();
//配置 NVIC 和 Vector Table
NVIC_Configuration();
//配置使用的GPIO口
GPIO_Configuration();
//改变指定管脚的映射 GPIO_Remap_SWJ_JTAGDisable JTAG-DP 失能 + SW-DP使能
GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable , ENABLE);
xxdelay();
SysTick_Config();
I2C_EE_Init();
Analog_Configration();
DMA_Configration();
program = (unsigned char *)(0x0800C000);
UART0_setup();
// uart0_txptr = 0;
// uart0_txall = 2;
// COM0_OUT;
// USART1->DR = 0x55;
UART1_setup();
LED0_OFF;
LED1_OFF;
//主循环
plc_main();
}
#ifdef DEBUG
void assert_failed(u8* file, u32 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