Skip to content

Commit cb196dd

Browse files
Skptakkar-rahul-awsaggarg
authored
Revert Portable/WizC Formatting (#888)
* Revert formatting on WizC ports * Fix spelling mistakes --------- Co-authored-by: Rahul Kar <[email protected]> Co-authored-by: Gaurav-Aggarwal-AWS <[email protected]>
1 parent b3febb7 commit cb196dd

File tree

5 files changed

+400
-405
lines changed

5 files changed

+400
-405
lines changed

portable/WizC/PIC18/Drivers/Tick/Tick.c

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

2929
/*
30-
* Changes from V3.0.0
31-
+ ISRcode is pulled inline and portTICKisr() is therefore
32-
+ deleted from this file.
33-
+
34-
+ Prescaler logic for Timer1 added to allow for a wider
35-
+ range of TickRates.
36-
+
37-
+ Changes from V3.0.1
38-
*/
30+
Changes from V3.0.0
31+
+ ISRcode is pulled inline and portTICKisr() is therefore
32+
deleted from this file.
33+
34+
+ Prescaler logic for Timer1 added to allow for a wider
35+
range of TickRates.
36+
37+
Changes from V3.0.1
38+
*/
3939

4040
#include <FreeRTOS.h>
4141
#include <task.h>
4242

4343
/* IO port constants. */
44-
#define portBIT_SET ( 1 )
45-
#define portBIT_CLEAR ( 0 )
44+
#define portBIT_SET (1)
45+
#define portBIT_CLEAR (0)
4646

4747
/*
4848
* Hardware setup for the tick.
4949
* We use a compare match on timer1. Depending on MPU-frequency
5050
* and requested tickrate, a prescaled value with a matching
5151
* prescaler are determined.
5252
*/
53-
#define portTIMER_COMPARE_BASE ( ( APROCFREQ / 4 ) / configTICK_RATE_HZ )
53+
#define portTIMER_COMPARE_BASE ((APROCFREQ/4)/configTICK_RATE_HZ)
5454

55-
#if portTIMER_COMPARE_BASE < 0x10000
56-
#define portTIMER_COMPARE_VALUE ( portTIMER_COMPARE_BASE )
57-
#define portTIMER_COMPARE_PS1 ( portBIT_CLEAR )
58-
#define portTIMER_COMPARE_PS0 ( portBIT_CLEAR )
55+
#if portTIMER_COMPARE_BASE < 0x10000
56+
#define portTIMER_COMPARE_VALUE (portTIMER_COMPARE_BASE)
57+
#define portTIMER_COMPARE_PS1 (portBIT_CLEAR)
58+
#define portTIMER_COMPARE_PS0 (portBIT_CLEAR)
5959
#elif portTIMER_COMPARE_BASE < 0x20000
60-
#define portTIMER_COMPARE_VALUE ( portTIMER_COMPARE_BASE / 2 )
61-
#define portTIMER_COMPARE_PS1 ( portBIT_CLEAR )
62-
#define portTIMER_COMPARE_PS0 ( portBIT_SET )
60+
#define portTIMER_COMPARE_VALUE (portTIMER_COMPARE_BASE / 2)
61+
#define portTIMER_COMPARE_PS1 (portBIT_CLEAR)
62+
#define portTIMER_COMPARE_PS0 (portBIT_SET)
6363
#elif portTIMER_COMPARE_BASE < 0x40000
64-
#define portTIMER_COMPARE_VALUE ( portTIMER_COMPARE_BASE / 4 )
65-
#define portTIMER_COMPARE_PS1 ( portBIT_SET )
66-
#define portTIMER_COMPARE_PS0 ( portBIT_CLEAR )
64+
#define portTIMER_COMPARE_VALUE (portTIMER_COMPARE_BASE / 4)
65+
#define portTIMER_COMPARE_PS1 (portBIT_SET)
66+
#define portTIMER_COMPARE_PS0 (portBIT_CLEAR)
6767
#elif portTIMER_COMPARE_BASE < 0x80000
68-
#define portTIMER_COMPARE_VALUE ( portTIMER_COMPARE_BASE / 8 )
69-
#define portTIMER_COMPARE_PS1 ( portBIT_SET )
70-
#define portTIMER_COMPARE_PS0 ( portBIT_SET )
71-
#else /* if portTIMER_COMPARE_BASE < 0x10000 */
68+
#define portTIMER_COMPARE_VALUE (portTIMER_COMPARE_BASE / 8)
69+
#define portTIMER_COMPARE_PS1 (portBIT_SET)
70+
#define portTIMER_COMPARE_PS0 (portBIT_SET)
71+
#else
7272
#error "TickRate out of range"
73-
#endif /* if portTIMER_COMPARE_BASE < 0x10000 */
73+
#endif
7474

7575
/*-----------------------------------------------------------*/
7676

@@ -92,27 +92,27 @@ void portSetupTick( void )
9292
* Set the compare match value.
9393
*/
9494
CCPR1H = ( uint8_t ) ( ( portTIMER_COMPARE_VALUE >> 8 ) & 0xff );
95-
CCPR1L = ( uint8_t ) ( portTIMER_COMPARE_VALUE & 0xff );
95+
CCPR1L = ( uint8_t ) ( portTIMER_COMPARE_VALUE & 0xff );
9696

9797
/*
9898
* Set Compare Special Event Trigger Mode
9999
*/
100-
bCCP1M3 = portBIT_SET;
101-
bCCP1M2 = portBIT_CLEAR;
102-
bCCP1M1 = portBIT_SET;
103-
bCCP1M0 = portBIT_SET;
100+
bCCP1M3 = portBIT_SET;
101+
bCCP1M2 = portBIT_CLEAR;
102+
bCCP1M1 = portBIT_SET;
103+
bCCP1M0 = portBIT_SET;
104104

105105
/*
106106
* Enable CCP1 interrupt
107107
*/
108-
bCCP1IE = portBIT_SET;
108+
bCCP1IE = portBIT_SET;
109109

110110
/*
111111
* We are only going to use the global interrupt bit, so disable
112112
* interruptpriorities and enable peripheral interrupts.
113113
*/
114-
bIPEN = portBIT_CLEAR;
115-
bPEIE = portBIT_SET;
114+
bIPEN = portBIT_CLEAR;
115+
bPEIE = portBIT_SET;
116116

117117
/*
118118
* Set up timer1
@@ -128,12 +128,12 @@ void portSetupTick( void )
128128
/*
129129
* Setup the timer
130130
*/
131-
bRD16 = portBIT_SET; /* 16-bit */
132-
bT1CKPS1 = portTIMER_COMPARE_PS1; /* prescaler */
133-
bT1CKPS0 = portTIMER_COMPARE_PS0; /* prescaler */
134-
bT1OSCEN = portBIT_SET; /* Oscillator enable */
135-
bT1SYNC = portBIT_SET; /* No external clock sync */
136-
bTMR1CS = portBIT_CLEAR; /* Internal clock */
137-
138-
bTMR1ON = portBIT_SET; /* Start timer1 */
131+
bRD16 = portBIT_SET; // 16-bit
132+
bT1CKPS1 = portTIMER_COMPARE_PS1; // prescaler
133+
bT1CKPS0 = portTIMER_COMPARE_PS0; // prescaler
134+
bT1OSCEN = portBIT_SET; // Oscillator enable
135+
bT1SYNC = portBIT_SET; // No external clock sync
136+
bTMR1CS = portBIT_CLEAR; // Internal clock
137+
138+
bTMR1ON = portBIT_SET; // Start timer1
139139
}

portable/WizC/PIC18/Drivers/Tick/isrTick.c

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

2929
/*
30-
* Changes from V3.0.0
31-
+ ISRcode pulled inline to reduce stack-usage.
32-
+
33-
+ Added functionality to only call vTaskSwitchContext() once
34-
+ when handling multiple interruptsources in a single interruptcall.
35-
+
36-
+ Filename changed to a .c extension to allow stepping through code
37-
+ using F7.
38-
+
39-
+ Changes from V3.0.1
40-
*/
30+
Changes from V3.0.0
31+
+ ISRcode pulled inline to reduce stack-usage.
32+
33+
+ Added functionality to only call vTaskSwitchContext() once
34+
when handling multiple interruptsources in a single interruptcall.
35+
36+
+ Filename changed to a .c extension to allow stepping through code
37+
using F7.
38+
39+
Changes from V3.0.1
40+
*/
4141

4242
/*
4343
* ISR for the tick.
@@ -76,4 +76,4 @@
7676

7777
#pragma wizcpp uselib "$__PATHNAME__/Tick.c"
7878

79-
#endif /* _FREERTOS_DRIVERS_TICK_ISRTICK_C */
79+
#endif /* _FREERTOS_DRIVERS_TICK_ISRTICK_C */

portable/WizC/PIC18/addFreeRTOS.h

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

2929
/*
30-
* Changes from V3.0.0
31-
*
32-
* Changes from V3.0.1
33-
*
34-
* Changes from V4.0.1
35-
* Uselib pragma added for Croutine.c
36-
*/
30+
Changes from V3.0.0
31+
32+
Changes from V3.0.1
33+
34+
Changes from V4.0.1
35+
Uselib pragma added for Croutine.c
36+
*/
3737

3838
/*
3939
* The installation script will automatically prepend this file to the default FreeRTOS.h.
@@ -51,4 +51,4 @@
5151
#pragma wizcpp uselib "$__PATHNAME__/libFreeRTOS/Modules/List.c"
5252
#pragma wizcpp uselib "$__PATHNAME__/libFreeRTOS/Modules/Port.c"
5353

54-
#endif /* WIZC_FREERTOS_H */
54+
#endif /* WIZC_FREERTOS_H */

0 commit comments

Comments
 (0)