forked from Digilent/openscope-mz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMfgTest.cpp
104 lines (99 loc) · 2.97 KB
/
MfgTest.cpp
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
/************************************************************************/
/* */
/* MfgTest.cpp */
/* */
/* These are undocumented Manufacturing Tests */
/* */
/************************************************************************/
/* Author: Keith Vogel */
/* Copyright 2016, Digilent Inc. */
/************************************************************************/
/* Revision History: */
/* 2/27/2017(KeithV): Created */
/* 2/27/2017(TommyK): Manufacturing Test Code */
/************************************************************************/
#include <OpenScope.h>
/************************************************************************/
// Manufacturing Test JSON parsing
//
// command format:
//
// {
// "test":[
// {
// "command":"run",
// "testNbr": <number>
// }
// ]
// }
//
//
// reponse format:
//
// {
// "test":[
// {
// "command":"run",
// "statusCode": 0,
// "wait": 0,
// "returnNbr": <number>
// }
// ]
// }
//
//
//
// Multi-commands are permitted, such as ....
// {
// "test":[
// {
// "command":"run",
// "testNbr": 1
// },
// {
// "command":"run",
// "testNbr": 2
// }
// ]
// }
//
//
// Multi-command reponse format:
//
// {
// "test":[
// {
// "command":"run",
// "statusCode": 0,
// "wait": 0,
// "returnNbr": 1
// },
// {
// "command":"run",
// "statusCode": 0,
// "wait": 0,
// "returnNbr": 2
// }
// ]
// }
//
//
/************************************************************************/
/*** uint32_t MfgTest(uint32_t testNbr)
*
* Parameters:
* testNbr - The test number to run
*
* Return Values:
* uint32_t - the result of the test, this can be an error code, bit string, anything that can be expressed as a 32 bit number
*
* Description:
*
* Executes the Manufacturing test inline with the JSON parsing, each test should not take more than 20-30 msec, if more time is
* needed, it should be broken up into multiple tests.
*
* ------------------------------------------------------------ */
uint32_t MfgTest(uint32_t testNbr)
{
return(testNbr+1);
}