mirror of
https://github.com/rene-dev/stmbl.git
synced 2026-09-28 15:49:03 +08:00
removed old stuff, fixed system type
This commit is contained in:
+10
-6
@@ -37,9 +37,7 @@ GLOBAL_HAL_PIN(frt_time);
|
||||
GLOBAL_HAL_PIN(rt_period_time);
|
||||
GLOBAL_HAL_PIN(frt_period_time);
|
||||
|
||||
int __errno;
|
||||
volatile double systime_s = 0.0;
|
||||
void Wait(unsigned int ms);
|
||||
void Wait(uint32_t ms);
|
||||
|
||||
//hal interface
|
||||
void enable_rt(){
|
||||
@@ -59,6 +57,13 @@ extern char _binary_obj_hv_hv_bin_start;
|
||||
extern char _binary_obj_hv_hv_bin_size;
|
||||
extern char _binary_obj_hv_hv_bin_end;
|
||||
|
||||
volatile uint64_t systime = 0;
|
||||
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
systime++;
|
||||
}
|
||||
|
||||
//20kHz
|
||||
void TIM2_IRQHandler(void){
|
||||
TIM_ClearITPendingBit(TIM2,TIM_IT_Update);
|
||||
@@ -140,7 +145,6 @@ void DMA2_Stream0_IRQHandler(void){
|
||||
}
|
||||
|
||||
float period = ((float)(last_start - start)) / RCC_Clocks.HCLK_Frequency;
|
||||
systime_s += period;
|
||||
last_start = start;
|
||||
|
||||
for(hal.active_rt_func = 0; hal.active_rt_func < hal.rt_func_count; hal.active_rt_func++){//run all realtime hal functions
|
||||
@@ -336,8 +340,8 @@ int main(void)
|
||||
}
|
||||
}
|
||||
|
||||
void Wait(unsigned int ms){
|
||||
volatile unsigned int t = systime + ms;
|
||||
void Wait(uint32_t ms){
|
||||
uint64_t t = systime + ms;
|
||||
while(t >= systime){
|
||||
}
|
||||
}
|
||||
|
||||
+1
-7
@@ -25,9 +25,8 @@ void setup(){
|
||||
|
||||
setup_res();
|
||||
usb_init();
|
||||
// systick timer
|
||||
systime = 0;
|
||||
|
||||
// systick timer
|
||||
RCC_GetClocksFreq(&RCC_Clocks);
|
||||
SysTick_Config(RCC_Clocks.HCLK_Frequency / 1000);
|
||||
//systick prio
|
||||
@@ -135,8 +134,3 @@ void setup_res(){
|
||||
|
||||
DMA_ITConfig(DMA2_Stream0, DMA_IT_TC, ENABLE);
|
||||
}
|
||||
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
systime++;
|
||||
}
|
||||
|
||||
@@ -27,10 +27,6 @@
|
||||
|
||||
void setup(void);
|
||||
void setup_res(void);
|
||||
void setup_usb(void);
|
||||
void SysTick_Handler(void);
|
||||
|
||||
volatile unsigned long systime;
|
||||
|
||||
volatile uint32_t ADC_DMA_Buffer[ADC_ANZ * PID_WAVES];
|
||||
|
||||
@@ -38,8 +34,6 @@ TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
|
||||
TIM_OCInitTypeDef TIM_OCInitStructure;
|
||||
NVIC_InitTypeDef NVIC_InitStructure;
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
DAC_InitTypeDef DAC_InitStructure;
|
||||
DMA_InitTypeDef DMA_InitStructure;
|
||||
ADC_InitTypeDef ADC_InitStructure;
|
||||
RCC_ClocksTypeDef RCC_Clocks;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user