Skip to content

Commit a11c3e8

Browse files
authored
Merge branch 'main' into fixSDCCFormatting
2 parents 7501542 + 9a2ce91 commit a11c3e8

File tree

16 files changed

+1848
-1885
lines changed

16 files changed

+1848
-1885
lines changed

portable/MPLAB/PIC18F/port.c

Lines changed: 256 additions & 258 deletions
Large diffs are not rendered by default.

portable/MPLAB/PIC18F/portmacro.h

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -40,67 +40,65 @@
4040
*/
4141

4242
/* Type definitions. */
43-
#define portCHAR char
44-
#define portFLOAT float
45-
#define portDOUBLE double
46-
#define portLONG long
47-
#define portSHORT int
48-
#define portSTACK_TYPE uint8_t
49-
#define portBASE_TYPE char
43+
#define portCHAR char
44+
#define portFLOAT float
45+
#define portDOUBLE double
46+
#define portLONG long
47+
#define portSHORT int
48+
#define portSTACK_TYPE uint8_t
49+
#define portBASE_TYPE char
5050

51-
typedef portSTACK_TYPE StackType_t;
52-
typedef signed char BaseType_t;
53-
typedef unsigned char UBaseType_t;
51+
typedef portSTACK_TYPE StackType_t;
52+
typedef signed char BaseType_t;
53+
typedef unsigned char UBaseType_t;
5454

55-
#if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
56-
typedef uint16_t TickType_t;
57-
#define portMAX_DELAY ( TickType_t ) 0xffff
58-
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
59-
typedef uint32_t TickType_t;
55+
#if( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
56+
typedef uint16_t TickType_t;
57+
#define portMAX_DELAY ( TickType_t ) 0xffff
58+
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
59+
typedef uint32_t TickType_t;
6060
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL
6161
#else
6262
#error configTICK_TYPE_WIDTH_IN_BITS set to unsupported tick type width.
6363
#endif
6464
/*-----------------------------------------------------------*/
6565

6666
/* Hardware specifics. */
67-
#define portBYTE_ALIGNMENT 1
68-
#define portGLOBAL_INT_ENABLE_BIT 0x80
69-
#define portSTACK_GROWTH 1
70-
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
67+
#define portBYTE_ALIGNMENT 1
68+
#define portGLOBAL_INT_ENABLE_BIT 0x80
69+
#define portSTACK_GROWTH 1
70+
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
7171
/*-----------------------------------------------------------*/
7272

7373
/* Critical section management. */
7474
#define portDISABLE_INTERRUPTS() INTCONbits.GIEH = 0;
7575
#define portENABLE_INTERRUPTS() INTCONbits.GIEH = 1;
7676

7777
/* Push the INTCON register onto the stack, then disable interrupts. */
78-
#define portENTER_CRITICAL() \
79-
POSTINC1 = INTCON; \
80-
INTCONbits.GIEH = 0;
78+
#define portENTER_CRITICAL() POSTINC1 = INTCON; \
79+
INTCONbits.GIEH = 0;
8180

8281
/* Retrieve the INTCON register from the stack, and enable interrupts
83-
* if they were saved as being enabled. Don't modify any other bits
84-
* within the INTCON register as these may have legitimately have been
85-
* modified within the critical region. */
86-
#define portEXIT_CRITICAL() \
87-
_asm \
88-
MOVF POSTDEC1, 1, 0 \
89-
_endasm \
90-
if( INDF1 & portGLOBAL_INT_ENABLE_BIT ) \
91-
{ \
92-
portENABLE_INTERRUPTS(); \
93-
}
82+
if they were saved as being enabled. Don't modify any other bits
83+
within the INTCON register as these may have legitimately have been
84+
modified within the critical region. */
85+
#define portEXIT_CRITICAL() _asm \
86+
MOVF POSTDEC1, 1, 0 \
87+
_endasm \
88+
if( INDF1 & portGLOBAL_INT_ENABLE_BIT ) \
89+
{ \
90+
portENABLE_INTERRUPTS(); \
91+
}
9492
/*-----------------------------------------------------------*/
9593

9694
/* Task utilities. */
9795
extern void vPortYield( void );
98-
#define portYIELD() vPortYield()
96+
#define portYIELD() vPortYield()
9997
/*-----------------------------------------------------------*/
10098

10199
/* Task function macros as described on the FreeRTOS.org WEB site. */
102-
#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void * pvParameters )
103-
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void * pvParameters )
100+
#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
101+
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
104102
/*-----------------------------------------------------------*/
105103

106104
/* Required by the kernel aware debugger. */
@@ -109,9 +107,8 @@ extern void vPortYield( void );
109107
#endif
110108

111109

112-
#define portNOP() \
113-
_asm \
114-
NOP \
115-
_endasm
110+
#define portNOP() _asm \
111+
NOP \
112+
_endasm
116113

117114
#endif /* PORTMACRO_H */

0 commit comments

Comments
 (0)