-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathqrencode.h
39 lines (34 loc) · 902 Bytes
/
qrencode.h
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
#ifndef __AVR__
#define PROGMEM
#define memcpy_P memcpy
#define __LPM(x) *x
#define pgm_read_word(x) *x
#else
#include <avr/pgmspace.h>
#define USEPRECALC
#endif
/*#ifndef USEPRECALC
// malloc-ed by initframe, free manually
extern unsigned char *strinbuf; // string iput buffer
extern unsigned char *qrframe;
// setup the base frame structure - can be reused
void initframe(void);
// free the basic frame malloced structures
void freeframe(void);
// these resturn maximum string size to send in
unsigned initeccsize(unsigned char ecc, unsigned size);
unsigned initecc(unsigned char level,unsigned char version);
#else // precalc-ed arrays*/
extern unsigned char strinbuf[];
extern unsigned char qrframe[];
// #endif
extern unsigned char WD, WDB;
#include "qrbits.h"
#ifdef __cplusplus
extern "C"{
#endif
// strinbuf in, qrframe out
void qrencode(void);
#ifdef __cplusplus
} // extern "C"
#endif