mirror of
https://gitee.com/seekfree/TC264_Library.git
synced 2026-06-04 03:32:56 +00:00
V3.2.5
修复延时函数初始化参数及中断向量表问题
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user