123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- #ifndef PORTMACRO_H
- #define PORTMACRO_H
- #include <intrinsics.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define portCHAR char
- #define portFLOAT float
- #define portDOUBLE double
- #define portLONG long
- #define portSHORT short
- #define portSTACK_TYPE uint32_t
- #define portBASE_TYPE long
- typedef portSTACK_TYPE StackType_t;
- typedef long BaseType_t;
- typedef unsigned long UBaseType_t;
- #if( configUSE_16_BIT_TICKS == 1 )
- typedef uint16_t TickType_t;
- #define portMAX_DELAY ( TickType_t ) 0xffff
- #else
- typedef uint32_t TickType_t;
- #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
-
- #define portTICK_TYPE_IS_ATOMIC 1
- #endif
- #define portBYTE_ALIGNMENT 8
- #define portSTACK_GROWTH -1
- #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
- #define portNOP() __no_operation()
- #define portYIELD() \
- __asm volatile \
- ( \
- "PUSH.L R10 \n" \
- "MOV.L #0x872E0, R10 \n" \
- "MOV.B #0x1, [R10] \n" \
- "MOV.L [R10], R10 \n" \
- "POP R10 \n" \
- )
- #define portYIELD_FROM_ISR( x ) do { if( ( x ) != pdFALSE ) portYIELD(); } while( 0 )
- #define portENABLE_INTERRUPTS() __set_interrupt_level( ( uint8_t ) 0 )
- #ifdef configASSERT
- #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( __get_interrupt_level() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )
- #define portDISABLE_INTERRUPTS() if( __get_interrupt_level() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) __set_interrupt_level( ( uint8_t ) configMAX_SYSCALL_INTERRUPT_PRIORITY )
- #else
- #define portDISABLE_INTERRUPTS() __set_interrupt_level( ( uint8_t ) configMAX_SYSCALL_INTERRUPT_PRIORITY )
- #endif
- #define portCRITICAL_NESTING_IN_TCB ( 1 )
- extern void vTaskEnterCritical( void );
- extern void vTaskExitCritical( void );
- #define portENTER_CRITICAL() vTaskEnterCritical()
- #define portEXIT_CRITICAL() vTaskExitCritical()
- #define portSET_INTERRUPT_MASK_FROM_ISR() __get_interrupt_level(); portDISABLE_INTERRUPTS()
- #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ) __set_interrupt_level( ( uint8_t ) ( uxSavedInterruptStatus ) )
- #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
- #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
- #ifdef __cplusplus
- }
- #endif
- #endif
|