-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathksfeeder.c
67 lines (57 loc) · 1.96 KB
/
ksfeeder.c
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
/**
* __ ____
* / /__ _ __ / __/ __
* / //_/(_)/ /_ / / ___ ____ ___ __ __ / /_
* / ,< / // __/_\ \ / _ \ / __// _ \/ // // __/
* /_/|_|/_/ \__//___// .__//_/ \___/\_,_/ \__/
* /_/ github.com/KitSprout
*
* @file ksentry.c
* @author KitSprout
* @brief
*
*/
/* Includes --------------------------------------------------------------------------------*/
#include <stdlib.h>
#include <string.h>
#include "kslog.h"
#include "ksfeeder.h"
/* Define ----------------------------------------------------------------------------------*/
/* Macro -----------------------------------------------------------------------------------*/
/* Typedef ---------------------------------------------------------------------------------*/
/* Variables -------------------------------------------------------------------------------*/
static int isinited = KS_FALSE;
/* Prototypes ------------------------------------------------------------------------------*/
/* Functions -------------------------------------------------------------------------------*/
/**
* @brief ksfeeder
*/
int ksfeeder(int index, ksraw_tag_t *raw)
{
if (!isinited)
{
if (raw->dt > 1)
{
// klogd("[%6d] error dt \n", index);
raw->index--;
return KS_FALSE;
}
isinited = KS_TRUE;
klogd("\n[%6d] init ... \n", index);
// user init process
// ...
}
#if 1
klogd("[%6d][%.0fHz] ", index, 1.0 / raw->dt);
klogd("[dt] %.3f [g] %10.6f,%10.6f,%10.6f [a] %8.4f,%8.4f,%8.4f [m] %7.2f,%7.2f,%7.2f [t] %.3f\n",
raw->dt,
raw->g[0], raw->g[1], raw->g[2],
raw->a[0], raw->a[1], raw->a[2],
raw->m[0], raw->m[1], raw->m[2],
raw->t);
#endif
// user run process
// ...
return KS_TRUE;
}
/*************************************** END OF FILE ****************************************/