修复延时函数初始化参数及中断向量表问题
This commit is contained in:
SEEKFREE_BUDING
2023-12-21 14:06:53 +08:00
parent 4a415c9976
commit 9fd45979e5
33 changed files with 352 additions and 280 deletions

View File

@@ -1,3 +1,5 @@
V3.2.5
<20>޸<EFBFBD><DEB8><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
V3.2.4
<20>Ż<EFBFBD><C5BB><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ϊ<EFBFBD>ж<EFBFBD><D0B6><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ر<EFBFBD><D8B1><EFBFBD><EFBFBD>ж<EFBFBD><D0B6><EFBFBD>Ϊ<EFBFBD><CEAA>ͨ<EFBFBD><CDA8>ʱ
<20>Ż<EFBFBD>ips114<31><34>Ļ<EFBFBD>ij<EFBFBD>ʼ<EFBFBD><CABC>ʱ<EFBFBD><EFBFBD>Ƴ<EFBFBD><C6B3><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ʱ

View File

@@ -57,10 +57,9 @@ IFX_INTERRUPT(stm0_isr, 0, IFX_INTPRIO_STM0_SR0)
IFX_INTERRUPT(stm1_isr, 0, IFX_INTPRIO_STM1_SR0)
{
interrupt_global_enable(0); // <20><><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>Ƕ<EFBFBD><C7B6>
IfxStm_clearCompareFlag(&MODULE_STM1, IfxStm_Comparator_1);
IfxStm_clearCompareFlag(&MODULE_STM1, IfxStm_Comparator_0);
stm1_isr_flag = 0;
}
//-------------------------------------------------------------------------------------------------------------------
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> system<65><6D>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
// <20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5> time <20><>ʱһ<CAB1>ֵ<EFBFBD>ʱ<EFBFBD><EFBFBD><E4A3A8>λΪ<CEBB><CEAA><EFBFBD><EFBFBD><EBA3AC><EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD>Χ0-20000000<30><30>
@@ -79,19 +78,23 @@ void system_delay_10ns (uint32 time)
}
else
{
if(stm_index == IfxStm_Index_0)
switch(stm_index)
{
Ifx_STM *stm_sfr = &MODULE_STM0;
stm_sfr->CMP[0].U = stm_sfr->TIM0.U + time;
stm0_isr_flag = 1;
while(stm0_isr_flag);
}
else if(stm_index == IfxStm_Index_1)
{
Ifx_STM *stm_sfr = &MODULE_STM1;
stm_sfr->CMP[1].U = stm_sfr->TIM0.U + time;
stm1_isr_flag = 1;
while(stm1_isr_flag);
case IfxStm_Index_0:
{
Ifx_STM *stm_sfr = &MODULE_STM0;
stm_sfr->CMP[0].U = stm_sfr->TIM0.U + time;
stm0_isr_flag = 1;
while(stm0_isr_flag);
}break;
case IfxStm_Index_1:
{
Ifx_STM *stm_sfr = &MODULE_STM1;
stm_sfr->CMP[0].U = stm_sfr->TIM0.U + time;
stm1_isr_flag = 1;
while(stm1_isr_flag);
}break;
case IfxStm_Index_none: break;
}
}
}
@@ -128,7 +131,6 @@ void system_delay_us (uint32 time)
//-------------------------------------------------------------------------------------------------------------------
void system_delay_ms (uint32 time)
{
if(time > 40000)
{
while(time > 40000)
@@ -165,10 +167,10 @@ void system_delay_init(void)
IfxStm_initCompare(&MODULE_STM0, &stmConfig);
IfxStm_clearCompareFlag(&MODULE_STM0, IfxStm_Comparator_0);
stmConfig.comparator = IfxStm_Comparator_1;
stmConfig.comparator = IfxStm_Comparator_0;
stmConfig.compareOffset = IfxStm_ComparatorOffset_0;
stmConfig.compareSize = IfxStm_ComparatorSize_32Bits;
stmConfig.comparatorInterrupt = IfxStm_ComparatorInterrupt_ir1;
stmConfig.comparatorInterrupt = IfxStm_ComparatorInterrupt_ir0;
stmConfig.ticks = 1;
stmConfig.triggerPriority = IFX_INTPRIO_STM1_SR0;
stmConfig.typeOfService = IfxSrc_Tos_cpu1;
@@ -178,3 +180,4 @@ void system_delay_init(void)
restoreInterrupts(interrupt_state);
}