-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.h
34 lines (26 loc) · 957 Bytes
/
main.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* main.h
*
* Created on: 21-May-2021
* Author: rahul tiwari
*/
#ifndef MAIN_H_
#define MAIN_H_
#define MAX_TASKS 4
//some stack memory calculation
#define SIZE_TASK_STACK 1024U
#define SIZE_SCHED_STACK 1024U
#define SRAM_START 0x20000000U
#define SIZE_SRAM ((128)*(1024))
#define SRAM_END (SRAM_START) + (SIZE_SRAM)
//ALLOCATION OF STACK FOR TASKS IS DONE KEEPING IN MIND THAT SRAM IS FULL DESCENDING
#define T1_STACK_START SRAM_END
#define T2_STACK_START ((SRAM_END) - (SIZE_TASK_STACK))
#define T3_STACK_START ((SRAM_END) - 2*(SIZE_TASK_STACK))
#define T4_STACK_START ((SRAM_END) - 3*(SIZE_TASK_STACK))
#define SCHED_STACK_START ((SRAM_END) - 4*(SIZE_TASK_STACK))
#define TICK_HZ 1000U
#define HSI_CLK 16000000U
#define SYSTICK_TIM_CLK HSI_CLK
#define DUMMY_XPSR 0X01000000U
#endif /*main.h*/