int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration----------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* Configure the system clock */ SystemClock_Config(); /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_DMA_Init(); MX_SPI1_Init(); MX_TIM2_Init(); MX_TIM3_Init(); MX_TIM7_Init(); MX_TIM10_Init(); MX_TIM11_Init(); MX_TIM13_Init(); MX_TIM14_Init(); MX_USART1_UART_Init(); MX_USART2_UART_Init(); /* USER CODE BEGIN 2 */ HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1); //Motor1 HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4); //Motor2 HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_1); //Motor3 HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_4); //Motor4 /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ }
int main(void) { /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* Configure the system clock */ SystemClock_Config(); /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_DMA_Init(); MX_ADC1_Init(); MX_I2C1_Init(); MX_TIM10_Init(); MX_TIM11_Init(); MX_USART1_UART_Init(); xTaskCreate(task_safety, "Safety", 350, NULL, 1, NULL); xTaskCreate(task_master, "Master", 350, NULL, 1, NULL); xTaskCreate(task_control, "Control", 1000, NULL, 3, NULL); xTaskCreate(task_test, "Test", 500, NULL, 4, NULL); update_coefficients_QUEUE = xQueueCreate(3, sizeof(uint8_t)); control_sig_QUEUE = xQueueCreate(3, sizeof(int16_t));; vSemaphoreCreateBinary(testing_SEMAPHORE); vSemaphoreCreateBinary(data_SEMAPHORE); osKernelStart(); /* We should never get here as control is now taken by the scheduler */ /* Infinite loop */ while (1) { } }
int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration----------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* Configure the system clock */ SystemClock_Config(); /* System interrupt init*/ /* Sets the priority grouping field */ HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_1); HAL_NVIC_SetPriority(SysTick_IRQn, 0, 1); /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_DMA_Init(); MX_ADC1_Init(); MX_I2C1_Init(); MX_TIM1_Init(); MX_TIM3_Init(); MX_TIM4_Init(); MX_TIM6_Init(); MX_TIM7_Init(); MX_TIM8_Init(); MX_TIM10_Init(); MX_USART3_UART_Init(); /* USER CODE BEGIN 2 */ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, SET); /* USER CODE END 2 */ /* USER CODE BEGIN 3 */ // test_Expander(); ssd1306Init(0); test_Telemeters(); ADXRS620_Init(); TimesBase_Init(); test_Encoders(); Straight_Control_Start(GYRO); test_Beeper(); Led_Power_Blink(990, 10, 0); //test_Gyro(); Debug_ADXRS620(); //Debug_Straight_Control(); while(1); // test_Encoders(); // test_Vbat(); // test_EasterEgg(); //test_Gyro(); // test_Motor_Move(); // test_Motors(); // test_Telemeters(); // HAL_Delay(1000); // test_LineSensors(); // test_Oled(); // test_IR_Sensors(); /* USER CODE END 3 */ }