// //TODO: // 1.小电极增加50Hz陷波电路 // 2.DAC改为16 Bit DAC // 3.DI输入增加电容 #include "main.h" #include "stm32_init.h" #include "MODBUS.H" #include "ctrl.h" #include "dac.h" #include "adc.h" int main(void) { __set_MSP (0x20002000); #ifdef RTT_PRINT initPrintf(); #endif UserInit(); // Cal_K_And_C(100.0f,101.01f); // Cal_K_And_C(200.0f,202.23f); //MoveSamplePos(2); while(1) { TaskProc(); } } RCC_ClocksTypeDef RCC_Clocks; void UserInit(void) { __NOP(); RCC_GetClocksFreq(&RCC_Clocks) ; stm32_Init(); InitEncoder(); InitPort(); //初始化输出端口 Delay(1000); InitIED(); InitAD(); #ifndef USE_FULL_ASSERT #endif Beep(1,1000); InitDAC(); InitIntegrator(); //初始化积分器 StopDJ( ); InitFuzzy(); //MovMotor(POS_PUT_SAMPLE); InitModbus(); //初始化通信接口 ///////////////// //JB(TRUE); //Pumb(TRUE); StopAllTimer(); Beep(1,100); Init_task_timer(); //初始化SYSTICK RCC_GetClocksFreq(&RCC_Clocks) ; } #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 */ __NOP(); while (1) { } } #endif