解决温度采集延时问题
This commit is contained in:
83
SHARED_INT.C
83
SHARED_INT.C
@@ -133,9 +133,10 @@ void SHINT_vInit(void)
|
||||
|
||||
IEN0 |= 0x20; // load interrupt enable register 0
|
||||
|
||||
/// - Timer21 Interrupt is Selected
|
||||
|
||||
|
||||
IEN1 |= 0x00; // load interrupt enable register 1
|
||||
IEN1 |= 0x04; // load interrupt enable register 1
|
||||
|
||||
|
||||
// USER CODE BEGIN (SHINT_Init,3)
|
||||
@@ -306,6 +307,86 @@ RTCProcess();
|
||||
} // End of function SHINT_viXINTR5Isr
|
||||
|
||||
|
||||
//****************************************************************************
|
||||
// @Function void SHINT_viXINTR8Isr(void)
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
// @Description This is the service routine for the shared interrupt node
|
||||
// XINTR8. XINTR8 ISR Node is shared by External Interrupt
|
||||
// 2,Timer 21,CORDIC,UART1,UART1 Fractional Divider(BRG
|
||||
// Interrupt), and MDU[1:0]. Depending on the selected module
|
||||
// interrupt it is called.
|
||||
// EXT2 - It is called for the External interrupt 2.
|
||||
// T21 - Depending on the selected operating mode it is called
|
||||
// when TF2 is set by an overflow or underflow of the timer 21
|
||||
// register or when EXF2 is set by a negative transition on
|
||||
// T2EX.
|
||||
// UART1 - It is called after the BRG timer overflows and sets
|
||||
// the NDOV bit.
|
||||
// It is called after each transmission (flag TI_1 set) or
|
||||
// reception (flag RI_1 set) of a data unit.
|
||||
// Please note that you have to add application specific code
|
||||
// to this function.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
// @Returnvalue none
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
// @Parameters None
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
// @Date 2025/11/17
|
||||
//
|
||||
//****************************************************************************
|
||||
|
||||
// You have two choices for interrupt type select in Project Settings Page
|
||||
// under Global Settings Section.
|
||||
// If you select CHOICE 1 then ISR will be generated with push and pop.
|
||||
// If you select CHOICE 2 then ISR will be generated without push and pop.
|
||||
// Default choice is CHOICE 2.
|
||||
// Current selection is CHOICE 2
|
||||
|
||||
// USER CODE BEGIN (SHINT_XINTR8Isr,1)
|
||||
|
||||
// USER CODE END
|
||||
|
||||
void SHINT_viXINTR8Isr(void) interrupt XINTR8INT
|
||||
{
|
||||
|
||||
// USER CODE BEGIN (SHINT_XINTR8Isr,2)
|
||||
|
||||
// USER CODE END
|
||||
|
||||
EA = 0; // disable global interrupt
|
||||
_push_(SYSCON0); // push the current RMAP
|
||||
|
||||
SET_RMAP(); // sets RMAP
|
||||
|
||||
// Timer 21 interrupt handling section...
|
||||
|
||||
if (TF2)
|
||||
{
|
||||
// a timer 21 overflow has occured
|
||||
|
||||
TF2 = 0;
|
||||
|
||||
// USER CODE BEGIN (SHINT_XINTR8Isr,4)
|
||||
|
||||
// USER CODE END
|
||||
|
||||
}
|
||||
|
||||
// USER CODE BEGIN (SHINT_XINTR8Isr,9)
|
||||
|
||||
// USER CODE END
|
||||
|
||||
|
||||
_pop_(SYSCON0); // restore the old RMAP
|
||||
EA = 1; // enable global interrupt
|
||||
|
||||
} // End of function SHINT_viXINTR8Isr
|
||||
|
||||
|
||||
// USER CODE BEGIN (SHARED_INT_General,10)
|
||||
|
||||
// USER CODE END
|
||||
|
||||
Reference in New Issue
Block a user