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