Skip to content

Commit d4e699c

Browse files
committed
Merge pull request DuinOS#4 from niesteszeck/master
repaired portSAVE_CONTEXT() for atmega2560
2 parents b85121a + 75cb30d commit d4e699c

File tree

7 files changed

+261
-0
lines changed

7 files changed

+261
-0
lines changed

arduino.DuinOS/DuinOS/port.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ extern volatile tskTCB * volatile pxCurrentTCB;
134134
"in r0, 0x3b \n\t" \
135135
"push r0 \n\t" \
136136
"in r0, 0x3c \n\t" \
137+
"push r0 \n\t" \
137138
"push r1 \n\t" \
138139
"clr r1 \n\t" \
139140
"push r2 \n\t" \
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* FreeRTOSConfigATmega2560.h
3+
*
4+
* Created on: 27/01/2013
5+
* Author: extracbd
6+
*/
7+
8+
#ifndef FREERTOSCONFIGATMEGA2560_H_
9+
#define FREERTOSCONFIGATMEGA2560_H_
10+
11+
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 85 )
12+
//##Run experiments to test this value:
13+
#define configTOTAL_HEAP_SIZE ( (size_t ) ( 4096 ) )
14+
//#define configMAX_TASK_NAME_LEN ( 8 )
15+
#define configMAX_TASK_NAME_LEN ( 16 )
16+
#define configUSE_TRACE_FACILITY 0
17+
#define configUSE_16_BIT_TICKS 1
18+
#define configIDLE_SHOULD_YIELD 0
19+
#define configQUEUE_REGISTRY_SIZE 0
20+
21+
/* Co-routine definitions. */
22+
//##2009.10.20: defined as "0":
23+
#define configUSE_CO_ROUTINES 0
24+
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
25+
26+
/* setup() and loop() parameters */
27+
#define configSETUP_STACK_SIZE (configMINIMAL_STACK_SIZE * 2)
28+
#define configLOOP_STACK_SIZE (configMINIMAL_STACK_SIZE)
29+
#define configSETUP_PRIORITY HIGH_PRIORITY
30+
#define configLOOP_PRIORITY LOW_PRIORITY
31+
32+
/* Set the following definitions to 1 to include the API function, or zero
33+
to exclude the API function. */
34+
#define INCLUDE_vTaskPrioritySet 1
35+
#define INCLUDE_uxTaskPriorityGet 1
36+
//##If the following value is set to 1, change the memory managment scheme to heap_2.c:
37+
#define INCLUDE_vTaskDelete 0
38+
#define INCLUDE_vTaskCleanUpResources 0
39+
#define INCLUDE_vTaskSuspend 1
40+
#define INCLUDE_vTaskDelayUntil 1
41+
#define INCLUDE_vTaskDelay 1
42+
#define INCLUDE_xTaskGetSchedulerState 0
43+
44+
#endif /* FREERTOSCONFIGATMEGA2560_H_ */
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* FreeRTOSConfigATmega1284P.h
3+
*
4+
* Created on: 27/01/2013
5+
* Author: extracbd
6+
*/
7+
8+
#ifndef FREERTOSCONFIGATMEGA1284P_H_
9+
#define FREERTOSCONFIGATMEGA1284P_H_
10+
11+
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 85 )
12+
//##Run experiments to test this value:
13+
#define configTOTAL_HEAP_SIZE ( (size_t ) ( 4096 ) )
14+
//#define configMAX_TASK_NAME_LEN ( 8 )
15+
#define configMAX_TASK_NAME_LEN ( 16 )
16+
#define configUSE_TRACE_FACILITY 0
17+
#define configUSE_16_BIT_TICKS 1
18+
#define configIDLE_SHOULD_YIELD 0
19+
#define configQUEUE_REGISTRY_SIZE 0
20+
21+
/* Co-routine definitions. */
22+
//##2009.10.20: defined as "0":
23+
#define configUSE_CO_ROUTINES 0
24+
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
25+
26+
/* setup() and loop() parameters */
27+
#define configSETUP_STACK_SIZE (configMINIMAL_STACK_SIZE * 2)
28+
#define configLOOP_STACK_SIZE (configMINIMAL_STACK_SIZE)
29+
#define configSETUP_PRIORITY HIGH_PRIORITY
30+
#define configLOOP_PRIORITY LOW_PRIORITY
31+
32+
/* Set the following definitions to 1 to include the API function, or zero
33+
to exclude the API function. */
34+
#define INCLUDE_vTaskPrioritySet 1
35+
#define INCLUDE_uxTaskPriorityGet 1
36+
//##If the following value is set to 1, change the memory managment scheme to heap_2.c:
37+
#define INCLUDE_vTaskDelete 0
38+
#define INCLUDE_vTaskCleanUpResources 0
39+
#define INCLUDE_vTaskSuspend 1
40+
#define INCLUDE_vTaskDelayUntil 1
41+
#define INCLUDE_vTaskDelay 1
42+
#define INCLUDE_xTaskGetSchedulerState 0
43+
44+
#endif /* FREERTOSCONFIGATMEGA1284P_H_ */
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* FreeRTOSConfigATmega168P.h
3+
*
4+
* Created on: 27/01/2013
5+
* Author: extracbd
6+
*/
7+
8+
#ifndef FREERTOSCONFIGATMEGA168P_H_
9+
#define FREERTOSCONFIGATMEGA168P_H_
10+
11+
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 85 )
12+
//20101220 : decrease heap size from 800 to 500 - see http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1256745982/46#46
13+
#define configTOTAL_HEAP_SIZE ( (size_t ) ( 500 ) )
14+
//#define configMAX_TASK_NAME_LEN ( 8 )
15+
#define configMAX_TASK_NAME_LEN ( 16 )
16+
#define configUSE_TRACE_FACILITY 0
17+
#define configUSE_16_BIT_TICKS 1
18+
#define configIDLE_SHOULD_YIELD 0
19+
#define configQUEUE_REGISTRY_SIZE 0
20+
21+
/* Co-routine definitions. */
22+
//##2009.10.20: defined as "0":
23+
#define configUSE_CO_ROUTINES 0
24+
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
25+
26+
/* setup() and loop() parameters */
27+
#define configSETUP_STACK_SIZE (configMINIMAL_STACK_SIZE * 2)
28+
#define configLOOP_STACK_SIZE (configMINIMAL_STACK_SIZE)
29+
#define configSETUP_PRIORITY HIGH_PRIORITY
30+
#define configSETUP_PRIORITY LOW_PRIORITY
31+
32+
/* Set the following definitions to 1 to include the API function, or zero
33+
to exclude the API function. */
34+
#define INCLUDE_vTaskPrioritySet 0
35+
#define INCLUDE_uxTaskPriorityGet 0
36+
#define INCLUDE_vTaskDelete 0
37+
#define INCLUDE_vTaskCleanUpResources 0
38+
#define INCLUDE_vTaskSuspend 1
39+
#define INCLUDE_vTaskDelayUntil 1
40+
#define INCLUDE_vTaskDelay 1
41+
#define INCLUDE_xTaskGetSchedulerState 0
42+
43+
#endif /* FREERTOSCONFIGATMEGA168P_H_ */
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* FreeRTOSConfigATmega2560.h
3+
*
4+
* Created on: 27/01/2013
5+
* Author: extracbd
6+
*/
7+
8+
#ifndef FREERTOSCONFIGATMEGA2560_H_
9+
#define FREERTOSCONFIGATMEGA2560_H_
10+
11+
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 85 )
12+
#define configTOTAL_HEAP_SIZE ( (size_t ) ( 4096 ) )
13+
#define configMAX_TASK_NAME_LEN ( 16 )
14+
#define configUSE_TRACE_FACILITY 0
15+
#define configUSE_16_BIT_TICKS 1
16+
#define configIDLE_SHOULD_YIELD 0
17+
#define configQUEUE_REGISTRY_SIZE 0
18+
19+
/* Co-routine definitions. */
20+
//##2009.10.20: defined as "0":
21+
#define configUSE_CO_ROUTINES 0
22+
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
23+
24+
/* setup() and loop() parameters */
25+
#define configSETUP_STACK_SIZE (configMINIMAL_STACK_SIZE * 4)
26+
#define configLOOP_STACK_SIZE (configMINIMAL_STACK_SIZE * 2)
27+
#define configSETUP_PRIORITY HIGH_PRIORITY
28+
#define configLOOP_PRIORITY LOW_PRIORITY
29+
30+
/* Set the following definitions to 1 to include the API function, or zero
31+
to exclude the API function. */
32+
#define INCLUDE_vTaskPrioritySet 1
33+
#define INCLUDE_uxTaskPriorityGet 1
34+
//##If the following value is set to 1, change the memory managment scheme to heap_2.c:
35+
#define INCLUDE_vTaskDelete 1
36+
#define INCLUDE_vTaskCleanUpResources 0
37+
#define INCLUDE_vTaskSuspend 1
38+
#define INCLUDE_vTaskDelayUntil 1
39+
#define INCLUDE_vTaskDelay 1
40+
#define INCLUDE_xTaskGetSchedulerState 1
41+
42+
#endif /* FREERTOSCONFIGATMEGA2560_H_ */
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* FreeRTOSConfigATmega328P.h
3+
*
4+
* Created on: 27/01/2013
5+
* Author: extracbd
6+
*/
7+
8+
#ifndef FREERTOSCONFIGATMEGA328P_H_
9+
#define FREERTOSCONFIGATMEGA328P_H_
10+
11+
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 85 )
12+
#define configTOTAL_HEAP_SIZE ( (size_t ) ( 1200 ) )
13+
#define configMAX_TASK_NAME_LEN ( 8 )
14+
//#define configMAX_TASK_NAME_LEN ( 16 )
15+
#define configUSE_TRACE_FACILITY 0
16+
#define configUSE_16_BIT_TICKS 1
17+
#define configIDLE_SHOULD_YIELD 0
18+
#define configQUEUE_REGISTRY_SIZE 0
19+
#define configUSE_MUTEXES 1
20+
21+
/* Co-routine definitions. */
22+
//##2009.10.20: defined as "0":
23+
#define configUSE_CO_ROUTINES 0
24+
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
25+
26+
/* setup() and loop() parameters */
27+
#define configSETUP_STACK_SIZE (configMINIMAL_STACK_SIZE * 2)
28+
#define configLOOP_STACK_SIZE (configMINIMAL_STACK_SIZE)
29+
#define configSETUP_PRIORITY HIGH_PRIORITY
30+
#define configSETUP_PRIORITY LOW_PRIORITY
31+
32+
/* Set the following definitions to 1 to include the API function, or zero
33+
to exclude the API function. */
34+
#define INCLUDE_vTaskPrioritySet 0
35+
#define INCLUDE_uxTaskPriorityGet 0
36+
#define INCLUDE_vTaskDelete 0
37+
#define INCLUDE_vTaskCleanUpResources 0
38+
#define INCLUDE_vTaskSuspend 1
39+
#define INCLUDE_vTaskDelayUntil 1
40+
#define INCLUDE_vTaskDelay 1
41+
#define INCLUDE_xTaskGetSchedulerState 0
42+
43+
#endif /* FREERTOSCONFIGATMEGA328P_H_ */
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* FreeRTOSConfigATmega644.h
3+
*
4+
* Created on: 27/01/2013
5+
* Author: extracbd
6+
*/
7+
8+
#ifndef FREERTOSCONFIGATMEGA644_H_
9+
#define FREERTOSCONFIGATMEGA644_H_
10+
11+
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 85 )
12+
//##Run experiments to test this value:
13+
#define configTOTAL_HEAP_SIZE ( (size_t ) ( 2048 ) )
14+
//#define configMAX_TASK_NAME_LEN ( 8 )
15+
#define configMAX_TASK_NAME_LEN ( 16 )
16+
#define configUSE_TRACE_FACILITY 0
17+
#define configUSE_16_BIT_TICKS 1
18+
#define configIDLE_SHOULD_YIELD 0
19+
#define configQUEUE_REGISTRY_SIZE 0
20+
21+
/* Co-routine definitions. */
22+
//##2009.10.20: defined as "0":
23+
#define configUSE_CO_ROUTINES 0
24+
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
25+
26+
/* setup() and loop() parameters */
27+
#define configSETUP_STACK_SIZE (configMINIMAL_STACK_SIZE * 2)
28+
#define configLOOP_STACK_SIZE (configMINIMAL_STACK_SIZE)
29+
#define configSETUP_PRIORITY HIGH_PRIORITY
30+
#define configSETUP_PRIORITY LOW_PRIORITY
31+
32+
/* Set the following definitions to 1 to include the API function, or zero
33+
to exclude the API function. */
34+
#define INCLUDE_vTaskPrioritySet 1
35+
#define INCLUDE_uxTaskPriorityGet 1
36+
//##If the following value is set to 1, change the memory managment scheme to heap_2.c:
37+
#define INCLUDE_vTaskDelete 0
38+
#define INCLUDE_vTaskCleanUpResources 0
39+
#define INCLUDE_vTaskSuspend 1
40+
#define INCLUDE_vTaskDelayUntil 1
41+
#define INCLUDE_vTaskDelay 1
42+
#define INCLUDE_xTaskGetSchedulerState 0
43+
44+
#endif /* FREERTOSCONFIGATMEGA644_H_ */

0 commit comments

Comments
 (0)