*/\r
#include "msp430.h"\r
#include "FreeRTOSConfig.h"\r
+#include "data_model.h"\r
+\r
+/*\r
+ * The definition of the "register test" tasks, as described at the top of\r
+ * main.c\r
+ */\r
+\r
+\r
\r
IMPORT usRegTest1Counter\r
IMPORT usRegTest2Counter\r
+ IMPORT vPortYield\r
\r
EXPORT vRegTest1Task\r
EXPORT vRegTest2Task\r
\r
vRegTest1Task:\r
\r
- movx.a #0x44444, r4\r
- movx.a #0x55555, r5\r
- movx.a #0x66666, r6\r
- movx.a #0x77777, r7\r
- movx.a #0x88888, r8\r
- movx.a #0x99999, r9\r
- movx.a #0xaaaaa, r10\r
- movx.a #0xbbbbb, r11\r
- movx.a #0xccccc, r12\r
- movx.a #0xddddd, r13\r
- movx.a #0xeeeee, r14\r
- movx.a #0xfffff, r15\r
+ /* Fill each general purpose register with a known value. */\r
+ mov_x #0x4444, r4\r
+ mov_x #0x5555, r5\r
+ mov_x #0x6666, r6\r
+ mov_x #0x7777, r7\r
+ mov_x #0x8888, r8\r
+ mov_x #0x9999, r9\r
+ mov_x #0xaaaa, r10\r
+ mov_x #0xbbbb, r11\r
+ mov_x #0xcccc, r12\r
+ mov_x #0xdddd, r13\r
+ mov_x #0xeeee, r14\r
+ mov_x #0xffff, r15\r
\r
prvRegTest1Loop:\r
\r
- cmpx.a #0x44444, r4\r
+ /* Test each general purpose register to check that it still contains the\r
+ expected known value, jumping to vRegTest1Error if any register contains\r
+ an unexpected value. */\r
+ cmp_x #0x4444, r4\r
jne vRegTest1Error\r
- cmpx.a #0x55555, r5\r
+ cmp_x #0x5555, r5\r
jne vRegTest1Error\r
- cmpx.a #0x66666, r6\r
+ cmp_x #0x6666, r6\r
jne vRegTest1Error\r
- cmpx.a #0x77777, r7\r
+ cmp_x #0x7777, r7\r
jne vRegTest1Error\r
- cmpx.a #0x88888, r8\r
+ cmp_x #0x8888, r8\r
jne vRegTest1Error\r
- cmpx.a #0x99999, r9\r
+ cmp_x #0x9999, r9\r
jne vRegTest1Error\r
- cmpx.a #0xaaaaa, r10\r
+ cmp_x #0xaaaa, r10\r
jne vRegTest1Error\r
- cmpx.a #0xbbbbb, r11\r
+ cmp_x #0xbbbb, r11\r
jne vRegTest1Error\r
- cmpx.a #0xccccc, r12\r
+ cmp_x #0xcccc, r12\r
jne vRegTest1Error\r
- cmpx.a #0xddddd, r13\r
+ cmp_x #0xdddd, r13\r
jne vRegTest1Error\r
- cmpx.a #0xeeeee, r14\r
+ cmp_x #0xeeee, r14\r
jne vRegTest1Error\r
- cmpx.a #0xfffff, r15\r
+ cmp_x #0xffff, r15\r
jne vRegTest1Error\r
+ \r
+ /* This task is still running without jumping to vRegTest1Error, so increment\r
+ the loop counter so the check task knows the task is running error free. */\r
incx.w &usRegTest1Counter\r
+ \r
+ /* Loop again, performing the same tests. */\r
jmp prvRegTest1Loop\r
nop\r
\r
vRegTest1Error:\r
jmp vRegTest1Error\r
nop\r
+ \r
/*-----------------------------------------------------------*/\r
\r
+/* See the comments in vRegTest1Task. This task is the same, it just uses\r
+different values in its registers. */\r
vRegTest2Task:\r
\r
- movx.a #0x44444, r4\r
- movx.a #0x55555, r5\r
- movx.a #0x66666, r6\r
- movx.a #0x77777, r7\r
- movx.a #0x88888, r8\r
- movx.a #0x99999, r9\r
- movx.a #0xaaaaa, r10\r
- movx.a #0xbbbbb, r11\r
- movx.a #0xccccc, r12\r
- movx.a #0xddddd, r13\r
- movx.a #0xeeeee, r14\r
- movx.a #0xfffff, r15\r
+ mov_x #0x4441, r4\r
+ mov_x #0x5551, r5\r
+ mov_x #0x6661, r6\r
+ mov_x #0x7771, r7\r
+ mov_x #0x8881, r8\r
+ mov_x #0x9991, r9\r
+ mov_x #0xaaa1, r10\r
+ mov_x #0xbbb1, r11\r
+ mov_x #0xccc1, r12\r
+ mov_x #0xddd1, r13\r
+ mov_x #0xeee1, r14\r
+ mov_x #0xfff1, r15\r
\r
prvRegTest2Loop:\r
\r
- cmpx.a #0x44444, r4\r
+ cmp_x #0x4441, r4\r
jne vRegTest2Error\r
- cmpx.a #0x55555, r5\r
+ cmp_x #0x5551, r5\r
jne vRegTest2Error\r
- cmpx.a #0x66666, r6\r
+ cmp_x #0x6661, r6\r
jne vRegTest2Error\r
- cmpx.a #0x77777, r7\r
+ cmp_x #0x7771, r7\r
jne vRegTest2Error\r
- cmpx.a #0x88888, r8\r
+ cmp_x #0x8881, r8\r
jne vRegTest2Error\r
- cmpx.a #0x99999, r9\r
+ cmp_x #0x9991, r9\r
jne vRegTest2Error\r
- cmpx.a #0xaaaaa, r10\r
+ cmp_x #0xaaa1, r10\r
jne vRegTest2Error\r
- cmpx.a #0xbbbbb, r11\r
+ cmp_x #0xbbb1, r11\r
jne vRegTest2Error\r
- cmpx.a #0xccccc, r12\r
+ cmp_x #0xccc1, r12\r
jne vRegTest2Error\r
- cmpx.a #0xddddd, r13\r
+ cmp_x #0xddd1, r13\r
jne vRegTest2Error\r
- cmpx.a #0xeeeee, r14\r
+ cmp_x #0xeee1, r14\r
jne vRegTest2Error\r
- cmpx.a #0xfffff, r15\r
+ cmp_x #0xfff1, r15\r
jne vRegTest2Error\r
+ \r
+ /* Also perform a manual yield, just to increase the scope of the test. */\r
+ calla #vPortYield\r
+ \r
incx.w &usRegTest2Counter\r
jmp prvRegTest2Loop\r
nop\r