Skip to content

Commit 0debe8c

Browse files
authored
Revert Portable/Paradigm formatting (#830)
Revert the formatting on Paradigm ports
1 parent db5df4b commit 0debe8c

File tree

6 files changed

+195
-213
lines changed

6 files changed

+195
-213
lines changed

portable/Paradigm/Tern_EE/large_untested/port.c

Lines changed: 38 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828

2929

3030
/*-----------------------------------------------------------
31-
* Implementation of functions defined in portable.h for the Tern EE 186
32-
* port.
33-
*----------------------------------------------------------*/
31+
* Implementation of functions defined in portable.h for the Tern EE 186
32+
* port.
33+
*----------------------------------------------------------*/
3434

3535
/* Library includes. */
3636
#include <embedded.h>
@@ -42,50 +42,46 @@
4242
#include "portasm.h"
4343

4444
/* The timer increments every four clocks, hence the divide by 4. */
45-
#define portTIMER_COMPARE ( uint16_t ) ( ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ) / ( uint32_t ) 4 )
45+
#define portTIMER_COMPARE ( uint16_t ) ( ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ) / ( uint32_t ) 4 )
4646

4747
/* From the RDC data sheet. */
48-
#define portENABLE_TIMER_AND_INTERRUPT ( uint16_t ) 0xe001
48+
#define portENABLE_TIMER_AND_INTERRUPT ( uint16_t ) 0xe001
4949

5050
/* Interrupt control. */
51-
#define portEIO_REGISTER 0xff22
52-
#define portCLEAR_INTERRUPT 0x0008
51+
#define portEIO_REGISTER 0xff22
52+
#define portCLEAR_INTERRUPT 0x0008
5353

5454
/* Setup the hardware to generate the required tick frequency. */
5555
static void prvSetupTimerInterrupt( void );
5656

5757
/* The ISR used depends on whether the preemptive or cooperative scheduler
58-
* is being used. */
59-
#if ( configUSE_PREEMPTION == 1 )
60-
61-
/* Tick service routine used by the scheduler when preemptive scheduling is
62-
* being used. */
58+
is being used. */
59+
#if( configUSE_PREEMPTION == 1 )
60+
/* Tick service routine used by the scheduler when preemptive scheduling is
61+
being used. */
6362
static void __interrupt __far prvPreemptiveTick( void );
6463
#else
65-
66-
/* Tick service routine used by the scheduler when cooperative scheduling is
67-
* being used. */
64+
/* Tick service routine used by the scheduler when cooperative scheduling is
65+
being used. */
6866
static void __interrupt __far prvNonPreemptiveTick( void );
6967
#endif
7068

7169
/* Trap routine used by taskYIELD() to manually cause a context switch. */
7270
static void __interrupt __far prvYieldProcessor( void );
7371

7472
/* The timer initialisation functions leave interrupts enabled,
75-
* which is not what we want. This ISR is installed temporarily in case
76-
* the timer fires before we get a change to disable interrupts again. */
73+
which is not what we want. This ISR is installed temporarily in case
74+
the timer fires before we get a change to disable interrupts again. */
7775
static void __interrupt __far prvDummyISR( void );
7876

7977
/*-----------------------------------------------------------*/
8078
/* See header file for description. */
81-
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
82-
TaskFunction_t pxCode,
83-
void * pvParameters )
79+
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
8480
{
85-
StackType_t DS_Reg = 0;
81+
StackType_t DS_Reg = 0;
8682

8783
/* Place a few bytes of known values on the bottom of the stack.
88-
* This is just useful for debugging. */
84+
This is just useful for debugging. */
8985

9086
*pxTopOfStack = 0x1111;
9187
pxTopOfStack--;
@@ -95,8 +91,8 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
9591
pxTopOfStack--;
9692

9793
/* We are going to start the scheduler using a return from interrupt
98-
* instruction to load the program counter, so first there would be the
99-
* function call with parameters preamble. */
94+
instruction to load the program counter, so first there would be the
95+
function call with parameters preamble. */
10096

10197
*pxTopOfStack = FP_SEG( pvParameters );
10298
pxTopOfStack--;
@@ -116,8 +112,8 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
116112
pxTopOfStack--;
117113

118114
/* The remaining registers would be pushed on the stack by our context
119-
* switch function. These are loaded with values simply to make debugging
120-
* easier. */
115+
switch function. These are loaded with values simply to make debugging
116+
easier. */
121117
*pxTopOfStack = ( StackType_t ) 0xAAAA; /* AX */
122118
pxTopOfStack--;
123119
*pxTopOfStack = ( StackType_t ) 0xBBBB; /* BX */
@@ -130,11 +126,9 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
130126
pxTopOfStack--;
131127

132128
/* We need the true data segment. */
133-
__asm {
134-
MOV DS_Reg, DS
135-
};
129+
__asm{ MOV DS_Reg, DS };
136130

137-
*pxTopOfStack = DS_Reg; /* DS */
131+
*pxTopOfStack = DS_Reg; /* DS */
138132
pxTopOfStack--;
139133
*pxTopOfStack = ( StackType_t ) 0x0123; /* SI */
140134
pxTopOfStack--;
@@ -151,7 +145,7 @@ BaseType_t xPortStartScheduler( void )
151145
/* This is called with interrupts already disabled. */
152146

153147
/* Put our manual switch (yield) function on a known
154-
* vector. */
148+
vector. */
155149
setvect( portSWITCH_INT_NUMBER, prvYieldProcessor );
156150

157151
/* Setup the tick interrupt. */
@@ -168,15 +162,15 @@ BaseType_t xPortStartScheduler( void )
168162
static void __interrupt __far prvDummyISR( void )
169163
{
170164
/* The timer initialisation functions leave interrupts enabled,
171-
* which is not what we want. This ISR is installed temporarily in case
172-
* the timer fires before we get a change to disable interrupts again. */
165+
which is not what we want. This ISR is installed temporarily in case
166+
the timer fires before we get a change to disable interrupts again. */
173167
outport( portEIO_REGISTER, portCLEAR_INTERRUPT );
174168
}
175169
/*-----------------------------------------------------------*/
176170

177171
/* The ISR used depends on whether the preemptive or cooperative scheduler
178-
* is being used. */
179-
#if ( configUSE_PREEMPTION == 1 )
172+
is being used. */
173+
#if( configUSE_PREEMPTION == 1 )
180174
static void __interrupt __far prvPreemptiveTick( void )
181175
{
182176
/* Get the scheduler to update the task states following the tick. */
@@ -189,17 +183,17 @@ static void __interrupt __far prvDummyISR( void )
189183
/* Reset interrupt. */
190184
outport( portEIO_REGISTER, portCLEAR_INTERRUPT );
191185
}
192-
#else /* if ( configUSE_PREEMPTION == 1 ) */
186+
#else
193187
static void __interrupt __far prvNonPreemptiveTick( void )
194188
{
195189
/* Same as preemptive tick, but the cooperative scheduler is being used
196-
* so we don't have to switch in the context of the next task. */
190+
so we don't have to switch in the context of the next task. */
197191
xTaskIncrementTick();
198192

199193
/* Reset interrupt. */
200194
outport( portEIO_REGISTER, portCLEAR_INTERRUPT );
201195
}
202-
#endif /* if ( configUSE_PREEMPTION == 1 ) */
196+
#endif
203197
/*-----------------------------------------------------------*/
204198

205199
static void __interrupt __far prvYieldProcessor( void )
@@ -217,25 +211,23 @@ void vPortEndScheduler( void )
217211

218212
static void prvSetupTimerInterrupt( void )
219213
{
220-
const uint16_t usTimerACompare = portTIMER_COMPARE, usTimerAMode = portENABLE_TIMER_AND_INTERRUPT;
221-
const uint16_t usT2_IRQ = 0x13;
214+
const uint16_t usTimerACompare = portTIMER_COMPARE, usTimerAMode = portENABLE_TIMER_AND_INTERRUPT;
215+
const uint16_t usT2_IRQ = 0x13;
222216

223217
/* Configure the timer, the dummy handler is used here as the init
224-
* function leaves interrupts enabled. */
218+
function leaves interrupts enabled. */
225219
t2_init( usTimerAMode, usTimerACompare, prvDummyISR );
226220

227221
/* Disable interrupts again before installing the real handlers. */
228222
portDISABLE_INTERRUPTS();
229223

230-
#if ( configUSE_PREEMPTION == 1 )
231-
224+
#if( configUSE_PREEMPTION == 1 )
232225
/* Tick service routine used by the scheduler when preemptive scheduling is
233-
* being used. */
226+
being used. */
234227
setvect( usT2_IRQ, prvPreemptiveTick );
235228
#else
236-
237229
/* Tick service routine used by the scheduler when cooperative scheduling is
238-
* being used. */
230+
being used. */
239231
setvect( usT2_IRQ, prvNonPreemptiveTick );
240232
#endif
241233
}

portable/Paradigm/Tern_EE/large_untested/portasm.h

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -44,32 +44,32 @@ void portSWITCH_CONTEXT( void );
4444
*/
4545
void portFIRST_CONTEXT( void );
4646

47-
#define portSWITCH_CONTEXT() \
48-
asm { mov ax, seg pxCurrentTCB } \
49-
asm { mov ds, ax } \
50-
asm { les bx, pxCurrentTCB } /* Save the stack pointer into the TCB. */ \
51-
asm { mov es : 0x2[ bx ], ss } \
52-
asm { mov es:[ bx ], sp } \
53-
asm { call far ptr vTaskSwitchContext } /* Perform the switch. */ \
54-
asm { mov ax, seg pxCurrentTCB } /* Restore the stack pointer from the TCB. */ \
55-
asm { mov ds, ax } \
56-
asm { les bx, dword ptr pxCurrentTCB } \
57-
asm { mov ss, es:[ bx + 2 ] } \
58-
asm { mov sp, es:[ bx ] }
47+
#define portSWITCH_CONTEXT() \
48+
asm { mov ax, seg pxCurrentTCB } \
49+
asm { mov ds, ax } \
50+
asm { les bx, pxCurrentTCB } /* Save the stack pointer into the TCB. */ \
51+
asm { mov es:0x2[ bx ], ss } \
52+
asm { mov es:[ bx ], sp } \
53+
asm { call far ptr vTaskSwitchContext } /* Perform the switch. */ \
54+
asm { mov ax, seg pxCurrentTCB } /* Restore the stack pointer from the TCB. */ \
55+
asm { mov ds, ax } \
56+
asm { les bx, dword ptr pxCurrentTCB } \
57+
asm { mov ss, es:[ bx + 2 ] } \
58+
asm { mov sp, es:[ bx ] }
5959

60-
#define portFIRST_CONTEXT() \
61-
asm { mov ax, seg pxCurrentTCB } \
62-
asm { mov ds, ax } \
63-
asm { les bx, dword ptr pxCurrentTCB } \
64-
asm { mov ss, es:[ bx + 2 ] } \
65-
asm { mov sp, es:[ bx ] } \
66-
asm { pop bp } \
67-
asm { pop di } \
68-
asm { pop si } \
69-
asm { pop ds } \
70-
asm { pop es } \
71-
asm { pop dx } \
72-
asm { pop cx } \
73-
asm { pop bx } \
74-
asm { pop ax } \
75-
asm { iret }
60+
#define portFIRST_CONTEXT() \
61+
asm { mov ax, seg pxCurrentTCB } \
62+
asm { mov ds, ax } \
63+
asm { les bx, dword ptr pxCurrentTCB } \
64+
asm { mov ss, es:[ bx + 2 ] } \
65+
asm { mov sp, es:[ bx ] } \
66+
asm { pop bp } \
67+
asm { pop di } \
68+
asm { pop si } \
69+
asm { pop ds } \
70+
asm { pop es } \
71+
asm { pop dx } \
72+
asm { pop cx } \
73+
asm { pop bx } \
74+
asm { pop ax } \
75+
asm { iret }

portable/Paradigm/Tern_EE/large_untested/portmacro.h

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -46,62 +46,61 @@
4646
*/
4747

4848
/* Type definitions. */
49-
#define portCHAR char
50-
#define portFLOAT float
51-
#define portDOUBLE long
52-
#define portLONG long
53-
#define portSHORT int
54-
#define portSTACK_TYPE uint16_t
55-
#define portBASE_TYPE short
56-
57-
typedef portSTACK_TYPE StackType_t;
58-
typedef short BaseType_t;
59-
typedef unsigned short UBaseType_t;
60-
61-
62-
#if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
63-
typedef uint16_t TickType_t;
64-
#define portMAX_DELAY ( TickType_t ) 0xffff
65-
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
66-
typedef uint32_t TickType_t;
49+
#define portCHAR char
50+
#define portFLOAT float
51+
#define portDOUBLE long
52+
#define portLONG long
53+
#define portSHORT int
54+
#define portSTACK_TYPE uint16_t
55+
#define portBASE_TYPE short
56+
57+
typedef portSTACK_TYPE StackType_t;
58+
typedef short BaseType_t;
59+
typedef unsigned short UBaseType_t;
60+
61+
62+
#if( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
63+
typedef uint16_t TickType_t;
64+
#define portMAX_DELAY ( TickType_t ) 0xffff
65+
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
66+
typedef uint32_t TickType_t;
6767
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL
6868
#else
6969
#error configTICK_TYPE_WIDTH_IN_BITS set to unsupported tick type width.
7070
#endif
7171
/*-----------------------------------------------------------*/
7272

7373
/* Critical section handling. */
74-
#define portENTER_CRITICAL() \
75-
__asm { pushf } \
76-
__asm { cli } \
74+
#define portENTER_CRITICAL() __asm{ pushf } \
75+
__asm{ cli } \
7776

78-
#define portEXIT_CRITICAL() __asm { popf }
77+
#define portEXIT_CRITICAL() __asm{ popf }
7978

80-
#define portDISABLE_INTERRUPTS() __asm { cli }
79+
#define portDISABLE_INTERRUPTS() __asm{ cli }
8180

82-
#define portENABLE_INTERRUPTS() __asm { sti }
81+
#define portENABLE_INTERRUPTS() __asm{ sti }
8382
/*-----------------------------------------------------------*/
8483

8584
/* Hardware specifics. */
86-
#define portNOP() __asm { nop }
87-
#define portSTACK_GROWTH ( -1 )
88-
#define portSWITCH_INT_NUMBER 0x80
89-
#define portYIELD() __asm { int portSWITCH_INT_NUMBER }
90-
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
91-
#define portBYTE_ALIGNMENT 2
92-
#define portINITIAL_SW ( ( portSTACK_TYPE ) 0x0202 ) /* Start the tasks with interrupts enabled. */
85+
#define portNOP() __asm{ nop }
86+
#define portSTACK_GROWTH ( -1 )
87+
#define portSWITCH_INT_NUMBER 0x80
88+
#define portYIELD() __asm{ int portSWITCH_INT_NUMBER }
89+
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
90+
#define portBYTE_ALIGNMENT 2
91+
#define portINITIAL_SW ( ( portSTACK_TYPE ) 0x0202 ) /* Start the tasks with interrupts enabled. */
9392
/*-----------------------------------------------------------*/
9493

9594
/* Compiler specifics. */
96-
#define portINPUT_BYTE( xAddr ) inp( xAddr )
97-
#define portOUTPUT_BYTE( xAddr, ucValue ) outp( xAddr, ucValue )
98-
#define portINPUT_WORD( xAddr ) inpw( xAddr )
99-
#define portOUTPUT_WORD( xAddr, usValue ) outpw( xAddr, usValue )
95+
#define portINPUT_BYTE( xAddr ) inp( xAddr )
96+
#define portOUTPUT_BYTE( xAddr, ucValue ) outp( xAddr, ucValue )
97+
#define portINPUT_WORD( xAddr ) inpw( xAddr )
98+
#define portOUTPUT_WORD( xAddr, usValue ) outpw( xAddr, usValue )
10099
/*-----------------------------------------------------------*/
101100

102101
/* Task function macros as described on the FreeRTOS.org WEB site. */
103-
#define portTASK_FUNCTION_PROTO( vTaskFunction, vParameters ) void vTaskFunction( void * pvParameters )
104-
#define portTASK_FUNCTION( vTaskFunction, vParameters ) void vTaskFunction( void * pvParameters )
102+
#define portTASK_FUNCTION_PROTO( vTaskFunction, vParameters ) void vTaskFunction( void *pvParameters )
103+
#define portTASK_FUNCTION( vTaskFunction, vParameters ) void vTaskFunction( void *pvParameters )
105104

106105
/* *INDENT-OFF* */
107106
#ifdef __cplusplus

0 commit comments

Comments
 (0)