3333/*-----------------------------------------------------------*/
3434
3535/* We require the address of the pxCurrentTCB variable, but don't want to know
36- * any details of its type. */
36+ any details of its type. */
3737typedef void TCB_t ;
3838extern volatile TCB_t * volatile pxCurrentTCB ;
3939
@@ -106,12 +106,10 @@ static void prvSetupTimerInterrupt( void );
106106 *
107107 * See the header file portable.h.
108108 */
109- StackType_t * pxPortInitialiseStack ( StackType_t * pxTopOfStack ,
110- TaskFunction_t pxCode ,
111- void * pvParameters )
109+ StackType_t * pxPortInitialiseStack ( StackType_t * pxTopOfStack , TaskFunction_t pxCode , void * pvParameters )
112110{
113111 /* Place a few bytes of known values on the bottom of the stack.
114- * This is just useful for debugging. */
112+ This is just useful for debugging. */
115113
116114 * pxTopOfStack = 0x11111111 ;
117115 pxTopOfStack -- ;
@@ -121,9 +119,9 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
121119 pxTopOfStack -- ;
122120
123121 /* This is a redundant push to the stack, it may be required if
124- * in some implementations of the compiler the parameter to the task
125- * is passed on to the stack rather than in R4 register. */
126- * pxTopOfStack = ( StackType_t ) ( pvParameters );
122+ in some implementations of the compiler the parameter to the task
123+ is passed on to the stack rather than in R4 register. */
124+ * pxTopOfStack = (StackType_t )( pvParameters );
127125 pxTopOfStack -- ;
128126
129127 * pxTopOfStack = ( StackType_t ) 0x00000000 ; /* RP */
@@ -136,36 +134,36 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
136134 pxTopOfStack -- ;
137135
138136 /* In the current implementation of the compiler the first
139- * parameter to the task (or function) is passed via R4 parameter
140- * to the task, hence the pvParameters pointer is copied into the R4
141- * register. See compiler manual section 4.6.2 for more information. */
142- * pxTopOfStack = ( StackType_t ) ( pvParameters ); /* R4 */
137+ parameter to the task (or function) is passed via R4 parameter
138+ to the task, hence the pvParameters pointer is copied into the R4
139+ register. See compiler manual section 4.6.2 for more information. */
140+ * pxTopOfStack = ( StackType_t ) (pvParameters ); /* R4 */
143141 pxTopOfStack -- ;
144- * pxTopOfStack = ( StackType_t ) 0x00003333 ; /* R3 */
142+ * pxTopOfStack = ( StackType_t ) 0x00003333 ; /* R3 */
145143 pxTopOfStack -- ;
146- * pxTopOfStack = ( StackType_t ) 0x00002222 ; /* R2 */
144+ * pxTopOfStack = ( StackType_t ) 0x00002222 ; /* R2 */
147145 pxTopOfStack -- ;
148- * pxTopOfStack = ( StackType_t ) 0x00001111 ; /* R1 */
146+ * pxTopOfStack = ( StackType_t ) 0x00001111 ; /* R1 */
149147 pxTopOfStack -- ;
150- * pxTopOfStack = ( StackType_t ) 0x00000001 ; /* R0 */
148+ * pxTopOfStack = ( StackType_t ) 0x00000001 ; /* R0 */
151149 pxTopOfStack -- ;
152- * pxTopOfStack = ( StackType_t ) 0x0000EEEE ; /* R14 */
150+ * pxTopOfStack = ( StackType_t ) 0x0000EEEE ; /* R14 */
153151 pxTopOfStack -- ;
154- * pxTopOfStack = ( StackType_t ) 0x0000DDDD ; /* R13 */
152+ * pxTopOfStack = ( StackType_t ) 0x0000DDDD ; /* R13 */
155153 pxTopOfStack -- ;
156- * pxTopOfStack = ( StackType_t ) 0x0000CCCC ; /* R12 */
154+ * pxTopOfStack = ( StackType_t ) 0x0000CCCC ; /* R12 */
157155 pxTopOfStack -- ;
158- * pxTopOfStack = ( StackType_t ) 0x0000BBBB ; /* R11 */
156+ * pxTopOfStack = ( StackType_t ) 0x0000BBBB ; /* R11 */
159157 pxTopOfStack -- ;
160- * pxTopOfStack = ( StackType_t ) 0x0000AAAA ; /* R10 */
158+ * pxTopOfStack = ( StackType_t ) 0x0000AAAA ; /* R10 */
161159 pxTopOfStack -- ;
162- * pxTopOfStack = ( StackType_t ) 0x00009999 ; /* R9 */
160+ * pxTopOfStack = ( StackType_t ) 0x00009999 ; /* R9 */
163161 pxTopOfStack -- ;
164- * pxTopOfStack = ( StackType_t ) 0x00008888 ; /* R8 */
162+ * pxTopOfStack = ( StackType_t ) 0x00008888 ; /* R8 */
165163 pxTopOfStack -- ;
166- * pxTopOfStack = ( StackType_t ) 0x11110000 ; /* MDH */
164+ * pxTopOfStack = ( StackType_t ) 0x11110000 ; /* MDH */
167165 pxTopOfStack -- ;
168- * pxTopOfStack = ( StackType_t ) 0x22220000 ; /* MDL */
166+ * pxTopOfStack = ( StackType_t ) 0x22220000 ; /* MDL */
169167 pxTopOfStack -- ;
170168
171169 /* The start of the task code. */
@@ -190,8 +188,8 @@ BaseType_t xPortStartScheduler( void )
190188 #pragma endasm
191189
192190 /* Simulate a function call end as generated by the compiler. We will now
193- * jump to the start of the task the context of which we have just restored. */
194- __asm( " reti " );
191+ jump to the start of the task the context of which we have just restored. */
192+ __asm(" reti " );
195193
196194 /* Should not get here. */
197195 return pdFAIL ;
@@ -201,39 +199,39 @@ BaseType_t xPortStartScheduler( void )
201199void vPortEndScheduler ( void )
202200{
203201 /* Not implemented - unlikely to ever be required as there is nothing to
204- * return to. */
202+ return to. */
205203}
206204/*-----------------------------------------------------------*/
207205
208206static void prvSetupTimerInterrupt ( void )
209207{
210208/* The peripheral clock divided by 32 is used by the timer. */
211- const uint16_t usReloadValue = ( uint16_t ) ( ( ( configPER_CLOCK_HZ / configTICK_RATE_HZ ) / 32UL ) - 1UL );
209+ const uint16_t usReloadValue = ( uint16_t ) ( ( ( configPER_CLOCK_HZ / configTICK_RATE_HZ ) / 32UL ) - 1UL );
212210
213211 /* Setup RLT0 to generate a tick interrupt. */
214212
215- TMCSR0_CNTE = 0 ; /* Count Disable */
216- TMCSR0_CSL = 0x2 ; /* CLKP/32 */
217- TMCSR0_MOD = 0 ; /* Software trigger */
218- TMCSR0_RELD = 1 ; /* Reload */
213+ TMCSR0_CNTE = 0 ; /* Count Disable */
214+ TMCSR0_CSL = 0x2 ; /* CLKP/32 */
215+ TMCSR0_MOD = 0 ; /* Software trigger */
216+ TMCSR0_RELD = 1 ; /* Reload */
219217
220- TMCSR0_UF = 0 ; /* Clear underflow flag */
218+ TMCSR0_UF = 0 ; /* Clear underflow flag */
221219 TMRLR0 = usReloadValue ;
222- TMCSR0_INTE = 1 ; /* Interrupt Enable */
223- TMCSR0_CNTE = 1 ; /* Count Enable */
224- TMCSR0_TRG = 1 ; /* Trigger */
220+ TMCSR0_INTE = 1 ; /* Interrupt Enable */
221+ TMCSR0_CNTE = 1 ; /* Count Enable */
222+ TMCSR0_TRG = 1 ; /* Trigger */
225223
226- PORTEN = 0x3 ; /* Port Enable */
224+ PORTEN = 0x3 ; /* Port Enable */
227225}
228226/*-----------------------------------------------------------*/
229227
230228#if configUSE_PREEMPTION == 1
231229
232- /*
233- * Tick ISR for preemptive scheduler. The tick count is incremented
234- * after the context is saved. Then the context is switched if required,
235- * and last the context of the task which is to be resumed is restored.
236- */
230+ /*
231+ * Tick ISR for preemptive scheduler. The tick count is incremented
232+ * after the context is saved. Then the context is switched if required,
233+ * and last the context of the task which is to be resumed is restored.
234+ */
237235
238236 #pragma asm
239237
@@ -259,21 +257,21 @@ static void prvSetupTimerInterrupt( void )
259257
260258 #pragma endasm
261259
262- #else /* if configUSE_PREEMPTION == 1 */
260+ #else
263261
264- /*
265- * Tick ISR for the cooperative scheduler. All this does is increment the
266- * tick count. We don't need to switch context, this can only be done by
267- * manual calls to taskYIELD();
268- */
262+ /*
263+ * Tick ISR for the cooperative scheduler. All this does is increment the
264+ * tick count. We don't need to switch context, this can only be done by
265+ * manual calls to taskYIELD();
266+ */
269267 __interrupt void ReloadTimer0_IRQHandler ( void )
270268 {
271269 /* Clear RLT0 interrupt flag */
272270 TMCSR0_UF = 0 ;
273271 xTaskIncrementTick ();
274272 }
275273
276- #endif /* if configUSE_PREEMPTION == 1 */
274+ #endif
277275
278276/*
279277 * Manual context switch. We can use a __nosavereg attribute as the context
0 commit comments