70 lines
2.0 KiB
C
70 lines
2.0 KiB
C
//
|
|
// Created by cfif on 14.10.22.
|
|
//
|
|
|
|
#ifndef UVEOS_ON_NATION_DeviceTestsTable_H
|
|
#define UVEOS_ON_NATION_DeviceTestsTable_H
|
|
|
|
#include "stdint.h"
|
|
#include <stdbool.h>
|
|
#include "cmsis_os.h"
|
|
#include "DeviceTestsResults.h"
|
|
|
|
typedef eDeviceTestingCode (*TestMethod)(void *env);
|
|
|
|
typedef struct {
|
|
char str[16];
|
|
uint8_t length;
|
|
} tTestName;
|
|
|
|
typedef struct {
|
|
tTestName name;
|
|
void *testEnv;
|
|
TestMethod testMethod;
|
|
uint16_t result;
|
|
uint16_t modesFlag;
|
|
} tTestDescriptor;
|
|
|
|
#define DEVICE_TEST_NAME(STR) (tTestName){.str=(STR), .length=sizeof(STR)-1}
|
|
|
|
typedef struct {
|
|
tTestDescriptor *items;
|
|
uint16_t itemsLimit;
|
|
uint16_t count;
|
|
osMutexId_t rmcAccess;
|
|
|
|
uint16_t currentProcessMode;
|
|
uint16_t currentProcessIterationsLeft;
|
|
|
|
uint32_t testProcessBegin;
|
|
uint32_t testProcessEnd;
|
|
} tDeviceTestsTable;
|
|
|
|
|
|
void DeviceTestsTableInit(tDeviceTestsTable *env, tTestDescriptor *itemsMem, uint16_t itemsLimit);
|
|
|
|
#define DeviceTestsTableInitStatic(ENV, MEM) DeviceTestsTableInit(ENV,MEM,sizeof(MEM)/ sizeof(tTestDescriptor))
|
|
|
|
tTestDescriptor* DeviceTestsTableAdd(tDeviceTestsTable *env, tTestName name, void *testEnv, TestMethod method, uint16_t modesFlag);
|
|
|
|
void DeviceTestsTable_TestInMode(tDeviceTestsTable *env, uint16_t modesFlag, uint16_t timeout);
|
|
|
|
bool DeviceTestsTable_AnyTestHasCode(tDeviceTestsTable *env, eDeviceTestingCode code);
|
|
|
|
tTestDescriptor *DeviceTestsTable_GetModeTest(tDeviceTestsTable *env, uint16_t modesFlag, char *name, uint8_t nameSize);
|
|
|
|
#define DeviceTestsTable_GetModeTestStatic(ENV, MODE, NAME) DeviceTestsTable_GetModeTest(ENV,MODE, NAME,sizeof(NAME)-1)
|
|
|
|
uint16_t DeviceTestsTable_MakeTest(tTestDescriptor *test);
|
|
|
|
//uint16_t getTestRepeats(tDeviceTestsTable *env, uint16_t id);
|
|
//
|
|
//uint16_t getTestResult(tDeviceTestsTable *env, uint16_t id);
|
|
//
|
|
//void setTestRepeats(tDeviceTestsTable *env, uint16_t id, uint16_t value);
|
|
//
|
|
//void setTestResult(tDeviceTestsTable *env, uint16_t id, uint16_t value);
|
|
|
|
|
|
#endif //UVEOS_ON_NATION_DeviceTestsTable_H
|