-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathrmp_test_msp430fr5994.h
135 lines (123 loc) · 5.33 KB
/
rmp_test_msp430fr5994.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/******************************************************************************
Filename : rmp_test_msp430fr5994.h
Author : pry
Date : 22/07/2017
Licence : The Unlicense; see LICENSE for details.
Description : The testbench for MSP430FR5994.
This test is slow. It takes typ.3 min to run @ 16MHz.
TICC V21.6.1LTS -O4 -mf5 (OS timer disabled)
___ __ ___ ___
/ _ \ / |/ // _ \ Simple real-time kernel
/ , _// /|_/ // ___/ Standard benchmark test
/_/|_|/_/ /_//_/
====================================================
Test (number in CPU cycles) : AVG / MAX / MIN
Yield : 450 / 450 / 450
Mailbox : 977 / 977 / 977
Semaphore : 847 / 847 / 847
FIFO : 435 / 435 / 435
Message queue : 1443 / 1444 / 1443
Blocking message queue : 1885 / 1885 / 1885
Memory allocation/free pair : 3508 / 3620 / 3411
ISR Mailbox : 874 / 875 / 340
ISR Semaphore : 792 / 792 / 792
ISR Message queue : 1156 / 1156 / 1156
ISR Blocking message queue : 1413 / 1413 / 1413
TICC V21.6.1LTS -O4 -mf5 (OS timer enabled)
___ __ ___ ___
/ _ \ / |/ // _ \ Simple real-time kernel
/ , _// /|_/ // ___/ Standard benchmark test
/_/|_|/_/ /_//_/
====================================================
Test (number in CPU cycles) : AVG / MAX / MIN
Yield : 468 / 694 / 468
Mailbox : 1054 / 1278 / 1052
Semaphore : 891 / 1116 / 890
FIFO : 492 / 717 / 492
Message queue : 1573 / 1797 / 1571
Blocking message queue : 2072 / 2296 / 2070
Memory allocation/free pair : 3291 / 3415 / 3191
ISR Mailbox : 891 / 1115 / 419
ISR Semaphore : 784 / 1009 / 783
ISR Message queue : 1176 / 1400 / 1175
ISR Blocking message queue : 1464 / 1687 / 1462
******************************************************************************/
/* Include *******************************************************************/
#include "rmp.h"
/* End Include ***************************************************************/
/* Define ********************************************************************/
/* Counter read wrapper */
#define RMP_CNT_READ() (TA1R)
/* Memory pool test switch */
#define TEST_MEM_POOL (4096U)
#pragma PERSISTENT(Pool)
/* Minimal build switch */
/* #define MINIMAL_SIZE */
/* Timestamp data type */
typedef rmp_u16_t rmp_tim_t;
/* End Define ****************************************************************/
/* Global ********************************************************************/
#ifndef MINIMAL_SIZE
rmp_ptr_t Stack_1[256];
rmp_ptr_t Stack_2[256];
struct Timer_A_initUpModeParam TIM1_Handle={0};
void Timer_Init(void);
void Int_Init(void);
void Int_Handler(void);
void Int_Disable(void);
/* End Global ****************************************************************/
/* Function:Timer_Init ********************************************************
Description : Initialize the timer for timing measurements. This function needs
to be adapted to your specific hardware.
Input : None.
Output : None.
Return : None.
******************************************************************************/
void Timer_Init(void)
{
/* TIMA1 clock = CPU clock */
TIM1_Handle.clockSource=TIMER_A_CLOCKSOURCE_SMCLK;
TIM1_Handle.clockSourceDivider=TIMER_A_CLOCKSOURCE_DIVIDER_1;
TIM1_Handle.timerPeriod=0xFFFF;
TIM1_Handle.timerInterruptEnable_TAIE=TIMER_A_TAIE_INTERRUPT_DISABLE;
TIM1_Handle.captureCompareInterruptEnable_CCR0_CCIE=TIMER_A_CCIE_CCR0_INTERRUPT_DISABLE;
TIM1_Handle.timerClear=TIMER_A_SKIP_CLEAR;
TIM1_Handle.startTimer=1;
Timer_A_initUpMode(TA1_BASE,&TIM1_Handle);
}
/* End Function:Timer_Init ***************************************************/
/* Function:Int_Init **********************************************************
Description : Initialize an periodic interrupt source. This function needs
to be adapted to your specific hardware.
Input : None.
Output : None.
Return : None.
******************************************************************************/
void Int_Init(void)
{
/* Make sure that we also generate interrupts from the same timer */
TA1CCTL0|=CCIE;
}
/* The interrupt handler */
void TIM1_IRQHandler(void)
{
TA1CCTL0&=~CCIFG;
Int_Handler();
}
/* End Function:Int_Init *****************************************************/
/* Function:Int_Disable *******************************************************
Description : Disable the periodic interrupt source. This function needs
to be adapted to your specific hardware.
Input : None.
Output : None.
Return : None.
******************************************************************************/
void Int_Disable(void)
{
/* Disable TIMA1 interrupt */
TA1CCTL0&=~CCIE;
}
#endif
/* End Function:Int_Disable **************************************************/
/* End Of File ***************************************************************/
/* Copyright (C) Evo-Devo Instrum. All rights reserved ***********************/