update hosts for cored target
WIP: currently the hosts are not generic and don't support different targets
This commit is contained in:
37
targets/lib_cored.h
Normal file
37
targets/lib_cored.h
Normal file
@ -0,0 +1,37 @@
|
||||
#ifndef _include_lib_cored_h
|
||||
#define _include_lib_cored_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define SENSORS_COUNT 3
|
||||
#define FILTER_COUNT 3
|
||||
|
||||
typedef uint16_t enc_t;
|
||||
typedef uint8_t plain_t;
|
||||
typedef int8_t sign_t;
|
||||
|
||||
#define check(vc, A, B) (((vc - B) % A) == 0)
|
||||
#define encode(v, A, B) ((((plain_t)v) * ((sign_t)A)) + ((sign_t)B))
|
||||
#define decode(vc, A, B) ((vc - B) / A)
|
||||
|
||||
#define equals(vc1, vc2, B1, B2) ((vc1 - vc2) == (B1 - B2))
|
||||
|
||||
#define THE_A 110
|
||||
|
||||
// CONSTANT Replica results signatures
|
||||
#define SIG_X 32
|
||||
#define SIG_Y 23
|
||||
#define SIG_Z 67
|
||||
#define SIG_MAX SIG_Z
|
||||
|
||||
// CONSTANT Voter Result Signatures
|
||||
#define SIG_s_XYZ ((SIG_X - SIG_Y) + (SIG_X - SIG_Z))
|
||||
#define SIG_s_XY (SIG_X - SIG_Y)
|
||||
#define SIG_s_YZ (SIG_Y - SIG_Z)
|
||||
#define SIG_s_XZ (SIG_X - SIG_Z)
|
||||
|
||||
#define XC filter_out[0]
|
||||
#define YC filter_out[1]
|
||||
#define ZC filter_out[2]
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user