In order to bring consistency in-tree, migrate all samples to the use
the new prefix <zephyr/...>. Note that the conversion has been scripted:
```python
from pathlib import Path
import re
EXTENSIONS = ("c", "h", "cpp", "rst")
for p in Path(".").glob("samples/**/*"):
if not p.is_file() or p.suffix and p.suffix[1:] not in EXTENSIONS:
continue
content = ""
with open(p) as f:
for line in f:
m = re.match(r"^(.*)#include <(.*)>(.*)$", line)
if (m and
not m.group(2).startswith("zephyr/") and
(Path(".") / "include" / "zephyr" / m.group(2)).exists()):
content += (
m.group(1) +
"#include <zephyr/" + m.group(2) +">" +
m.group(3) + "\n"
)
else:
content += line
with open(p, "w") as f:
f.write(content)
```
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
38 lines
688 B
C
38 lines
688 B
C
/* enc.h */
|
|
|
|
/*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
|
|
#ifndef ENC_H
|
|
#define ENC_H
|
|
|
|
#include <zephyr/sys/printk.h>
|
|
|
|
#define WHEEL_SIZE 26
|
|
#define IMOD(a, b) ((a + b) % WHEEL_SIZE)
|
|
|
|
#ifndef BYTE
|
|
#define BYTE unsigned char
|
|
#endif
|
|
|
|
void update_wheel_index(void);
|
|
char index_to_char(short i);
|
|
short char_to_index(char c);
|
|
int calc_rev_wheel(BYTE *wheel, BYTE *backpath);
|
|
char enig_enc(char pt);
|
|
|
|
extern volatile BYTE W1[26];
|
|
extern volatile BYTE W2[26];
|
|
extern volatile BYTE W3[26];
|
|
extern volatile BYTE R[26];
|
|
extern volatile BYTE W1R[26];
|
|
extern volatile BYTE W2R[26];
|
|
extern volatile BYTE W3R[26];
|
|
extern volatile int IW1;
|
|
extern volatile int IW2;
|
|
extern volatile int IW3;
|
|
|
|
#endif
|