Add build configurations for small data model and small code model tests to the MSP430X CCS4 demo project.

This commit is contained in:
Richard Barry 2011-01-03 16:41:42 +00:00
parent 16daa60de7
commit 2c894e0f55
6 changed files with 265 additions and 59 deletions

View file

@ -81,10 +81,9 @@
#define configCPU_CLOCK_HZ ( 16000000UL )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 70 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 9 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 10 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
@ -95,6 +94,12 @@
#define configUSE_MALLOC_FAILED_HOOK 1
#define configUSE_APPLICATION_TASK_TAG 0
#ifdef __LARGE_DATA_MODEL__
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 80 )
#else
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 120 )
#endif
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )

View file

@ -53,7 +53,7 @@
; * The definition of the "register test" tasks, as described at the top of
; * main.c
.include data_model.h
.global usRegTest1Counter
@ -68,47 +68,47 @@
vRegTest1Task:
; Fill each general purpose register with a known value.
movx.a #0x44444, r4
movx.a #0x55555, r5
movx.a #0x66666, r6
movx.a #0x77777, r7
movx.a #0x88888, r8
movx.a #0x99999, r9
movx.a #0xaaaaa, r10
movx.a #0xbbbbb, r11
movx.a #0xccccc, r12
movx.a #0xddddd, r13
movx.a #0xeeeee, r14
movx.a #0xfffff, r15
mov_x #0x4444, r4
mov_x #0x5555, r5
mov_x #0x6666, r6
mov_x #0x7777, r7
mov_x #0x8888, r8
mov_x #0x9999, r9
mov_x #0xaaaa, r10
mov_x #0xbbbb, r11
mov_x #0xcccc, r12
mov_x #0xdddd, r13
mov_x #0xeeee, r14
mov_x #0xffff, r15
prvRegTest1Loop:
; Test each general purpose register to check that it still contains the
; expected known value, jumping to vRegTest1Error if any register contains
; an unexpected value.
cmpx.a #0x44444, r4
cmp_x #0x4444, r4
jne vRegTest1Error
cmpx.a #0x55555, r5
cmp_x #0x5555, r5
jne vRegTest1Error
cmpx.a #0x66666, r6
cmp_x #0x6666, r6
jne vRegTest1Error
cmpx.a #0x77777, r7
cmp_x #0x7777, r7
jne vRegTest1Error
cmpx.a #0x88888, r8
cmp_x #0x8888, r8
jne vRegTest1Error
cmpx.a #0x99999, r9
cmp_x #0x9999, r9
jne vRegTest1Error
cmpx.a #0xaaaaa, r10
cmp_x #0xaaaa, r10
jne vRegTest1Error
cmpx.a #0xbbbbb, r11
cmp_x #0xbbbb, r11
jne vRegTest1Error
cmpx.a #0xccccc, r12
cmp_x #0xcccc, r12
jne vRegTest1Error
cmpx.a #0xddddd, r13
cmp_x #0xdddd, r13
jne vRegTest1Error
cmpx.a #0xeeeee, r14
cmp_x #0xeeee, r14
jne vRegTest1Error
cmpx.a #0xfffff, r15
cmp_x #0xffff, r15
jne vRegTest1Error
; This task is still running without jumping to vRegTest1Error, so increment
@ -130,48 +130,48 @@ vRegTest1Error:
; different values in its registers.
vRegTest2Task:
movx.a #0x14441, r4
movx.a #0x15551, r5
movx.a #0x16661, r6
movx.a #0x17771, r7
movx.a #0x18881, r8
movx.a #0x19991, r9
movx.a #0x1aaa1, r10
movx.a #0x1bbb1, r11
movx.a #0x1ccc1, r12
movx.a #0x1ddd1, r13
movx.a #0x1eee1, r14
movx.a #0x1fff1, r15
mov_x #0x4441, r4
mov_x #0x5551, r5
mov_x #0x6661, r6
mov_x #0x7771, r7
mov_x #0x8881, r8
mov_x #0x9991, r9
mov_x #0xaaa1, r10
mov_x #0xbbb1, r11
mov_x #0xccc1, r12
mov_x #0xddd1, r13
mov_x #0xeee1, r14
mov_x #0xfff1, r15
prvRegTest2Loop:
cmpx.a #0x14441, r4
cmp_x #0x4441, r4
jne vRegTest2Error
cmpx.a #0x15551, r5
cmp_x #0x5551, r5
jne vRegTest2Error
cmpx.a #0x16661, r6
cmp_x #0x6661, r6
jne vRegTest2Error
cmpx.a #0x17771, r7
cmp_x #0x7771, r7
jne vRegTest2Error
cmpx.a #0x18881, r8
cmp_x #0x8881, r8
jne vRegTest2Error
cmpx.a #0x19991, r9
cmp_x #0x9991, r9
jne vRegTest2Error
cmpx.a #0x1aaa1, r10
cmp_x #0xaaa1, r10
jne vRegTest2Error
cmpx.a #0x1bbb1, r11
cmp_x #0xbbb1, r11
jne vRegTest2Error
cmpx.a #0x1ccc1, r12
cmp_x #0xccc1, r12
jne vRegTest2Error
cmpx.a #0x1ddd1, r13
cmp_x #0xddd1, r13
jne vRegTest2Error
cmpx.a #0x1eee1, r14
cmp_x #0xeee1, r14
jne vRegTest2Error
cmpx.a #0x1fff1, r15
cmp_x #0xfff1, r15
jne vRegTest2Error
; Also perform a manual yield, just to increase the scope of the test.
calla #vPortYield
call_x #vPortYield
incx.w &usRegTest2Counter
jmp prvRegTest2Loop

View file

@ -105,9 +105,14 @@ interrupt void prvRunTimeStatsOverflowISR( void )
unsigned long ulGetRunTimeStatsTime( void )
{
unsigned long ulReturn;
unsigned short usCounterSnapshot;
TA1CTL &= ~MC__CONTINOUS;
ulReturn = ( ( ulStatsOverflowCount << 16UL ) | ( unsigned long ) TA1R );
_nop();
_nop();
ulReturn = ( ulStatsOverflowCount << 16UL );
usCounterSnapshot = TA1R;
ulReturn |= ( unsigned long ) usCounterSnapshot;
TA1CTL |= MC__CONTINOUS;
return ulReturn;

View file

@ -126,7 +126,7 @@
* error has occurred. The nature of the reg test tasks necessitates that they
* are written in assembly code.
*
* *NOTE 2* vApplicationSetupTimerInterrupt() is called by the kernel to let
* *NOTE 1* vApplicationSetupTimerInterrupt() is called by the kernel to let
* the application set up a timer to generate the tick interrupt. In this
* example a timer A0 is used for this purpose.
*
@ -355,8 +355,16 @@ unsigned char ucLine = 1;
printf( cBuffer );
fflush( stdout );
/* Also print out a message to
the LCD - in this case the
/* Also generate and output a
table of task states. */
printf( "\nTask\t\tState Priority\tStack\t#\n*****************************************" );
fflush( stdout );
vTaskList( ( signed char * ) cBuffer );
printf( cBuffer );
fflush( stdout );
/* Finally print out a message
to the LCD - in this case the
pointer to the string to print
is sent directly in the
ulMessageValue member of the