Last CooCox version
Some handlers were defined twice in vectors_sam3s.c, perhaps some others need to be checked ... later!
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file prot.c
|
||||
* @version V1.12
|
||||
* @date 2010.03.01
|
||||
* @version V1.1.4
|
||||
* @date 2011.04.20
|
||||
* @brief Compiler adapter for CooCox CoOS kernel.
|
||||
*******************************************************************************
|
||||
* @copy
|
||||
@@ -27,8 +27,10 @@ U32 INT_EXIT = 0xFFFFFFFC;
|
||||
//******************************************************************************
|
||||
// PUBLIC FUNCTIONS
|
||||
//******************************************************************************
|
||||
extern U8 Inc8(U8 *data) ;
|
||||
extern U8 Dec8(U8 *data) ;
|
||||
extern U8 Inc8(volatile U8 *data) ;
|
||||
extern U8 Dec8(volatile U8 *data) ;
|
||||
extern void IRQ_ENABLE_RESTORE(void);
|
||||
extern void IRQ_DISABLE_SAVE(void);
|
||||
extern void SetEnvironment(OS_STK *pstk) __attribute__ ((naked));
|
||||
extern void SwitchContext(void) __attribute__ ((naked));
|
||||
extern void PendSV_Handler(void) __attribute__ ((naked));
|
||||
@@ -46,7 +48,7 @@ extern void PendSV_Handler(void) __attribute__ ((naked));
|
||||
* and Saved into memory cell.
|
||||
******************************************************************************
|
||||
*/
|
||||
U8 Inc8 (U8 *data)
|
||||
U8 Inc8 (volatile U8 *data)
|
||||
{
|
||||
register U8 result = 0;
|
||||
|
||||
@@ -81,7 +83,7 @@ U8 Inc8 (U8 *data)
|
||||
* and Saved into memory cell.
|
||||
******************************************************************************
|
||||
*/
|
||||
U8 Dec8 (U8 *data)
|
||||
U8 Dec8 (volatile U8 *data)
|
||||
{
|
||||
register U8 result = 0;
|
||||
__asm volatile
|
||||
@@ -100,6 +102,46 @@ U8 Dec8 (U8 *data)
|
||||
return (result);
|
||||
}
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
* @brief ENABLE Interrupt
|
||||
* @param[in] None
|
||||
* @param[out] None
|
||||
* @retval None
|
||||
*
|
||||
* @par Description
|
||||
* @details This function is called to ENABLE Interrupt.
|
||||
******************************************************************************
|
||||
*/
|
||||
void IRQ_ENABLE_RESTORE(void)
|
||||
{
|
||||
__asm volatile
|
||||
(
|
||||
" CPSIE I \n"
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
* @brief Close Interrupt
|
||||
* @param[in] None
|
||||
* @param[out] None
|
||||
* @retval None
|
||||
*
|
||||
* @par Description
|
||||
* @details This function is called to close Interrupt.
|
||||
******************************************************************************
|
||||
*/
|
||||
void IRQ_DISABLE_SAVE(void)
|
||||
{
|
||||
__asm volatile
|
||||
(
|
||||
" CPSID I \n"
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
@@ -119,8 +161,9 @@ void SetEnvironment (OS_STK *pstk)
|
||||
(
|
||||
" SUB R0,#28 \n"
|
||||
" MSR PSP,R0 \n"
|
||||
" BX LR \n"
|
||||
" BX LR \n"
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -145,8 +188,9 @@ void SwitchContext(void)
|
||||
" LDR R2,=NVIC_PENDSVSET \n"
|
||||
" LDR R1,[R2] \n"
|
||||
" STR R1, [R3] \n"
|
||||
" BX LR \n"
|
||||
" BX LR \n"
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file cpu.h
|
||||
* @version V1.12
|
||||
* @date 2010.03.01
|
||||
* @file OsArch.h
|
||||
* @version V1.1.4
|
||||
* @date 2011.04.20
|
||||
* @brief Implement function declare related to Cortex-M3(ARM-v7)
|
||||
* @details This header file including functions or defines related to
|
||||
* Cortex-M3(ARM-v7).
|
||||
@@ -43,6 +43,8 @@ extern U64 OSTickCnt; /*!< Counter for current system ticks. */
|
||||
extern OS_STK *InitTaskContext(FUNCPtr task,void *param,OS_STK *pstk);
|
||||
extern void SwitchContext(void); /*!< Switch context */
|
||||
extern void SetEnvironment(OS_STK *pstk);/*!< Set environment for run */
|
||||
extern U8 Inc8 (U8 *data);
|
||||
extern U8 Dec8 (U8 *data);
|
||||
extern U8 Inc8 (volatile U8 *data);
|
||||
extern U8 Dec8 (volatile U8 *data);
|
||||
extern void IRQ_ENABLE_RESTORE(void);
|
||||
extern void IRQ_DISABLE_SAVE(void);
|
||||
#endif
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/**
|
||||
*******************************************************************************
|
||||
* @file cpu.c
|
||||
* @version V1.12
|
||||
* @date 2010.03.01
|
||||
* @brief This file provides InitTaskContext() and SysTick_Handler().
|
||||
* @file arch.c
|
||||
* @version V1.1.4
|
||||
* @date 2011.04.20
|
||||
* @brief This file provides InitTaskContext() and SysTick_Handler().
|
||||
*******************************************************************************
|
||||
* @copy
|
||||
* WRITE COPY INFORMATION USE CAPITAL LETTER
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2009 CooCox </center></h2>
|
||||
*******************************************************************************
|
||||
*/
|
||||
*/
|
||||
|
||||
/*---------------------------- Include ---------------------------------------*/
|
||||
#include <coocox.h>
|
||||
@@ -63,7 +63,7 @@ void SysTick_Handler(void)
|
||||
OSSchedLock++; /* Lock scheduler. */
|
||||
OSTickCnt++; /* Increment systerm time. */
|
||||
#if CFG_TASK_WAITTING_EN >0
|
||||
if(DlyList != NULL) /* Have task in delay list? */
|
||||
if(DlyList != Co_NULL) /* Have task in delay list? */
|
||||
{
|
||||
if(DlyList->delayTick > 1) /* Delay time > 1? */
|
||||
{
|
||||
@@ -78,7 +78,7 @@ void SysTick_Handler(void)
|
||||
#endif
|
||||
|
||||
#if CFG_TMR_EN > 0
|
||||
if(TmrList != NULL) /* Have timer in working? */
|
||||
if(TmrList != Co_NULL) /* Have timer in working? */
|
||||
{
|
||||
if(TmrList->tmrCnt > 1) /* Timer time > 1? */
|
||||
{
|
||||
@@ -91,6 +91,6 @@ void SysTick_Handler(void)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
TaskSchedReq = TRUE;
|
||||
TaskSchedReq = Co_TRUE;
|
||||
OsSchedUnlock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user