diff --git a/UAV-ControlSystem/inc/drivers/system_clock.h b/UAV-ControlSystem/inc/drivers/system_clock.h index 8538130..9680a0d 100644 --- a/UAV-ControlSystem/inc/drivers/system_clock.h +++ b/UAV-ControlSystem/inc/drivers/system_clock.h @@ -15,6 +15,7 @@ #ifndef DRIVERS_SYSTEM_CLOCK_H_ #define DRIVERS_SYSTEM_CLOCK_H_ +#include "stm32f4xx.h" /*********************************************************************** * BRIEF: Starts the system clock at 100MHz * diff --git a/UAV-ControlSystem/src/drivers/system_clock.c b/UAV-ControlSystem/src/drivers/system_clock.c index 87b32e3..44510b9 100644 --- a/UAV-ControlSystem/src/drivers/system_clock.c +++ b/UAV-ControlSystem/src/drivers/system_clock.c @@ -8,8 +8,7 @@ * -------- ---- ----------- * **************************************************************************/ -#include -#include "stm32f4xx.h" +#include "drivers/system_clock.h" //the number of clock cycles per microsecond static uint32_t usTicks = 0; @@ -18,7 +17,7 @@ static uint32_t usTicks = 0; * BRIEF: Starts the system clock at 100MHz * * INFORMATION: In the current version it works with ADC and DMA * ***********************************************************************/ -void SystemClock_Config(void) +void system_clock_config(void) { RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct; @@ -69,13 +68,13 @@ uint32_t clock_get_us() //make sure that the system tick interrupt does not happen during the time we fetch microsecond from the register do { - ms = get_ms(); + ms = clock_get_ms(); cycle_cnt = SysTick->VAL; //If the SysTick timer expired during the previous instruction, we need to give it a little time for that //interrupt to be delivered before we can recheck sysTickUptime: asm volatile("\tnop\n"); - } while (ms != get_ms()); + } while (ms != clock_get_ms()); assert_param(us >= 1000);