-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathutils.cpp
More file actions
37 lines (30 loc) · 737 Bytes
/
utils.cpp
File metadata and controls
37 lines (30 loc) · 737 Bytes
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
/*
tfrec - Receiver for TFA IT+ (and compatible) sensors
(c) 2017 Georg Acher, Deti Fliegl {acher|fliegl}(at)baycom.de
#include <GPL-v2>
*/
#include "utils.h"
#include <stdio.h>
#include <stdlib.h>
void dump16(char* name, int16_t *data, int len)
{
printf("DUMP16 %s %i\n",name,len);
FILE *f=fopen(name,"wb");
fwrite(data,len,sizeof(int16_t),f);
fclose(f);
}
void dump16i(char* name, int16_t *data, int len)
{
printf("DUMP16i %s %i\n",name,len);
FILE *f=fopen(name,"wb");
for(int i=0;i<len;i+=2)
fwrite(data+i,1,sizeof(int16_t),f);
fclose(f);
}
void dump8(char *name, unsigned char *buf, int len)
{
printf("DUMP8 %s %i\n",name,len);
FILE *f=fopen(name,"wb");
fwrite(buf,len,1,f);
fclose(f);
}