Skip to content

Commit bcf7bda

Browse files
authored
Revert Portable/oWatcom formatting (#829)
Revert the formatting on oWatcom ports
1 parent 0debe8c commit bcf7bda

File tree

6 files changed

+270
-286
lines changed

6 files changed

+270
-286
lines changed

portable/oWatcom/16BitDOS/Flsh186/port.c

Lines changed: 49 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,27 @@
2727
*/
2828

2929
/*
30-
* Changes from V1.00:
31-
*
32-
+ Call to taskYIELD() from within tick ISR has been replaced by the more
33-
+ efficient portSWITCH_CONTEXT().
34-
+ ISR function definitions renamed to include the prv prefix.
35-
+
36-
+ Changes from V1.2.0:
37-
+
38-
+ portRESET_PIC() is now called last thing before the end of the preemptive
39-
+ tick routine.
40-
+
41-
+ Changes from V2.6.1
42-
+
43-
+ Replaced the sUsingPreemption variable with the configUSE_PREEMPTION
44-
+ macro to be consistent with the later ports.
45-
*/
30+
Changes from V1.00:
31+
32+
+ Call to taskYIELD() from within tick ISR has been replaced by the more
33+
efficient portSWITCH_CONTEXT().
34+
+ ISR function definitions renamed to include the prv prefix.
35+
36+
Changes from V1.2.0:
37+
38+
+ portRESET_PIC() is now called last thing before the end of the preemptive
39+
tick routine.
40+
41+
Changes from V2.6.1
42+
43+
+ Replaced the sUsingPreemption variable with the configUSE_PREEMPTION
44+
macro to be consistent with the later ports.
45+
*/
4646

4747
/*-----------------------------------------------------------
48-
* Implementation of functions defined in portable.h for the Flashlite 186
49-
* port.
50-
*----------------------------------------------------------*/
48+
* Implementation of functions defined in portable.h for the Flashlite 186
49+
* port.
50+
*----------------------------------------------------------*/
5151

5252
#include <stdlib.h>
5353
#include <i86.h>
@@ -60,9 +60,9 @@
6060

6161
/*lint -e950 Non ANSI reserved words okay in this file only. */
6262

63-
#define portTIMER_EOI_TYPE ( 8 )
64-
#define portRESET_PIC() portOUTPUT_WORD( ( uint16_t ) 0xff22, portTIMER_EOI_TYPE )
65-
#define portTIMER_INT_NUMBER 0x12
63+
#define portTIMER_EOI_TYPE ( 8 )
64+
#define portRESET_PIC() portOUTPUT_WORD( ( uint16_t ) 0xff22, portTIMER_EOI_TYPE )
65+
#define portTIMER_INT_NUMBER 0x12
6666

6767
#define portTIMER_1_CONTROL_REGISTER ( ( uint16_t ) 0xff5e )
6868
#define portTIMER_0_CONTROL_REGISTER ( ( uint16_t ) 0xff56 )
@@ -75,14 +75,12 @@ static void prvSetTickFrequency( uint32_t ulTickRateHz );
7575
static void prvExitFunction( void );
7676

7777
#if configUSE_PREEMPTION == 1
78-
79-
/* Tick service routine used by the scheduler when preemptive scheduling is
80-
* being used. */
78+
/* Tick service routine used by the scheduler when preemptive scheduling is
79+
being used. */
8180
static void __interrupt __far prvPreemptiveTick( void );
8281
#else
83-
84-
/* Tick service routine used by the scheduler when cooperative scheduling is
85-
* being used. */
82+
/* Tick service routine used by the scheduler when cooperative scheduling is
83+
being used. */
8684
static void __interrupt __far prvNonPreemptiveTick( void );
8785
#endif
8886

@@ -95,7 +93,7 @@ static void __interrupt __far prvYieldProcessor( void );
9593
static int16_t sSchedulerRunning = pdFALSE;
9694

9795
/* Points to the original routine installed on the vector we use for manual context switches. This is then used to restore the original routine during prvExitFunction(). */
98-
static void( __interrupt __far * pxOldSwitchISR )();
96+
static void ( __interrupt __far *pxOldSwitchISR )();
9997

10098
/* Used to restore the original DOS context when the scheduler is ended. */
10199
static jmp_buf xJumpBuf;
@@ -108,11 +106,11 @@ BaseType_t xPortStartScheduler( void )
108106
/* This is called with interrupts already disabled. */
109107

110108
/* Remember what was on the interrupts we are going to use
111-
* so we can put them back later if required. */
109+
so we can put them back later if required. */
112110
pxOldSwitchISR = _dos_getvect( portSWITCH_INT_NUMBER );
113111

114112
/* Put our manual switch (yield) function on a known
115-
* vector. */
113+
vector. */
116114
_dos_setvect( portSWITCH_INT_NUMBER, prvYieldProcessor );
117115

118116
#if configUSE_PREEMPTION == 1
@@ -148,7 +146,7 @@ BaseType_t xPortStartScheduler( void )
148146
/*-----------------------------------------------------------*/
149147

150148
/* The tick ISR used depend on whether or not the preemptive or cooperative
151-
* kernel is being used. */
149+
kernel is being used. */
152150
#if configUSE_PREEMPTION == 1
153151
static void __interrupt __far prvPreemptiveTick( void )
154152
{
@@ -162,15 +160,15 @@ BaseType_t xPortStartScheduler( void )
162160
/* Reset the PIC ready for the next time. */
163161
portRESET_PIC();
164162
}
165-
#else /* if configUSE_PREEMPTION == 1 */
163+
#else
166164
static void __interrupt __far prvNonPreemptiveTick( void )
167165
{
168166
/* Same as preemptive tick, but the cooperative scheduler is being used
169-
* so we don't have to switch in the context of the next task. */
167+
so we don't have to switch in the context of the next task. */
170168
xTaskIncrementTick();
171169
portRESET_PIC();
172170
}
173-
#endif /* if configUSE_PREEMPTION == 1 */
171+
#endif
174172
/*-----------------------------------------------------------*/
175173

176174
static void __interrupt __far prvYieldProcessor( void )
@@ -183,31 +181,30 @@ static void __interrupt __far prvYieldProcessor( void )
183181
void vPortEndScheduler( void )
184182
{
185183
/* Jump back to the processor state prior to starting the
186-
* scheduler. This means we are not going to be using a
187-
* task stack frame so the task can be deleted. */
184+
scheduler. This means we are not going to be using a
185+
task stack frame so the task can be deleted. */
188186
longjmp( xJumpBuf, 1 );
189187
}
190188
/*-----------------------------------------------------------*/
191189

192190
static void prvExitFunction( void )
193191
{
194-
const uint16_t usTimerDisable = 0x0000;
195-
uint16_t usTimer0Control;
192+
const uint16_t usTimerDisable = 0x0000;
193+
uint16_t usTimer0Control;
196194

197195
/* Interrupts should be disabled here anyway - but no
198-
* harm in making sure. */
196+
harm in making sure. */
199197
portDISABLE_INTERRUPTS();
200-
201198
if( sSchedulerRunning == pdTRUE )
202199
{
203200
/* Put back the switch interrupt routines that was in place
204-
* before the scheduler started. */
201+
before the scheduler started. */
205202
_dos_setvect( portSWITCH_INT_NUMBER, pxOldSwitchISR );
206203
}
207204

208205
/* Disable the timer used for the tick to ensure the scheduler is
209-
* not called before restoring interrupts. There was previously nothing
210-
* on this timer so there is no old ISR to restore. */
206+
not called before restoring interrupts. There was previously nothing
207+
on this timer so there is no old ISR to restore. */
211208
portOUTPUT_WORD( portTIMER_1_CONTROL_REGISTER, usTimerDisable );
212209

213210
/* Restart the DOS tick. */
@@ -222,18 +219,18 @@ static void prvExitFunction( void )
222219

223220
static void prvSetTickFrequency( uint32_t ulTickRateHz )
224221
{
225-
const uint16_t usMaxCountRegister = 0xff5a;
226-
const uint16_t usTimerPriorityRegister = 0xff32;
227-
const uint16_t usTimerEnable = 0xC000;
228-
const uint16_t usRetrigger = 0x0001;
229-
const uint16_t usTimerHighPriority = 0x0000;
230-
uint16_t usTimer0Control;
222+
const uint16_t usMaxCountRegister = 0xff5a;
223+
const uint16_t usTimerPriorityRegister = 0xff32;
224+
const uint16_t usTimerEnable = 0xC000;
225+
const uint16_t usRetrigger = 0x0001;
226+
const uint16_t usTimerHighPriority = 0x0000;
227+
uint16_t usTimer0Control;
231228

232229
/* ( CPU frequency / 4 ) / clock 2 max count [inpw( 0xff62 ) = 7] */
233230

234-
const uint32_t ulClockFrequency = 0x7f31a0;
231+
const uint32_t ulClockFrequency = 0x7f31a0;
235232

236-
uint32_t ulTimerCount = ulClockFrequency / ulTickRateHz;
233+
uint32_t ulTimerCount = ulClockFrequency / ulTickRateHz;
237234

238235
portOUTPUT_WORD( portTIMER_1_CONTROL_REGISTER, usTimerEnable | portTIMER_INTERRUPT_ENABLE | usRetrigger );
239236
portOUTPUT_WORD( usMaxCountRegister, ( uint16_t ) ulTimerCount );

portable/oWatcom/16BitDOS/Flsh186/portmacro.h

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,24 @@
4747

4848

4949
/* Type definitions. */
50-
#define portCHAR char
51-
#define portFLOAT float
52-
#define portDOUBLE long
53-
#define portLONG long
54-
#define portSHORT int
55-
#define portSTACK_TYPE uint16_t
56-
#define portBASE_TYPE short
57-
58-
typedef portSTACK_TYPE StackType_t;
59-
typedef short BaseType_t;
60-
typedef unsigned short UBaseType_t;
61-
62-
63-
#if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
64-
typedef uint16_t TickType_t;
65-
#define portMAX_DELAY ( TickType_t ) 0xffff
66-
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
67-
typedef uint32_t TickType_t;
50+
#define portCHAR char
51+
#define portFLOAT float
52+
#define portDOUBLE long
53+
#define portLONG long
54+
#define portSHORT int
55+
#define portSTACK_TYPE uint16_t
56+
#define portBASE_TYPE short
57+
58+
typedef portSTACK_TYPE StackType_t;
59+
typedef short BaseType_t;
60+
typedef unsigned short UBaseType_t;
61+
62+
63+
#if( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
64+
typedef uint16_t TickType_t;
65+
#define portMAX_DELAY ( TickType_t ) 0xffff
66+
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
67+
typedef uint32_t TickType_t;
6868
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL
6969
#else
7070
#error configTICK_TYPE_WIDTH_IN_BITS set to unsupported tick type width.
@@ -74,7 +74,7 @@ typedef unsigned short UBaseType_t;
7474
/* Critical section management. */
7575
void portENTER_CRITICAL( void );
7676
#pragma aux portENTER_CRITICAL = "pushf" \
77-
"cli";
77+
"cli";
7878

7979
void portEXIT_CRITICAL( void );
8080
#pragma aux portEXIT_CRITICAL = "popf";
@@ -87,25 +87,25 @@ void portENABLE_INTERRUPTS( void );
8787
/*-----------------------------------------------------------*/
8888

8989
/* Architecture specifics. */
90-
#define portSTACK_GROWTH ( -1 )
91-
#define portSWITCH_INT_NUMBER 0x80
92-
#define portYIELD() __asm { int portSWITCH_INT_NUMBER }
93-
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
94-
#define portBYTE_ALIGNMENT 2
95-
#define portINITIAL_SW ( ( portSTACK_TYPE ) 0x0202 ) /* Start the tasks with interrupts enabled. */
96-
#define portNOP() __asm { nop }
90+
#define portSTACK_GROWTH ( -1 )
91+
#define portSWITCH_INT_NUMBER 0x80
92+
#define portYIELD() __asm{ int portSWITCH_INT_NUMBER }
93+
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
94+
#define portBYTE_ALIGNMENT 2
95+
#define portINITIAL_SW ( ( portSTACK_TYPE ) 0x0202 ) /* Start the tasks with interrupts enabled. */
96+
#define portNOP() __asm{ nop }
9797
/*-----------------------------------------------------------*/
9898

9999
/* Compiler specifics. */
100-
#define portINPUT_BYTE( xAddr ) inp( xAddr )
101-
#define portOUTPUT_BYTE( xAddr, ucValue ) outp( xAddr, ucValue )
102-
#define portINPUT_WORD( xAddr ) inpw( xAddr )
103-
#define portOUTPUT_WORD( xAddr, usValue ) outpw( xAddr, usValue )
100+
#define portINPUT_BYTE( xAddr ) inp( xAddr )
101+
#define portOUTPUT_BYTE( xAddr, ucValue ) outp( xAddr, ucValue )
102+
#define portINPUT_WORD( xAddr ) inpw( xAddr )
103+
#define portOUTPUT_WORD( xAddr, usValue ) outpw( xAddr, usValue )
104104
/*-----------------------------------------------------------*/
105105

106106
/* Task function macros as described on the FreeRTOS.org WEB site. */
107-
#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void * pvParameters )
108-
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void * pvParameters )
107+
#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
108+
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
109109

110110
/* *INDENT-OFF* */
111111
#ifdef __cplusplus

0 commit comments

Comments
 (0)