]> git.sur5r.net Git - freertos/blob - FreeRTOS/Source/portable/WizC/PIC18/portmacro.h
71de6c35f1d58249ce411acd094a88cb77053193
[freertos] / FreeRTOS / Source / portable / WizC / PIC18 / portmacro.h
1 /*\r
2     FreeRTOS V8.2.0rc1 - Copyright (C) 2014 Real Time Engineers Ltd.\r
3     All rights reserved\r
4 \r
5     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
6 \r
7     This file is part of the FreeRTOS distribution.\r
8 \r
9     FreeRTOS is free software; you can redistribute it and/or modify it under\r
10     the terms of the GNU General Public License (version 2) as published by the\r
11     Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
12 \r
13     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
14     >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
15     >>!   obliged to provide the source code for proprietary components     !<<\r
16     >>!   outside of the FreeRTOS kernel.                                   !<<\r
17 \r
18     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
19     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
20     FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
21     link: http://www.freertos.org/a00114.html\r
22 \r
23     1 tab == 4 spaces!\r
24 \r
25     ***************************************************************************\r
26      *                                                                       *\r
27      *    Having a problem?  Start by reading the FAQ "My application does   *\r
28      *    not run, what could be wrong?".  Have you defined configASSERT()?  *\r
29      *                                                                       *\r
30      *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
31      *                                                                       *\r
32     ***************************************************************************\r
33 \r
34     ***************************************************************************\r
35      *                                                                       *\r
36      *    FreeRTOS provides completely free yet professionally developed,    *\r
37      *    robust, strictly quality controlled, supported, and cross          *\r
38      *    platform software that is more than just the market leader, it     *\r
39      *    is the industry's de facto standard.                               *\r
40      *                                                                       *\r
41      *    Help yourself get started quickly while simultaneously helping     *\r
42      *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
43      *    tutorial book, reference manual, or both:                          *\r
44      *    http://www.FreeRTOS.org/Documentation                              *\r
45      *                                                                       *\r
46     ***************************************************************************\r
47 \r
48     ***************************************************************************\r
49      *                                                                       *\r
50      *   Investing in training allows your team to be as productive as       *\r
51      *   possible as early as possible, lowering your overall development    *\r
52      *   cost, and enabling you to bring a more robust product to market     *\r
53      *   earlier than would otherwise be possible.  Richard Barry is both    *\r
54      *   the architect and key author of FreeRTOS, and so also the world's   *\r
55      *   leading authority on what is the world's most popular real time     *\r
56      *   kernel for deeply embedded MCU designs.  Obtaining your training    *\r
57      *   from Richard ensures your team will gain directly from his in-depth *\r
58      *   product knowledge and years of usage experience.  Contact Real Time *\r
59      *   Engineers Ltd to enquire about the FreeRTOS Masterclass, presented  *\r
60      *   by Richard Barry:  http://www.FreeRTOS.org/contact\r
61      *                                                                       *\r
62     ***************************************************************************\r
63 \r
64     ***************************************************************************\r
65      *                                                                       *\r
66      *    You are receiving this top quality software for free.  Please play *\r
67      *    fair and reciprocate by reporting any suspected issues and         *\r
68      *    participating in the community forum:                              *\r
69      *    http://www.FreeRTOS.org/support                                    *\r
70      *                                                                       *\r
71      *    Thank you!                                                         *\r
72      *                                                                       *\r
73     ***************************************************************************\r
74 \r
75     http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
76     license and Real Time Engineers Ltd. contact details.\r
77 \r
78     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
79     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
80     compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
81 \r
82     http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
83     Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
84 \r
85     http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
86     Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
87     licenses offer ticketed support, indemnification and commercial middleware.\r
88 \r
89     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
90     engineered and independently SIL3 certified version for use in safety and\r
91     mission critical applications that require provable dependability.\r
92 \r
93     1 tab == 4 spaces!\r
94 */\r
95 \r
96 /*\r
97 Changes from V3.0.0\r
98 \r
99 Changes from V3.0.1\r
100 */\r
101 #ifndef PORTMACRO_H\r
102 #define PORTMACRO_H\r
103 \r
104 #if !defined(_SERIES) || _SERIES != 18\r
105         #error "WizC supports FreeRTOS on the Microchip PIC18-series only"\r
106 #endif\r
107 \r
108 #if !defined(QUICKCALL) || QUICKCALL != 1\r
109         #error "QuickCall must be enabled (see ProjectOptions/Optimisations)"\r
110 #endif\r
111 \r
112 #include <stddef.h>\r
113 #include <pic.h>\r
114 \r
115 #define portCHAR                char\r
116 #define portFLOAT               float\r
117 #define portDOUBLE              portFLOAT\r
118 #define portLONG                long\r
119 #define portSHORT               short\r
120 #define portSTACK_TYPE  uint8_t\r
121 #define portBASE_TYPE   char\r
122 \r
123 typedef portSTACK_TYPE StackType_t;\r
124 typedef signed char BaseType_t;\r
125 typedef unsigned char UBaseType_t;\r
126 \r
127 \r
128 #if( configUSE_16_BIT_TICKS == 1 )\r
129         typedef uint16_t TickType_t;\r
130         #define portMAX_DELAY ( TickType_t )    ( 0xFFFF )\r
131 #else\r
132         typedef uint32_t TickType_t;\r
133         #define portMAX_DELAY ( TickType_t )    ( 0xFFFFFFFF )\r
134 #endif\r
135 \r
136 #define portBYTE_ALIGNMENT                      1\r
137 \r
138 /*-----------------------------------------------------------*/\r
139 \r
140 /*\r
141  * Constant used for context switch macro when we require the interrupt\r
142  * enable state to be forced when the interrupted task is switched back in.\r
143  */\r
144 #define portINTERRUPTS_FORCED                           (0x01)\r
145 \r
146 /*\r
147  * Constant used for context switch macro when we require the interrupt\r
148  * enable state to be unchanged when the interrupted task is switched back in.\r
149  */\r
150 #define portINTERRUPTS_UNCHANGED                        (0x00)\r
151 \r
152 /* Initial interrupt enable state for newly created tasks.  This value is\r
153  * used when a task switches in for the first time.\r
154  */\r
155 #define portINTERRUPTS_INITIAL_STATE            (portINTERRUPTS_FORCED)\r
156 \r
157 /*\r
158  * Macros to modify the global interrupt enable bit in INTCON.\r
159  */\r
160 #define portDISABLE_INTERRUPTS()        \\r
161         do                                                              \\r
162         {                                                               \\r
163                 bGIE=0;                                         \\r
164         } while(bGIE)   // MicroChip recommends this check!\r
165 \r
166 #define portENABLE_INTERRUPTS()         \\r
167         do                                                              \\r
168         {                                                               \\r
169                 bGIE=1;                                         \\r
170         } while(0)\r
171 \r
172 /*-----------------------------------------------------------*/\r
173 \r
174 /*\r
175  * Critical section macros.\r
176  */\r
177 extern uint8_t ucCriticalNesting;\r
178 \r
179 #define portNO_CRITICAL_SECTION_NESTING         ( ( uint8_t ) 0 )\r
180 \r
181 #define portENTER_CRITICAL()                                                                            \\r
182         do                                                                                                                              \\r
183         {                                                                                                                               \\r
184                 portDISABLE_INTERRUPTS();                                                                       \\r
185                                                                                                                                         \\r
186                 /*                                                                                                                      \\r
187                  * Now interrupts are disabled ucCriticalNesting                        \\r
188                  * can be accessed directly. Increment                                          \\r
189                  * ucCriticalNesting to keep a count of how                                     \\r
190                  * many times portENTER_CRITICAL() has been called.             \\r
191                  */                                                                                                                     \\r
192                 ucCriticalNesting++;                                                                            \\r
193         } while(0)\r
194 \r
195 #define portEXIT_CRITICAL()                                                                                     \\r
196         do                                                                                                                              \\r
197         {                                                                                                                               \\r
198                 if(ucCriticalNesting > portNO_CRITICAL_SECTION_NESTING)         \\r
199                 {                                                                                                                       \\r
200                         /*                                                                                                              \\r
201                          * Decrement the nesting count as we are leaving a              \\r
202                          * critical section.                                                                    \\r
203                          */                                                                                                             \\r
204                         ucCriticalNesting--;                                                                    \\r
205                 }                                                                                                                       \\r
206                                                                                                                                         \\r
207                 /*                                                                                                                      \\r
208                  * If the nesting level has reached zero then                           \\r
209                  * interrupts should be re-enabled.                                                     \\r
210                  */                                                                                                                     \\r
211                 if( ucCriticalNesting == portNO_CRITICAL_SECTION_NESTING )      \\r
212                 {                                                                                                                       \\r
213                         portENABLE_INTERRUPTS();                                                                \\r
214                 }                                                                                                                       \\r
215         } while(0)\r
216 \r
217 /*-----------------------------------------------------------*/\r
218 \r
219 /*\r
220  * The minimal stacksize is calculated on the first reference of\r
221  * portMINIMAL_STACK_SIZE. Some input to this calculation is\r
222  * compiletime determined, other input is port-defined (see port.c)\r
223  */\r
224 extern uint16_t usPortCALCULATE_MINIMAL_STACK_SIZE( void );\r
225 extern uint16_t usCalcMinStackSize;\r
226 \r
227 #define portMINIMAL_STACK_SIZE                                  \\r
228         ((usCalcMinStackSize == 0)                                      \\r
229                 ? usPortCALCULATE_MINIMAL_STACK_SIZE()  \\r
230                 : usCalcMinStackSize )\r
231 \r
232 /*\r
233  * WizC uses a downgrowing stack\r
234  */\r
235 #define portSTACK_GROWTH                        ( -1 )\r
236 \r
237 /*-----------------------------------------------------------*/\r
238 \r
239 /*\r
240  * Macro's that pushes all the registers that make up the context of a task onto\r
241  * the stack, then saves the new top of stack into the TCB. TOSU and TBLPTRU\r
242  * are only saved/restored on devices with more than 64kB (32k Words) ROM.\r
243  *\r
244  * The stackpointer is helt by WizC in FSR2 and points to the first free byte.\r
245  * WizC uses a "downgrowing" stack. There is no framepointer.\r
246  *\r
247  * We keep track of the interruptstatus using ucCriticalNesting. When this\r
248  * value equals zero, interrupts have to be enabled upon exit from the\r
249  * portRESTORE_CONTEXT macro.\r
250  *\r
251  * If this is called from an ISR then the interrupt enable bits must have been\r
252  * set for the ISR to ever get called.  Therefore we want to save\r
253  * ucCriticalNesting with value zero. This means the interrupts will again be\r
254  * re-enabled when the interrupted task is switched back in.\r
255  *\r
256  * If this is called from a manual context switch (i.e. from a call to yield),\r
257  * then we want to keep the current value of ucCritialNesting so it is restored\r
258  * with its current value. This allows a yield from within a critical section.\r
259  *\r
260  * The compiler uses some locations at the bottom of RAM for temporary\r
261  * storage. The compiler may also have been instructed to optimize\r
262  * function-parameters and local variables to global storage. The compiler\r
263  * uses an area called LocOpt for this wizC feature.\r
264  * The total overheadstorage has to be saved in it's entirety as part of\r
265  * a task context. These macro's store/restore from data address 0x0000 to\r
266  * (OVERHEADPAGE0-LOCOPTSIZE+MAXLOCOPTSIZE - 1).\r
267  * OVERHEADPAGE0, LOCOPTSIZE and MAXLOCOPTSIZE are compiler-generated\r
268  * assembler definitions.\r
269  */\r
270 \r
271 #define portSAVE_CONTEXT( ucInterruptForced )                                           \\r
272         do                                                                                                                              \\r
273         {                                                                                                                               \\r
274                 portDISABLE_INTERRUPTS();                                                                       \\r
275                                                                                                                                         \\r
276                 _Pragma("asm")                                                                                          \\r
277                         ;                                                                                                               \\r
278                         ; Push the relevant SFR's onto the task's stack                 \\r
279                         ;                                                                                                               \\r
280                         movff   STATUS,POSTDEC2                                                                 \\r
281                         movff   WREG,POSTDEC2                                                                   \\r
282                         movff   BSR,POSTDEC2                                                                    \\r
283                         movff   PRODH,POSTDEC2                                                                  \\r
284                         movff   PRODL,POSTDEC2                                                                  \\r
285                         movff   FSR0H,POSTDEC2                                                                  \\r
286                         movff   FSR0L,POSTDEC2                                                                  \\r
287                         movff   FSR1H,POSTDEC2                                                                  \\r
288                         movff   FSR1L,POSTDEC2                                                                  \\r
289                         movff   TABLAT,POSTDEC2                                                                 \\r
290                         if __ROMSIZE > 0x8000                                                                   \\r
291                                 movff   TBLPTRU,POSTDEC2                                                        \\r
292                         endif                                                                                                   \\r
293                         movff   TBLPTRH,POSTDEC2                                                                \\r
294                         movff   TBLPTRL,POSTDEC2                                                                \\r
295                         if __ROMSIZE > 0x8000                                                                   \\r
296                                 movff   PCLATU,POSTDEC2                                                         \\r
297                         endif                                                                                                   \\r
298                         movff   PCLATH,POSTDEC2                                                                 \\r
299                         ;                                                                                                               \\r
300                         ; Store the compiler-scratch-area as described above.   \\r
301                         ;                                                                                                               \\r
302                         movlw   OVERHEADPAGE0-LOCOPTSIZE+MAXLOCOPTSIZE                  \\r
303                         clrf    FSR0L,ACCESS                                                                    \\r
304                         clrf    FSR0H,ACCESS                                                                    \\r
305                 _rtos_S1:                                                                                                       \\r
306                         movff   POSTINC0,POSTDEC2                                                               \\r
307                         decfsz  WREG,W,ACCESS                                                                   \\r
308                         SMARTJUMP _rtos_S1                                                                              \\r
309                         ;                                                                                                               \\r
310                         ; Save the pic call/return-stack belonging to the               \\r
311                         ; current task by copying it to the task's software-    \\r
312                         ; stack. We save the hardware stack pointer (which              \\r
313                         ; is the number of addresses on the stack) in the               \\r
314                         ; W-register first because we need it later and it              \\r
315                         ; is modified in the save-loop by executing pop's.              \\r
316                         ; After the loop the W-register is stored on the                \\r
317                         ; stack, too.                                                                                   \\r
318                         ;                                                                                                               \\r
319                         movf    STKPTR,W,ACCESS                                                                 \\r
320                         bz              _rtos_s3                                                                                \\r
321                 _rtos_S2:                                                                                                       \\r
322                         if __ROMSIZE > 0x8000                                                                   \\r
323                                 movff   TOSU,POSTDEC2                                                           \\r
324                         endif                                                                                                   \\r
325                         movff   TOSH,POSTDEC2                                                                   \\r
326                         movff   TOSL,POSTDEC2                                                                   \\r
327                         pop                                                                                                             \\r
328                         tstfsz  STKPTR,ACCESS                                                                   \\r
329                         SMARTJUMP _rtos_S2                                                                              \\r
330                 _rtos_s3:                                                                                                       \\r
331                         movwf   POSTDEC2,ACCESS                                                                 \\r
332                         ;                                                                                                               \\r
333                         ; Next the value for ucCriticalNesting used by the              \\r
334                         ; task is stored on the stack. When                                             \\r
335                         ; (ucInterruptForced == portINTERRUPTS_FORCED), we save \\r
336                         ; it as 0 (portNO_CRITICAL_SECTION_NESTING).                    \\r
337                         ;                                                                                                               \\r
338                         if ucInterruptForced == portINTERRUPTS_FORCED                   \\r
339                                 clrf POSTDEC2,ACCESS                                                            \\r
340                         else                                                                                                    \\r
341                                 movff   ucCriticalNesting,POSTDEC2                                      \\r
342                         endif                                                                                                   \\r
343                         ;                                                                                                               \\r
344                         ; Save the new top of the software stack in the TCB.    \\r
345                         ;                                                                                                               \\r
346                         movff   pxCurrentTCB,FSR0L                                                              \\r
347                         movff   pxCurrentTCB+1,FSR0H                                                    \\r
348                         movff   FSR2L,POSTINC0                                                                  \\r
349                         movff   FSR2H,POSTINC0                                                                  \\r
350                 _Pragma("asmend")                                                                                       \\r
351         } while(0)\r
352 \r
353 /************************************************************/\r
354 \r
355 /*\r
356  * This is the reverse of portSAVE_CONTEXT.\r
357  */\r
358 #define portRESTORE_CONTEXT()                                                                           \\r
359         do                                                                                                                              \\r
360         {                                                                                                                               \\r
361                 _Pragma("asm")                                                                                          \\r
362                         ;                                                                                                               \\r
363                         ; Set FSR0 to point to pxCurrentTCB->pxTopOfStack.              \\r
364                         ;                                                                                                               \\r
365                         movff   pxCurrentTCB,FSR0L                                                              \\r
366                         movff   pxCurrentTCB+1,FSR0H                                                    \\r
367                         ;                                                                                                               \\r
368                         ; De-reference FSR0 to set the address it holds into    \\r
369                         ; FSR2 (i.e. *( pxCurrentTCB->pxTopOfStack ) ). FSR2    \\r
370                         ; is used by wizC as stackpointer.                                              \\r
371                         ;                                                                                                               \\r
372                         movff   POSTINC0,FSR2L                                                                  \\r
373                         movff   POSTINC0,FSR2H                                                                  \\r
374                         ;                                                                                                               \\r
375                         ; Next, the value for ucCriticalNesting used by the             \\r
376                         ; task is retrieved from the stack.                                             \\r
377                         ;                                                                                                               \\r
378                         movff   PREINC2,ucCriticalNesting                                               \\r
379                         ;                                                                                                               \\r
380                         ; Rebuild the pic call/return-stack. The number of              \\r
381                         ; return addresses is the next item on the task stack.  \\r
382                         ; Save this number in PRODL. Then fetch the addresses   \\r
383                         ; and store them on the hardwarestack.                                  \\r
384                         ; The datasheets say we can't use movff here...                 \\r
385                         ;                                                                                                               \\r
386                         movff   PREINC2,PRODL   // Use PRODL as tempregister    \\r
387                         clrf    STKPTR,ACCESS                                                                   \\r
388                 _rtos_R1:                                                                                                       \\r
389                         push                                                                                                    \\r
390                         movf    PREINC2,W,ACCESS                                                                \\r
391                         movwf   TOSL,ACCESS                                                                             \\r
392                         movf    PREINC2,W,ACCESS                                                                \\r
393                         movwf   TOSH,ACCESS                                                                             \\r
394                         if __ROMSIZE > 0x8000                                                                   \\r
395                                 movf    PREINC2,W,ACCESS                                                        \\r
396                                 movwf   TOSU,ACCESS                                                                     \\r
397                         else                                                                                                    \\r
398                                 clrf    TOSU,ACCESS                                                                     \\r
399                         endif                                                                                                   \\r
400                         decfsz  PRODL,F,ACCESS                                                                  \\r
401                         SMARTJUMP _rtos_R1                                                                              \\r
402                         ;                                                                                                               \\r
403                         ; Restore the compiler's working storage area to page 0 \\r
404                         ;                                                                                                               \\r
405                         movlw   OVERHEADPAGE0-LOCOPTSIZE+MAXLOCOPTSIZE                  \\r
406                         movwf   FSR0L,ACCESS                                                                    \\r
407                         clrf    FSR0H,ACCESS                                                                    \\r
408                 _rtos_R2:                                                                                                       \\r
409                         decf    FSR0L,F,ACCESS                                                                  \\r
410                         movff   PREINC2,INDF0                                                                   \\r
411                         tstfsz  FSR0L,ACCESS                                                                    \\r
412                         SMARTJUMP _rtos_R2                                                                              \\r
413                         ;                                                                                                               \\r
414                         ; Restore the sfr's forming the tasks context.                  \\r
415                         ; We cannot yet restore bsr, w and status because               \\r
416                         ; we need these registers for a final test.                             \\r
417                         ;                                                                                                               \\r
418                         movff   PREINC2,PCLATH                                                                  \\r
419                         if __ROMSIZE > 0x8000                                                                   \\r
420                                 movff   PREINC2,PCLATU                                                          \\r
421                         else                                                                                                    \\r
422                                 clrf    PCLATU,ACCESS                                                           \\r
423                         endif                                                                                                   \\r
424                         movff   PREINC2,TBLPTRL                                                                 \\r
425                         movff   PREINC2,TBLPTRH                                                                 \\r
426                         if __ROMSIZE > 0x8000                                                                   \\r
427                                 movff   PREINC2,TBLPTRU                                                         \\r
428                         else                                                                                                    \\r
429                                 clrf    TBLPTRU,ACCESS                                                          \\r
430                         endif                                                                                                   \\r
431                         movff   PREINC2,TABLAT                                                                  \\r
432                         movff   PREINC2,FSR1L                                                                   \\r
433                         movff   PREINC2,FSR1H                                                                   \\r
434                         movff   PREINC2,FSR0L                                                                   \\r
435                         movff   PREINC2,FSR0H                                                                   \\r
436                         movff   PREINC2,PRODL                                                                   \\r
437                         movff   PREINC2,PRODH                                                                   \\r
438                         ;                                                                                                               \\r
439                         ; The return from portRESTORE_CONTEXT() depends on              \\r
440                         ; the value of ucCriticalNesting. When it is zero,              \\r
441                         ; interrupts need to be enabled. This is done via a             \\r
442                         ; retfie instruction because we need the                                \\r
443                         ; interrupt-enabling and the return to the restored             \\r
444                         ; task to be uninterruptable.                                                   \\r
445                         ; Because bsr, status and W are affected by the test    \\r
446                         ; they are restored after the test.                                             \\r
447                         ;                                                                                                               \\r
448                         movlb   ucCriticalNesting>>8                                                    \\r
449                         tstfsz  ucCriticalNesting,BANKED                                                \\r
450                         SMARTJUMP _rtos_R4                                                                              \\r
451                 _rtos_R3:                                                                                                       \\r
452                         movff   PREINC2,BSR                                                                             \\r
453                         movff   PREINC2,WREG                                                                    \\r
454                         movff   PREINC2,STATUS                                                                  \\r
455                         retfie  0               ; Return enabling interrupts                    \\r
456                 _rtos_R4:                                                                                                       \\r
457                         movff   PREINC2,BSR                                                                             \\r
458                         movff   PREINC2,WREG                                                                    \\r
459                         movff   PREINC2,STATUS                                                                  \\r
460                         return  0               ; Return without affecting interrupts   \\r
461                 _Pragma("asmend")                                                                                       \\r
462         } while(0)\r
463 \r
464 /*-----------------------------------------------------------*/\r
465 \r
466 #define portTICK_PERIOD_MS      ( ( TickType_t ) 1000 / configTICK_RATE_HZ )\r
467 \r
468 /*-----------------------------------------------------------*/\r
469 \r
470 extern void vPortYield( void );\r
471 #define portYIELD()                             vPortYield()\r
472 \r
473 #define portNOP()       _Pragma("asm")                                                                  \\r
474                                                 nop                                                                                     \\r
475                                         _Pragma("asmend")\r
476 \r
477 /*-----------------------------------------------------------*/\r
478 \r
479 #define portTASK_FUNCTION( xFunction, pvParameters )            \\r
480         void pointed xFunction( void *pvParameters )            \\r
481         _Pragma(asmfunc xFunction)\r
482 \r
483 #define portTASK_FUNCTION_PROTO         portTASK_FUNCTION\r
484 /*-----------------------------------------------------------*/\r
485 \r
486 \r
487 #define volatile\r
488 #define register\r
489 \r
490 #endif /* PORTMACRO_H */\r
491 \r