mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 00:57:44 -04:00
Updated indentation in portable/GCC/{AVR_AVRDx, AVR_Mega0}/* files.
This commit is contained in:
parent
8d4d07fecd
commit
7dc6827386
6 changed files with 450 additions and 506 deletions
|
@ -63,7 +63,6 @@ extern volatile RTOS_TCB_t *volatile pxCurrentTCB;
|
|||
*
|
||||
* The interrupts will have been disabled during the call to portSAVE_CONTEXT()
|
||||
* so we need not worry about reading/writing to the stack pointer.
|
||||
|
||||
*/
|
||||
|
||||
#define portSAVE_CONTEXT() \
|
||||
|
@ -292,7 +291,6 @@ void vPortYieldFromTick(void) __attribute__((naked));
|
|||
void vPortYieldFromTick(void)
|
||||
{
|
||||
portSAVE_CONTEXT();
|
||||
|
||||
if (xTaskIncrementTick() != pdFALSE) {
|
||||
vTaskSwitchContext();
|
||||
}
|
||||
|
@ -319,7 +317,6 @@ static void prvSetupTimerInterrupt(void)
|
|||
* the context is saved at the start of vPortYieldFromTick(). The tick
|
||||
* count is incremented after the context is saved.
|
||||
*/
|
||||
|
||||
ISR(TICK_INT_vect, ISR_NAKED)
|
||||
{
|
||||
/* Clear tick interrupt flag. */
|
||||
|
@ -329,7 +326,6 @@ ISR(TICK_INT_vect, ISR_NAKED)
|
|||
|
||||
asm volatile("reti");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
|
@ -337,14 +333,10 @@ ISR(TICK_INT_vect, ISR_NAKED)
|
|||
* tick count. We don't need to switch context, this can only be done by
|
||||
* manual calls to taskYIELD();
|
||||
*/
|
||||
|
||||
ISR(TICK_INT_vect)
|
||||
{
|
||||
/* Clear tick interrupt flag. */
|
||||
INT_FLAGS = INT_MASK;
|
||||
|
||||
xTaskIncrementTick();
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
/*-----------------------------------------------------------*/
|
||||
|
||||
#define CLR_INT(FLAG_REG, FLAG_MASK) \
|
||||
asm volatile( "push r16\n\t" \
|
||||
asm volatile( \
|
||||
"push r16\n\t" \
|
||||
"ldi r16, %1\n\t" \
|
||||
"sts %0, r16\n\t" \
|
||||
"pop r16\n\t" \
|
||||
|
@ -26,11 +27,6 @@
|
|||
TCB0.CTRLA = TCB_ENABLE_bm; \
|
||||
}
|
||||
|
||||
#define TICK_stop() { \
|
||||
TCB0.INTCTRL &= ~TCB_CAPT_bm;\
|
||||
TCB0.CTRLA &= ~TCB_ENABLE_bm; \
|
||||
}
|
||||
|
||||
#elif ( configUSE_TIMER_INSTANCE == 1 )
|
||||
|
||||
#define TICK_INT_vect TCB1_INT_vect
|
||||
|
@ -55,11 +51,6 @@
|
|||
TCB2.CTRLA = TCB_ENABLE_bm; \
|
||||
}
|
||||
|
||||
#define TICK_stop() { \
|
||||
TCB2.INTCTRL &= ~TCB_CAPT_bm; \
|
||||
TCB2.CTRLA &= ~TCB_ENABLE_bm; \
|
||||
}
|
||||
|
||||
#elif ( configUSE_TIMER_INSTANCE == 3 )
|
||||
|
||||
#define TICK_INT_vect TCB3_INT_vect
|
||||
|
@ -72,11 +63,6 @@
|
|||
TCB3.CTRLA = TCB_ENABLE_bm; \
|
||||
}
|
||||
|
||||
#define TICK_stop() { \
|
||||
TCB3.INTCTRL &= ~TCB_CAPT_bm; \
|
||||
TCB3.CTRLA &= ~TCB_ENABLE_bm; \
|
||||
}
|
||||
|
||||
#elif ( configUSE_TIMER_INSTANCE == 4 )
|
||||
|
||||
#define TICK_INT_vect TCB4_INT_vect
|
||||
|
@ -89,20 +75,14 @@
|
|||
TCB4.CTRLA = TCB_ENABLE_bm; \
|
||||
}
|
||||
|
||||
#define TICK_stop() { \
|
||||
TCB4.INTCTRL &= ~TCB_CAPT_bm; \
|
||||
TCB4.CTRLA &= ~TCB_ENABLE_bm; \
|
||||
}
|
||||
|
||||
#elif ( configUSE_TIMER_INSTANCE == 5 )
|
||||
|
||||
/* Hertz to period for RTC setup */
|
||||
#define RTC_PERIOD_HZ(x) (32768 * ((1.0 / x)))
|
||||
|
||||
#define TICK_INT_vect RTC_CNT_vect
|
||||
#define INT_FLAGS RTC_INTFLAGS
|
||||
#define INT_MASK RTC_OVF_bm
|
||||
|
||||
/* Hertz to period for RTC setup */
|
||||
#define RTC_PERIOD_HZ(x) ( 32768 * ( ( 1.0 / x ) ) )
|
||||
#define TICK_init() { \
|
||||
while (RTC.STATUS > 0); \
|
||||
RTC.CTRLA = RTC_PRESCALER_DIV1_gc | 1 << RTC_RTCEN_bp; \
|
||||
|
@ -110,11 +90,6 @@
|
|||
RTC.INTCTRL |= 1 << RTC_OVF_bp; \
|
||||
}
|
||||
|
||||
#define TICK_stop() { \
|
||||
RTC.CTRLA &= ~(1 << RTC_RTCEN_bp); \
|
||||
RTC.INTCTRL &= ~(1 << RTC_OVF_bp); \
|
||||
}
|
||||
|
||||
#else
|
||||
#undef TICK_INT_vect
|
||||
#undef INT_FLAGS
|
||||
|
|
|
@ -64,7 +64,6 @@ typedef uint16_t TickType_t;
|
|||
typedef uint32_t TickType_t;
|
||||
#define portMAX_DELAY (TickType_t)0xffffffffUL
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Critical section management. */
|
||||
|
|
|
@ -29,9 +29,7 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include <avr/interrupt.h>
|
||||
|
||||
#include "porthardware.h"
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
/*-----------------------------------------------------------*/
|
||||
|
||||
#define CLR_INT(FLAG_REG, FLAG_MASK) \
|
||||
asm volatile( "push r16\n\t" \
|
||||
asm volatile( \
|
||||
"push r16\n\t" \
|
||||
"ldi r16, %1\n\t" \
|
||||
"sts %0, r16\n\t" \
|
||||
"pop r16\n\t" \
|
||||
|
@ -26,11 +27,6 @@
|
|||
TCB0.CTRLA = TCB_ENABLE_bm; \
|
||||
}
|
||||
|
||||
#define TICK_stop() { \
|
||||
TCB0.INTCTRL &= ~TCB_CAPT_bm;\
|
||||
TCB0.CTRLA &= ~TCB_ENABLE_bm; \
|
||||
}
|
||||
|
||||
#elif ( configUSE_TIMER_INSTANCE == 1 )
|
||||
|
||||
#define TICK_INT_vect TCB1_INT_vect
|
||||
|
@ -55,11 +51,6 @@
|
|||
TCB2.CTRLA = TCB_ENABLE_bm; \
|
||||
}
|
||||
|
||||
#define TICK_stop() { \
|
||||
TCB2.INTCTRL &= ~TCB_CAPT_bm; \
|
||||
TCB2.CTRLA &= ~TCB_ENABLE_bm; \
|
||||
}
|
||||
|
||||
#elif ( configUSE_TIMER_INSTANCE == 3 )
|
||||
|
||||
#define TICK_INT_vect TCB3_INT_vect
|
||||
|
@ -72,17 +63,13 @@
|
|||
TCB3.CTRLA = TCB_ENABLE_bm; \
|
||||
}
|
||||
|
||||
#define TICK_stop() { \
|
||||
TCB3.INTCTRL &= ~TCB_CAPT_bm; \
|
||||
TCB3.CTRLA &= ~TCB_ENABLE_bm; \
|
||||
}
|
||||
|
||||
#elif ( configUSE_TIMER_INSTANCE == 4 )
|
||||
|
||||
#define TICK_INT_vect RTC_CNT_vect
|
||||
#define INT_FLAGS RTC_INTFLAGS
|
||||
#define INT_MASK RTC_OVF_bm
|
||||
|
||||
/* Hertz to period for RTC setup */
|
||||
#define RTC_PERIOD_HZ(x) ( 32768 * ( ( 1.0 / x ) ) )
|
||||
#define TICK_init() { \
|
||||
while (RTC.STATUS > 0); \
|
||||
|
@ -91,16 +78,12 @@
|
|||
RTC.INTCTRL |= 1 << RTC_OVF_bp; \
|
||||
}
|
||||
|
||||
#define TICK_stop() { \
|
||||
RTC.CTRLA &= ~(1 << RTC_RTCEN_bp); \
|
||||
RTC.INTCTRL &= ~(1 << RTC_OVF_bp); \
|
||||
}
|
||||
|
||||
#else
|
||||
#undef TICK_INT_vect
|
||||
#undef INT_FLAGS
|
||||
#undef INT_MASK
|
||||
#error Invalid timer setting
|
||||
#undef TICK_init()
|
||||
#error Invalid timer setting.
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
|
@ -85,7 +85,6 @@ typedef uint32_t TickType_t;
|
|||
#define portTICK_PERIOD_MS ((TickType_t)1000 / configTICK_RATE_HZ)
|
||||
#define portBYTE_ALIGNMENT 1
|
||||
#define portNOP() asm volatile("nop");
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Kernel utilities. */
|
||||
|
@ -94,7 +93,6 @@ extern void vPortYield(void) __attribute__((naked));
|
|||
|
||||
extern void vPortYieldFromISR(void) __attribute__((naked));
|
||||
#define portYIELD_FROM_ISR() vPortYieldFromISR()
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Task function macros as described on the FreeRTOS.org WEB site. */
|
||||
|
@ -106,4 +104,3 @@ extern void vPortYieldFromISR(void) __attribute__((naked));
|
|||
#endif
|
||||
|
||||
#endif /* PORTMACRO_H */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue