| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #include "bsp/bsp.h"
- #include "foc/foc_api.h"
- void system_init(void){
- HAL_Init();
- SystemClock_Config();
- HAL_GPIO_init();
- HAL_NVIC_Init();
- HAL_PWM_Init();
- HAL_ADC1_Init();
- HAL_EXIT_Enable();
- serial_init();
- TIM4_Init();
- }
- void system_reboot(void){
-
- }
- int get_hall_stat(int samples) {
- samples = 1 + 2 * samples;
- int h1 = 0, h2 = 0, h3 = 0;
- int tres = samples / 2;
- while (samples--) {
- h1 += READ_HALL1();
- h2 += READ_HALL2();
- h3 += READ_HALL3();
- }
- return (h1 > tres) | ((h2 > tres) << 1) | ((h3 > tres) << 2);
- }
- void normal_task_enable(bool enable) {
- TIM4_Enable_IRQ(enable);
- }
- void wdog_reload(void){
- #if CONFIG_DEBUG == 0
-
- #endif
- }
- void wdog_enable(void)
- {
- #if CONFIG_DEBUG == 0
- #endif
- }
|