]>
git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/net/lwip/lwip-sys/arch/sys_arch.h
1 /* Copyright (C) 2012 mbed.org, MIT License
3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
4 * and associated documentation files (the "Software"), to deal in the Software without restriction,
5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
7 * furnished to do so, subject to the following conditions:
9 * The above copyright notice and this permission notice shall be included in all copies or
10 * substantial portions of the Software.
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18 #ifndef __ARCH_SYS_ARCH_H__
19 #define __ARCH_SYS_ARCH_H__
35 #define sys_sem_valid(x) (((*x).id == NULL) ? 0 : 1)
36 #define sys_sem_set_invalid(x) ( (*x).id = NULL)
54 uint32_t queue
[4+MB_SIZE
]; /* The +4 is required for RTX OS_MCB overhead. */
58 #define SYS_MBOX_NULL ((uint32_t) NULL)
59 #define sys_mbox_valid(x) (((*x).id == NULL) ? 0 : 1 )
60 #define sys_mbox_set_invalid(x) ( (*x).id = NULL )
62 #if ((DEFAULT_RAW_RECVMBOX_SIZE) > (MB_SIZE)) || \
63 ((DEFAULT_UDP_RECVMBOX_SIZE) > (MB_SIZE)) || \
64 ((DEFAULT_TCP_RECVMBOX_SIZE) > (MB_SIZE)) || \
65 ((DEFAULT_ACCEPTMBOX_SIZE) > (MB_SIZE)) || \
66 ((TCPIP_MBOX_SIZE) > (MB_SIZE))
67 # error Mailbox size not supported
75 typedef sys_thread_data_t
* sys_thread_t
;
77 #define SYS_THREAD_POOL_N 6
78 #define SYS_DEFAULT_THREAD_STACK_DEPTH DEFAULT_STACK_SIZE
81 typedef int sys_prot_t
;
88 /** \brief Init systick to 1ms rate
90 * This init the systick to 1ms rate. This function is only used in standalone
93 void SysTick_Init(void);
96 /** \brief Get the current systick time in milliSeconds
98 * Returns the current systick time in milliSeconds. This function is only
99 * used in standalone systems.
101 * /returns current systick time in milliSeconds
103 uint32_t SysTick_GetMS(void);
105 /** \brief Delay for the specified number of milliSeconds
107 * For standalone systems. This function will block for the specified
108 * number of milliSconds. For RTOS based systems, this function will delay
109 * the task by the specified number of milliSeconds.
111 * \param[in] ms Time in milliSeconds to delay
113 void osDelay(uint32_t ms
);
120 #endif /* __ARCH_SYS_ARCH_H__ */