Quick and dirty CoOS + LWIP ( Webserver )

Dependencies:   mbed lwip

Committer:
astroboy
Date:
Sat Sep 10 22:41:10 2011 +0000
Revision:
0:94897d537b31

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
astroboy 0:94897d537b31 1 /**
astroboy 0:94897d537b31 2 *******************************************************************************
astroboy 0:94897d537b31 3 * @file OsArch.h
astroboy 0:94897d537b31 4 * @version V1.1.4
astroboy 0:94897d537b31 5 * @date 2011.04.20
astroboy 0:94897d537b31 6 * @brief Implement function declare related to Cortex-M3(ARM-v7)
astroboy 0:94897d537b31 7 * @details This header file including functions or defines related to
astroboy 0:94897d537b31 8 * Cortex-M3(ARM-v7).
astroboy 0:94897d537b31 9 *******************************************************************************
astroboy 0:94897d537b31 10 * @copy
astroboy 0:94897d537b31 11 *
astroboy 0:94897d537b31 12 * INTERNAL FILE,DON'T PUBLIC.
astroboy 0:94897d537b31 13 *
astroboy 0:94897d537b31 14 * <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2>
astroboy 0:94897d537b31 15 *******************************************************************************
astroboy 0:94897d537b31 16 */
astroboy 0:94897d537b31 17
astroboy 0:94897d537b31 18
astroboy 0:94897d537b31 19 #ifndef _CPU_H
astroboy 0:94897d537b31 20 #define _CPU_H
astroboy 0:94897d537b31 21
astroboy 0:94897d537b31 22
astroboy 0:94897d537b31 23 #define NVIC_ST_CTRL (*((volatile U32 *)0xE000E010))
astroboy 0:94897d537b31 24 #define NVIC_ST_RELOAD (*((volatile U32 *)0xE000E014))
astroboy 0:94897d537b31 25 #define RELOAD_VAL ((U32)(( (U32)CFG_CPU_FREQ) / (U32)CFG_SYSTICK_FREQ) -1)
astroboy 0:94897d537b31 26
astroboy 0:94897d537b31 27 /*!< Initial System tick. */
astroboy 0:94897d537b31 28 #define InitSysTick() NVIC_ST_RELOAD = RELOAD_VAL; \
astroboy 0:94897d537b31 29 NVIC_ST_CTRL = 0x0007
astroboy 0:94897d537b31 30
astroboy 0:94897d537b31 31 #define NVIC_SYS_PRI2 (*((volatile U32 *)0xE000ED1C))
astroboy 0:94897d537b31 32 #define NVIC_SYS_PRI3 (*((volatile U32 *)0xE000ED20))
astroboy 0:94897d537b31 33
astroboy 0:94897d537b31 34 /*!< Initialize PendSV,SVC and SysTick interrupt priority to lowest. */
astroboy 0:94897d537b31 35 #define InitInt() NVIC_SYS_PRI2 |= 0xFF000000;\
astroboy 0:94897d537b31 36 NVIC_SYS_PRI3 |= 0xFFFF0000
astroboy 0:94897d537b31 37
astroboy 0:94897d537b31 38
astroboy 0:94897d537b31 39 /*---------------------------- Variable declare ------------------------------*/
astroboy 0:94897d537b31 40 extern U64 OSTickCnt; /*!< Counter for current system ticks. */
astroboy 0:94897d537b31 41
astroboy 0:94897d537b31 42 /*!< Initial context of task being created */
astroboy 0:94897d537b31 43 extern OS_STK *InitTaskContext(FUNCPtr task,void *param,OS_STK *pstk);
astroboy 0:94897d537b31 44 extern void SwitchContext(void); /*!< Switch context */
astroboy 0:94897d537b31 45 extern void SetEnvironment(OS_STK *pstk);/*!< Set environment for run */
astroboy 0:94897d537b31 46 extern U8 Inc8 (volatile U8 *data);
astroboy 0:94897d537b31 47 extern U8 Dec8 (volatile U8 *data);
astroboy 0:94897d537b31 48 extern void IRQ_ENABLE_RESTORE(void);
astroboy 0:94897d537b31 49 extern void IRQ_DISABLE_SAVE(void);
astroboy 0:94897d537b31 50 #endif